I have a compiled assembly. I want to programmatically compare the method implementation of one of the methods in that assembly with something I expect.
Is there a way I can compare their ILs? Even if I can get a byte array representation of any instruction set, I'll be in a good place.
Help appreciated.
You could try using Reflection and compare the IL using byte arrays.
Take a look at this method: http://msdn.microsoft.com/en-us/library/system.reflection.methodbody.getilasbytearray.aspx
Using Mono.Cecil might be a good place to start. Cecil is a library used to read and modify CLR assemblies, and will do all the file parsing for you as far as grabbing the CIL bytecode.
Another potential library you might be able to use is Boogie
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With