Discussion in 'OT Technology' started by GSRacer2102, Mar 7, 2003.
How do you go about looking at the assembly code for a C program?
you would need a decompiler
to build on what SLED suggested:
there is a program that comes with most windows/dos distros: debug.exe
run 'debug <program>' and you will be presented with a '-' prompt. from there, enter '?' to see all of your options. you'll be interested in (d)ump and (u)nassemble. play around with it.
i tried doing it but it just closes the execute window
Most C compilers can output assembly. For VC++, type the following from a command line: cl -c code.c -Facode.a
This will compile your code.c and output the assembly to a file named code.a
In gcc type: gcc -O2 -S -c code.c
The -S option will save the assembly listing to a file named code.a
how do i do that expalin??
Are you using VC++ or gcc?
u are too l33t what do u mean?
c++ compiler or c compiler?
Are you using Microsoft's C/C++ compiler, or are you using a GNU compiler on linux or some form of UNIX?
I am using MetroWerks CodeWarrior so i guess thats a Microsoft C/C++ compiler
No, it's not Microsoft's compiler. I've never used Metrowerks before. You're on your own to figure out if it provides the option to output assembly code.
what do i need to do?
where should I look?
See if Metrowerks has a command line compiler. It's a compiler you can run from a command prompt (DOS box). Then you have to see if it takes a parameter to generate assembly code.
In the example I gave you, Microsoft's command like compiler is cl.exe. To compile code from a command line, I would execute the command: cl -c code.c. This compiles code.c and generates an object file. If I add the -Facode.a option (cl -c code.c -Facode.a), I also get a file named code.a which contains the assembly code.
I found it
do you know if programs that test for the similarities between files test each and every line or do they just test for certain amount of line or how is it done?
The assembly output is going to be long as hell...
I've done this before in g++/gcc <waste of time>
hmmmm I wonder if I could get away with that for my assembly language class... projects would be much easier to code in C++ and then convert..
j/k.. interesting to know.. will have to play with it now..