I saw a couple of post(this post specifically) talking about using peverify.exe to check whether the .net exe(or dll) contains unsafe code. But no matter what I do I keep getting File not found or has bad headers error.
Here are my steps -
- Open developer power shell for 2022 - Note I did not change the path to where the exe is.
peverify <complete path of the dll or exe>- Enter
I keep getting File not found or has bad headers error. This should be simple yet there is something I am missing?
Other attempts with different command with same result is as follows
- peverify.exe <complete path of the exe/dll> /md /il
- Tried running the same in Developer Command Prompt for visual studio 2022
PEVerify is for the "old" Windows-specific .NET Framework. A newer tool was created for .NET 5+ and .NET Core (although it also works with the old .NET Framework), ILVerify.
To install and run (copying from the README, so this information is here instead of susceptible to link rot):
The package itself is
dotnet-ilverifyon NuGet.org (here).