CIL Suite is a collection of tools for processing Common Intermediate Language (CIL). This project is a natural extension to the popular Mono.Cecil toolkit; however, whereas Cecil handles parsing bytecode, the CIL Suite is for handling several common tasks in analyzing software.

CIL Diff

Need to perform differences across binaries? CIL Diff is like the unix diff, except CIL Diff operates on the bytecode level rather than text lines. This allows comparisons to be made between types, methods and properties/fields.

GetChangedCodeElements Get just the types, methods, and properties that have changed between the two versions.
GetChangeSummary Get a text summary of the changes.
GetMergedDifference Get a new assembly with both the new and old version of code. This is useful for being able to test program output differences in versions and maintaining a persisted version.
GetChangePairs Advanced. Get the relationships that have changed in a method body. For example, a different parameter to a method call, or a new method call is introduced to the body, or an assignment to a property is removed.

Example of human readable output.

> cildiff.exe cecil.r10.dll cecil.r11.dll + Class + HeaderReader - HeaderReaderOldName * CommandClass + MethodA * MethodB - int v = array[i]; + int v = array[i++];

Field Stat

Performing analysis or collecting statistics over a large collection of applications?

Field Stat provides an easy way to visit assemblies across many applications and collect information about the bytecode.

Field Stat also can process a CIL diff output -- allowing you to visit not only across classes and methods, but also across versions!

CIL Statements and Flow

Wish you could treat bytecode instructions like source code statements? CIL Flow includes abstractions for grouping bytecode instructions together into a unit much like a code statement.

Need to do build flow graphs? CIL Flow also includes a flow graph to group instructions under basic blocks.

object op = i.Operand == null ? Entity.GetOperand(md, i) : i.Operand;

[CIL Flow representation:]

Example enumeration of model

// Approximate lines of code in program. CILFlowGraph flowgraph = CILMethodBlockConstructor.ConstructFlow(md); int count = 0; foreach (CILInstructionBlock block in flowgraph.Blocks) { PopTreeList treeList = PopTreeListBuilder.Construct(md, block); foreach ( PopTree tree in treeList.PopTrees) { count++; } }