Skip to main content
Version: 2024.1

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

  1. Open obfuscatable project inside the IDE

  2. 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.cs or ObfuscationSettings.vb

  3. Fill ObfuscationSettings.cs with the following content (C#):

    using System;
    using System.Reflection;

    [assembly: Obfuscation(Feature = "PEVerify", Exclude = false)]

    For Visual Basic .NET, fill ObfuscationSettings.vb with the following content:

    Imports System
    Imports System.Reflection

    <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.