Is it possible to get JIT to compile the assembly and get the asm code?

Is there a way to get the .NET assembly exe assembly by being parsed in pure assembler? There may be some built-in tools to achieve this.

I know that C # code is compiled in IL, and then in Runtime JIT compiles its native code. The question is, can I somehow make jit compile the assembly and take this output for a text file, for example. Or am I confused, and my understanding of how the CLR works is wrong?

+4
source share
1 answer

What do you want to do with it? I do not think you can do this directly.

Assuming you used Ngen to create your own image, the cache of your own image should be in some way, for example

C:\Windows\assembly\NativeImages_v4.0.30319_32\ 

The exact path depends on the version of the framework and, possibly, on some other factors, and I do not think that you have a guarantee that it will always be there. If you find your own image, you can use the disassembler to view the machine code.

+4
source

All Articles