Common Intermediate Language reader, analyzer and visualizer tool.
Allows you to access CIL-instructions of .Net method's bodies.
Provides a way to read and interprete CIL-bytes of methods and delegates bodies.
Usage:
var method = typeof(...).GetMethod(...); // or var method = delegate.Method; // or var method = (DynamicMethod)(/* create or get method */);Get Reader:
IILReader GetReader(MethodBase method) { IILReaderConfiguration cfg = Configuration.Resolve(method); return reader = cfg.GetReader(method); }Iterate instructions one-by-one:
foreach(IInstruction instruction in reader) { var opCode = instruction.OpCode object operand = instruction.Operand; int ILOffset = instruction.Offset; // ... }Debugger Visualizer for Visual Studio. Provides a way to view CIL-bytes of methods and delegates bodies.
Usage:
Func<...> someFunc = ...; // Just use it while debuggingProvides a way to detect typical patterns in CIL-bytes.
Usage:
class Bar { public void Stub() { throw new NotImplementedException("Stub"); } }Check whether or not the method's body match pattern:
var method = typeof(Bar).GetMethod("Stub"); var reader = GetReader(method); // use default pattern or create you own var pattern = Analyzer.NotImplemented.Instance; if (pattern.Match(reader)) { // do something }- MSIL-level boxing detector tool for .Net
- Simple static analysis(SA) tool to analyze .Net assemblies at the IL-code level with visual client
To install ILReader.Core, run the following command in the Package Manager Console:
Install-Package ILReader.Core The ILReader.Core library is licensed under the MIT license.