Hi Jasper, On Fri, Jun 17, 2011 at 8:24 AM, jasper <[email protected]> wrote: > This is my idea, > -I have my own .net code. > -I convert into byte code using cecil > -Get byte code as string or something... (Is it possible?) > -Use this byte code in my profiler to insert code in > SetILFunctionBody. > > Will this be possible.? > > I will use Cecil only to convert function to byte code and NOT inject > the function.. > Will is be possible to convert byte code to stings or something so > that native code can understand?
I don't know enough of the profiling API to tell you if it can work or not. But Cecil gives you an object model for instructions that you can obviously serialize to whatever you feel like, but then again, it doesn't seem really practical. After all, the byte[] version is easy to parse, so I don't see why you wouldn't do everything in the unmanaged side, as it avoids a transition from the Cecil type system to the runtime type system. Jb -- -- mono-cecil
