gdabah / distorm

Powerful Disassembler Library For x86/AMD64
Other
1.26k stars 238 forks source link

Wrong disassembly for cmp 0x20,%edi in 64-bit mode #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In 64-bit mode, distorm says:
0000000000000000 (07) 3b3c2520000000           CMP EDI, [0x20]
and the second argument has type O_DISP. Should not it be O_IMM?

objdump says:
3b 3c 25 20 00 00 00    cmp    0x20,%edi

This does not seem right.

Original issue reported on code.google.com by euge...@google.com on 2 Nov 2010 at 1:18

GoogleCodeExporter commented 9 years ago
Yep, a bug in objdump...
O_DISP is alright, it's not an immediate.

Original comment by distorm@gmail.com on 2 Nov 2010 at 2:09

GoogleCodeExporter commented 9 years ago

Original comment by distorm@gmail.com on 2 Nov 2010 at 2:09

GoogleCodeExporter commented 9 years ago
Thanks. You are right, it's an O_DISP.
Objdump is also right, the syntax for O_IMM would be $32.

Original comment by euge...@google.com on 2 Nov 2010 at 4:07

GoogleCodeExporter commented 9 years ago
I managed to forgot the hideous syntax of AT&T, but cool. And that's why I 
don't wanna support it, it sucks.

Original comment by distorm@gmail.com on 2 Nov 2010 at 4:17