ILVerify is an open-source tool developed by Microsoft. I started contributing to ILVerify as part of my internship at Dynatrace and continued developing it in my free time. This work mainly consisted of implementing verification rules in C# and porting them from an existing C++ code-base.
Description
The goal of the project is to create a standalone, cross platform, open-source tool capable of verifying IL code based on ECMA-335. You can find the entire source located inside the .NET CoreRT repository.
The main users of this tool are people working on software which emits IL code, such as compiler, debugger or profiler writers.
At the end of my internship at Dynatrace I also wrote a Blogpost about my work on ILVerify.
Instructions
Currently ILVerify can be executed as a console-app, even though a public API is planned. In order to verify an assembly’s IL code you have to specify its location and the location of all assemblies it references. For example, in order to verify the assembly asm.exe, which references mscorlib.dll and System.dll, you would run:
ilverify.exe <path-to-asm.exe> -reference <path-to-mscorlib.dll> -reference <path-to-system.dll>
or simply:
ilverify.exe <path-to-asm.exe> -r <path-to-libfolder-*.dll>
Additionally you can specify a regular expression defining specific methods to be included or excluded with -include and -exclude, or just -i and -e. You can also define the base library to be used with -system-module, or just -s, for assemblies using a base library other than mscorlib.
Time of Development
Mid 2017 – Early 2018