April 30th, 2004, 02:09 PM
-
convert C to assembly
Hi..
I just want to know if there is a program that i can download to convert C language to assembly in WINDOWS XP
..
I got linux(redhat v9) but i dont know why there is a problem with GCC compiler which gives me (when i enter any thing with gcc at the begning) no such command, also when i try to use the debuger (gdb).
..
also if there is a good debuger(for windows xp) that i can use to debug .o files .It will be helpfull, also if there is something that can convert .o file to assembly or C language.
..
please help me , i got an assignment to do (its realy easy but i cant do it becuase its in .o , what we take in class is to use gdb with it but i cant with my PC :( )
..
Thanks for reading
bye..
April 30th, 2004, 02:12 PM
-
GCC can do it. just type: gcc -S myfile.c any compiler can do this, just read the documentation
April 30th, 2004, 02:17 PM
-
I downloaded GCC in windows but there is something that i have to change in AUTOEXEC.bat accualy i didnt find this file in my PC i found AUTOEXEC.NT
thats why gcc compiler isnt working with my windows :(
thanks for responding :)
April 30th, 2004, 02:23 PM
-
Originally Posted by BaAa3
also if there is a good debuger(for windows xp) that i can use to debug .o files .It will be helpfull, also if there is something that can convert .o file to assembly or C language.
what you want is a dissasembler. try win32dasm . iirc it's not free, but i found some warez googlin around awhile back
April 30th, 2004, 02:26 PM
-
thaks
i will give it a shot
April 30th, 2004, 02:35 PM
-
Many, maybe most, compilers have an option for emitting listing files, which are assembly language. I downloaded a disassembler called disasm, but I don't remember where from. It appears to work, although I haven't used it except to disassemble its own .exe file.
Functionality rules and clarity matters; if you can work a little elegance in there, you're stylin'.
If you can't spell "u", "ur", and "ne1", why would I hire you? 300 baud modem? Forget I mentioned it.
April 30th, 2004, 02:41 PM
-
you can use the free debug.exe that is distributed with windows operating system. it will show the assembly code of any executable, and the binary/hex/ascii representation of any file.
kind of cryptic -- but it works.
April 30th, 2004, 02:42 PM
-
Originally Posted by DaWei_M
Many, maybe most, compilers have an option for emitting listing files, which are assembly language. I downloaded a disassembler called disasm, but I don't remember where from. It appears to work, although I haven't used it except to disassemble its own .exe file.
mmm iam trying to find 1
i found Win32Dasm All Versions in werz site which is 100 mb size
should i download it or find better 1
April 30th, 2004, 02:58 PM
-
I downloaded win32dasm v893_1
i just conver a little C code and it gives me a realy strang codes which i didnt understand :) is there is a program that can give some thing like linux gcc compiler !
that is the C code :
#include <stdio.h>
int main ()
{
int a , int b ;
a = 6 ;
a = b ;
return 0
}
that what it gives me
Disassembly of File: C:\NEWTEX~1.c
Code Offset = 00000000, Code Size = 00000057
Data Offset = 00000000, Data Size = 00000000
Number of Objects = 0001 (dec), Imagebase = 00000000h
Object01: RVA: 00000000 Offset: 00000000 Size: 00000057 Flags: 00000000
Number of Imported Modules = 0 (decimal)
+++++++++++++++++++ IMPORT MODULE DETAILS +++++++++++++++
+++++++++++++++++++ EXPORTED FUNCTIONS ++++++++++++++++++
Number of Exported Functions = 0000 (decimal)
+++++++++++++++++++ ASSEMBLY CODE LISTING ++++++++++++++++++
//********************** Start of Code in Object BinaryCode **************
Program Entry Point Not Available
:00000000 23696E and ebp, dword ptr [ecx+6E]
:00000003 636C7564 arpl dword ptr [ebp+2*esi+64], ebp
:00000007 65203C73 and byte ptr gs:[ebx+2*esi], bh
:0000000B 7464 je 00000071
:0000000D 696F2E683E0D0A imul ebp, dword ptr [edi+2E], 0A0D3E68
:00000014 696E74206D6169 imul ebp, dword ptr [esi+74], 69616D20
:0000001B 6E outsb
:0000001C 2028 and byte ptr [eax], ch
:0000001E 290D0A7B0D0A sub dword ptr [0A0D7B0A], ecx
:00000024 696E742061202C imul ebp, dword ptr [esi+74], 2C206120
:0000002B 20696E and byte ptr [ecx+6E], ch
:0000002E 7420 je 00000050
:00000030 6220 bound esp, dword ptr [eax]
:00000032 3B0D0A61203D cmp ecx, dword ptr [3D20610A]
:00000038 2036 and byte ptr [esi], dh
:0000003A 203B and byte ptr [ebx], bh
:0000003C 0D0A61203D or eax, 3D20610A
:00000041 206220 and byte ptr [edx+20], ah
:00000044 3B0D0A726574 cmp ecx, dword ptr [7465720A]
:0000004A 7572 jne 000000BE
:0000004C 6E outsb
:0000004D 2030 and byte ptr [eax], dh
:0000004F 200D0A7D0D0A and byte ptr [0A0D7D0A], cl
:00000055 0D0A000000 or eax, 0D7D0A0A
Last edited by BaAa3; April 30th, 2004 at 03:00 PM.
April 30th, 2004, 03:34 PM
-
LOL, man, what did you expect? Idiomatic English? That's assembler code, horribly formatted. Here's a sample of the output from the one I'm attaching. You can look at it and do what you will.
Code:
+++++++++++++++++++ ASSEMBLY CODE LISTING +++++++++++++++++++
//********************** Start of Code in Object CODE **************
Program Entry Point = 0042001D (disasm.exe File Offset:00001000)
=========
:00401000 8B1500854B00 mov edx, dword[004B8500]
:00401006 56 push esi
:00401007 33C0 xor eax, eax
:00401009 85D2 test edx, edx
:0040100B 57 push edi
:0040100C 761E jbe 0040102C
:0040100E 8B3D0C854B00 mov edi, dword[004B850C]
:00401014 8B74240C mov esi, dword[esp+0C]
:00401018 8BCF mov ecx, edi
:0040101A 8D9B00000000 lea ebx, dword[ebx+00000000]
---------
EDIT: It's output is nicely tabbed before it hits these pages.
Functionality rules and clarity matters; if you can work a little elegance in there, you're stylin'.
If you can't spell "u", "ur", and "ne1", why would I hire you? 300 baud modem? Forget I mentioned it.
April 30th, 2004, 05:17 PM
-
Oh..
WOW why its like this in windows, in linux its too much easyer
I dont know why my comiler wont work in linux :(
Thanks anyway u were great guys ;)
April 30th, 2004, 05:30 PM
-
mmm
Is there a program that can convert assembly to c language
if there is please tell what is it , and if u can wjere to get it !
:)
April 30th, 2004, 07:32 PM
-
I understand the the million monkeys that are producing Shakespeare have a copy...
Functionality rules and clarity matters; if you can work a little elegance in there, you're stylin'.
If you can't spell "u", "ur", and "ne1", why would I hire you? 300 baud modem? Forget I mentioned it.
-
It sounds like the problem you are having with your linux setup is that the path does not include the location of gcc. Try explicitly giving the full path to gcc or gdb, and see what happens.
You can also install gcc on Windows. It is included with the cygwin unix tools port (http:/www.cygwin.com/). If you download and install the full version then it should include everything you need to do your project.
Dave - The Developers' Coach