Expert .NET 2.0 IL Assembler

Author: Serge Lidin
4.6
All Stack Overflow 18
This Year Stack Overflow 1
This Month Stack Overflow 2

Expert .NET 2.0 IL Assembler

4.6

Review Date:

Comments

by anonymous   2017-08-20

While I agree with GregC in general there are times when this type of information is useful. But that is one tough question to be expected to answer in an interview (unless it's for the CLR team :)

Web Pages and Blogs...

Books...

by Eric Z Beard   2017-08-20

Expert .NET 2.0 IL Assembler by Serge Lidin

There was a 1.1 version of the same book, but I haven't seen anything for the latest .NET release. It's an excellent book. I used it to write an OCR component in MSIL, as a learning project.

[Edit] @Curt is right, 3.0 and 3.5 are just extensions to 2.0, I hadn't plugged that in to my head yet. Now I've thought of a fun geek project... compare the disassembly of standard 2.0 code to the new LINQ/Lambda way of performing common tasks like filtering lists. For some reason I assumed that the magic was happening in new IL features, not just the compiler.

by anonymous   2017-08-20

An easy way to learn about IL is to write the code in e.g. C# and look at the generated IL. That way you can easily see what various code constructs map to. For a great book on the subject, I recommend Expert .NET IL Assembler.

by anonymous   2017-08-20

.NET assemblies don't use the traditional text segment to store their .NET code - only natively compiled code goes there. Instead they use special CLR structures inside the PE that only .NET assemblies have.

One of the "optional" headers in the PE file is the CLR Runtime Header, which has all the key information about where .NET-specific structures are located within the PE.

For more details on this, download the latest PE specification ("Microsoft Portable Executable and Common Object File Format Specification") from msdn.com.

For even more detailed explanations on how the many pieces of .NET executable code and corresponding data are organized in the PE, get Serge Lidin's book on the .NET assembler.