简体   繁体   中英

Inspect / disassemble .Net native images

Is it possible to disassemble / inspect the native code produced by the .Net JITer / ngen? (for purely academic purposes)

In attempting to answer this question I became intrigued about what sort of optimisations the JITer would perform - rather than speculate wildly I'd really like to be able to see for myself what is really hapenning.

So far I've:

  1. Installed a native image of my candidate assembly using ngen (is the output of this potentially different from the output of the JIT compiler?)
  2. Copied the native image out of the GAC

But now I'm a bit stuck - as far as I was aware .Net assemblies are in the portable execuable format, but the normal tools that I might use to disassemble such a file (objdump) just barf:

C:\Users\justin\Desktop>objdump -d ConsoleApplication1.ni.exe
objdump: ConsoleApplication1.ni.exe: File format not recognized

Is it feasible to peek inside a native image in this way? Failing that is there some alternative way that I might be able to satisfy my curiosity? (for example disassembling the code in a running process)

过去尝试这种事情时,我在windbg和dumpbin上取得了一些成功。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM