jbevain / mono.reflection

Some useful reflection helpers, including an IL disassembler.
151 stars 51 forks source link

Is there anyway I can use the getInstructions() with mono cecil IL processer to insert the instructions ? #22

Closed Uchiha1391 closed 3 years ago

Uchiha1391 commented 3 years ago

I am using mono cecil to inject some code at the entry point of some methods. I am trying to use Disassembler.GetInstructions() to get IL code of a method which I need to inject but the instructions from Disassembler.GetInstructions() doesn't fit into ILprocessor.InsertBefore() function. I think you are the author of mono cecil so you would know how to do it.