ISDasm

Two interesting notes from current reading:

1. You can write code that runs IL commands directly if you’re current language doesn’t support a specific command.

2. ILDasm.exe and ILAsm.exe. Clearly ILAsm.exe is an intermediate language assembler, so you could write pure IL and compile it straight from there. ILDasm.exe is a lot more interesting.

Recently I ported the PHP API for theprintful.com to .NET. I’m going to use the binaries generated from that project to see what ILDasm.exe actually does.

Rather nicely, ILDasm.exe has a GUI component (go figure). We can visually inspect different different packages, their classes, as well as all of their members:

ILDAsm.exe Screenshot

ILDAsm.exe Screenshot

 

Right now I can’t see any immediate usage of ILDAsm, but it’s nice to know it’s there.

 

I did wonder if I could write an unsafe method in C# that would inject IL for me, then compile it into my project to surface otherwise unused IL behavior. Seems like it could also be an attack vector if that’s the case.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s