Hey,

On Tue, Jan 12, 2010 at 9:30 PM, Brandon Cuff <[email protected]> wrote:
> Is there some way I can take this byte[] and get an InstructionCollection
> from it? That way I can create a new MethodDefinition and add it to the
> module.

It can't be as simple as that. It will work for very simple opcodes,
but as soon as you have opcodes that take tokens (that are scoped per
module) you're toasted. In the idea, you could somehow adapt the
reflection based CIL reader:

http://evain.net/blog/articles/2009/04/30/reflection-based-cil-reader

To decompose the method into a custom Instruction form, and transform
it back for Cecil, and properly import the references to tokens, but
it's no small task.

-- 
Jb Evain  <[email protected]>
-- 
--
mono-cecil

Reply via email to