📚 OpenRCE is preserved as a read-only archive. Launched at RECon Montreal in 2005. Registration and posting are disabled.








Flag: Tornado! Hurricane!

 Forums >>  Brainstorms - General  >>  PyDASM Bug in Intel Dead Listing?

Topic created on: December 22, 2007 11:03 CST by cyphunk .

or perhaps a libdasm issue, having dug that far just yet.

Pydasm gives the following Intel ASM which fasm, as, or gcc inline have trouble compiling:
    mov dword [ebp-0x10],0x0

It should(?) be:
    mov dword ptr [ebp-0x10],0x0
or am I missing something?

If I use AT&T ASM libdasm's output compiles fine, inline gcc or otherwise:
    movl $0x0,0xfffffff0(%ebp))

Is there a way to direct libdasm to output the proper ASM?  Or a way to direct gcc inline, as or fasm to handle the issue during compile?

  cyphunk   December 22, 2007 13:42.51 CST
attempted with two other diassemblers, distorm and objdump.

distorm gives a result which does not compile:
   MOV WORD [DI-0x10], 0x

objdump (-M intel) gives a result which does compile:
   mov word ptr [di-0x10], 0x0

(thank you bluffer_)

Perhaps someone can explain the differences between disassemblers?

  c1de0x   December 24, 2007 00:09.26 CST
Can you paste the actual instruction bytes?

  dsre     December 24, 2007 10:42.14 CST
> cyphunk: attempted with two other diassemblers, distorm and objdump.
>
> distorm gives a result which does not compile:
>    MOV WORD [DI-0x10], 0x
>
> objdump (-M intel) gives a result which does compile:
>    mov word ptr [di-0x10], 0x0
>
> (thank you bluffer_)
>
> Perhaps someone can explain the differences between disassemblers?

I think what's happening is that both are valid disassemblies of the same bytes, the only difference is that the first ("movl") assumes the CPU is running in 32-bit mode, while the latter ("mov word ptr") assume 16-bit mode.  There's nothing inherent to the instruction to indicate which mode it "should" be run in, so to make the disassemblers agree, you'd need to specify whether to default to 16-bit or 32-bit code.

As for the original question, sorry, I don't know why a disassembler would say "dword" or "word" instead "dword ptr" or "word ptr"...

Note: Registration is required to post to the forums.

There are 31,328 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06
Question about memor...
Dec/12


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit