Hi! As ofr me, the main source of the information about assemblies and IL is ECMA-335 "Common Language Infrastructure". There is also a great book by Serge Lidin called "Expert .NET 2.0 IL Assembler". If u google for a while, u will find an ebook of it;) U should look for IlProcessor in Mono.Cecil.Cil namespace. Something like this:
MethodBody yourMethodBody = yourMethod.Body; ILProcessor proc = yourMethodBody.GetILProcessor () proc.Emit(OpCode.Nop); // Or Append On Nov 8, 9:11 am, "@rek" <[email protected]> wrote: > Few days ago I've found your lib - Cecil. I'm stunned. The > posibilities are endless with that. Great job. I would like to write a > application that will inject some code before, after and in the middle > of methods, functions etc (in C#). As for now I managed to get to the > method and a table of IL Commands. Now the big question. How can I add > some code there? How can I do it properly and where could I find some > references about IL so I could achieve that? -- -- mono-cecil
