paseena
paseena

Reputation: 4315

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..

Upvotes: 1

Views: 709

Answers (2)

Mark Cidade
Mark Cidade

Reputation: 100037

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.

Upvotes: 2

Priyank
Priyank

Reputation: 10623

If this has to do with C# and not C++, use MSIL Disassembler. Also, if you have .Net Reflector, FileDisassembler is a great tool for this as well.

Below are the links to MSIL Disassembler's complete example step-by-step and its msdn article.

http://www.mactech.com/articles/mactech/Vol.19/19.12/NETbinaries/index.html

http://msdn.microsoft.com/en-us/library/f7dy01k1%28v=vs.71%29.aspx

Upvotes: 1

Related Questions