Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, We do realize that this isn't the right platform to post questions related to Windows environment. But as of now we are not 'technical' enough to work with GCC's ...
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    12

    Extracting machine code from an exe

    Hi,

    We do realize that this isn't the right platform to post questions related to Windows environment.

    But as of now we are not 'technical' enough to work with GCC's inline assembly as it uses AT&T's style of coding for 32/64 bit.

    We are working on TCC for a 16-bit system.

    The question is:

    How do we extract the machine code from an exe file?
    We have the structure of exe file but have difficulty in identifying where the code and the dependent data resides.

  2. #2
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    I'm not really sure what your looking for but maybe you could try objdump...Hope this helps...Gerard4143

    i.e objdump -D executablefilename

  3. #3
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,114
    If you're working in DOS, there is debug

    Code:
    D:\prog>debug hello.exe
    -u
    07E8:0000 E97F15        JMP     1582
    07E8:0003 55            PUSH    BP
    07E8:0004 8BEC          MOV     BP,SP
    07E8:0006 B80600        MOV     AX,0006
    07E8:0009 50            PUSH    AX
    07E8:000A E80700        CALL    0014
    07E8:000D 8BE5          MOV     SP,BP
    07E8:000F B80000        MOV     AX,0000
    07E8:0012 5D            POP     BP
    07E8:0013 C3            RET
    07E8:0014 55            PUSH    BP
    07E8:0015 8BEC          MOV     BP,SP
    07E8:0017 81EC0201      SUB     SP,0102
    07E8:001B 8D4604        LEA     AX,[BP+04]
    07E8:001E 50            PUSH    AX
    07E8:001F 8D86FEFE      LEA     AX,[BP+FEFE]

  4. #4
    Just Joined!
    Join Date
    Jan 2009
    Posts
    12

    Reason for extracting the machine code

    Hi,

    We want to extract the machine code from the executable because we have to boot the system from it.

    The boot-loader isn't programmed to be intelligent enough to understand the exe format. It simply fetches a given number of sectors from the disk and loads it to a predetermined address location in memory and passes control to it.

    So it suits our purpose to extract the desired machine code from the corresponding exe file.

    Any suggestions in regard to this would be great.

    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...