API of ILDASM.EXE

421 views Asked by At

I know ildasm.exe can be used to analyze the code of an assembly. I would like to use ILDASM.exe in my code. Is there a relevant API provided by microsoft that I can use to incorporate this functionality in my code. I don't want to call ildasm.exe and dump the file and parse. I would like to get the objects and manipulate them as per my use.

1

There are 1 answers

0
hross On

In that case you would want to use Reflection to loop through the various entities in an assembly. All of the objects (including private classes/fields/etc) should be available this way.

If that is not enough, you could also take a look at Cecil (though I have not used it myself).

I am assuming your application is actually a .NET application based on your question.