I wanted to see if I could decompile a method without having to read the PE-file itself, but rather by getting it from reflection.
So I have a MethodInfo and I want to turn it into a ISourceMethodBody.
I've been poking around the CCI projects, trying to see what I would have to implement but I got a little lost in all the details. So I figured I would simply ask if this is going to be possible, or if this is something that would require me to re-implement
large parts of the CCI Metadata/AST projects?
I was hoping there would be an ILReader that I could use with the results of MethodInfo.GetMethodBody() and then feed that into the decompiler, but it doesn't look like it will be quite that simple.
I started mocking out some code, and ended up with this, but the "IMetadataHost" and "IMethodBody" doesn't seem that easy to come by.
IMetadataHost host = ...;
IMethodBody methodBody = ...;
ISourceMethodBody sourceMethodBody = Decompiler.GetCodeModelFromMetadataModel(host,
/* pdbreader */ null,
Any suggestions, or is this simply outside the bounds of the CCI projects?