How dump assembler from executable
I have an executable I compiled with C# and I would like to dump the code in assembler code from it, are there any too开发者_如何学编程ls to do that? Also is it possible to also create an executable from the assembler generated?
C# doesn't compile down to assembler level, it compiles into a common intermediate language (CIL), which isn't the same thing. Compiled C# requires an interpreter, and always will. You can't just copy pieces of the compiled form into a non .NET program.
C# doesn't compile to machine code, or at least the Microsoft C# compiler doesn't compile to machine code. However, you can get the intermediate language bytecode in an assembly-like printout using ildasm.
Also, if you want to see one way that the CLR could just-in-time compile your C# code, compile to assembly language using Mono. An example given on their website:
mono --aot program.exe
Then you can objdump -d to get assembly language from this, at least on a *nix/Mac machine, or a Windows machine with Cygwin or MinGW.
精彩评论