Search code examples
c#disassemblyobjdump

Tracking disassembly of a c# program


I am trying to understand disassembly of a c# program using objdump, since I am using vsiaul c# 2008 express edition which does not display disassembly.

I am running the following command to get the output:

objdump -S ConsoleApplication4.exe 

since I am not able to identify my function codein the disassembly output, I put in a dummy variable with a value of 0x1234.

 public static void myfun()
    {
        int i;
        i = 0x1234;
        Console.WriteLine(i.ToString());
    }

However, I am not able to find the value of 1234 anywhere in the generated file! i tried other options like -t or -T for objdump, but it says no symbol table found. Can someone please tell how to use objdump to view the disassembly of a function, or if there some other free tool?

EDIT : I am aware of MSIL disassmbler, I wanted to know the assembly language equivalent please..


Solution

  • Unless you have NGEN'd your application, it doesn't make sense to disassemble into assembly language since the MSIL isn't compiled into x86 code until it is jitted at runtime.