4.13. PEVerify Integration
PEVerify tool allows to check assemblies to determine whether MSIL code and associated metadata meet type safety requirements. .NET verification has the special meaning in security constrained environments such as Windows Phone, WinRT and Silverlight, where running the unverifiable code can produce unexpected results, sometimes rendering the application unworkable.
Eazfuscator.NET modifies metadata and MSIL assembly code during obfuscation. So it may be profitable to ensure that the output assembly still meets type safety requirements.
PEVerify.exe is distributed as a part of .NET SDK which is installed together with Microsoft Visual Studio and can be invoked manually. But Eazfuscator.NET provides a much better option: an ability to automatically invoke PEVerify tool after obfuscation. Please use the instructions below in order to use the latter feature.
Instructions on turning on the PEVerify tool for an output assembly
Open obfuscatable project inside the IDE
Add new source file to the project and call it
ObfuscationSettings.cs(for C#) or
ObfuscationSettings.vb(for Visual Basic .NET). You may prefer to use another name instead of
ObfuscationSettings.cswith the following content (C#):
[assembly: Obfuscation(Feature = "PEVerify", Exclude = false)]
For Visual Basic .NET, fill
ObfuscationSettings.vbwith the following content:
<Assembly: Obfuscation(Feature:="PEVerify", Exclude:=False)>
Currently, PEVerify tool doesn't support assemblies targeting .NET Standard, .NET Core, and .NET 5.0+. The verification directive is ignored for these platforms.