Dis2MSIL
July 31, 2021 ยท View on GitHub
Dis2MSIL is disassembler for MSIL ByteCode
This project is the developed and edited version of the "SDILReader" project on CodeProject.
Usage
You can disassemble the bytecodes to be given as String or Byte[] using the MethodBodyReader class.
public MethodBodyReader(Module module, string strilArray)
public MethodBodyReader(Module module, byte[] ilArray)
The "module" parameter here is required for metadata Tokens that need to be resolved.
For Bytecodes Of Type String
string testIl = "02-28-1C-00-00-0A-00-00-02-03-7D-11-00-00-04-2A";
string fileName = args[0];
MethodBodyReader mr = new MethodBodyReader(Assembly.LoadFrom(fileName).EntryPoint.Module, testIl);
Console.Write(mr.GetBodyCode());

For Bytecodes Of Type Byte[]
byte[] testIlByte = { 0x02, 0x28, 0x1C, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x02, 0x03, 0x7D, 0x11, 0x00, 0x00, 0x04, 0x2A };
string fileName = args[0];
MethodBodyReader mrByte = new MethodBodyReader(Assembly.LoadFrom(fileName).EntryPoint.Module, testIlByte);
Console.Write(mrByte.GetBodyCode());
