Closed GoogleCodeExporter closed 8 years ago
I am seeing the same using distorm3 version 3.3.0 from PyPI. Below is a quick repro (note how the full instruction object i
still serializes correctly as string, just the i.mnemonic
member variable is impacted):
Python 2.7.11 (default, Dec 5 2015, 23:52:42)
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import distorm3
>>> code = b'\x48\x63\xc8'
>>> for i in distorm3.DecomposeGenerator(0x1000, code, distorm3.Decode64Bits):
... print "%s/%s --> %s" % (i.mnemonic, hex(i.opcode), i)
...
UNDEFINED/0x2715 --> MOVSXD RCX, EAX
Looking at the Mnemonics
dict in the Python bindings, 0x2715 is indeed missing (MOVSXD is listed under key 0x271d though).
Looking at this Java example, 0x2715 is listed as MOVSXD there while 0x271d is PAUSE (which has yet another key in the Python version).
From mnemonics.h, it looks like the Java code is correct:
I_MOVSXD = 10005
(0x2715 in hex)I_PAUSE = 10013
(0x271d in hex)Are these typos in the Python version or is this potentially based on an older version of the enum in the C code?
I sync'ed the tables again. Latest revision should resolve it. Please confirm.
Not seeing a commit -- did you push? Also, can you release a new version to PyPI by any chance? Thank you!
Please retry. I will later this weekend.
Still problems unfortunately. The fix appears to break the instruction output (but the mnemonic output now works):
>>> import distorm3
>>> code = b'\x48\x63\xc8'
>>> for i in distorm3.DecomposeGenerator(0x1000, code, distorm3.Decode64Bits):
... print "%s/%s --> %s" % (i.mnemonic, hex(i.opcode), i)
...
MOVSXD/0x271b --> RCX, EAX
Expected output:
MOVSXD/0x271b --> MOVSXD RCX, EAX
Here's what I see in the code:
It looks like mnemonics.h needs to be updated, too.
Update: now works as expected after commit ac277fb -- thank you!
>>> import distorm3
>>> code = b'\x48\x63\xc8'
>>> for i in distorm3.DecomposeGenerator(0x1000, code, distorm3.Decode64Bits):
... print "%s/%s --> %s" % (i.mnemonic, hex(i.opcode), i)
...
MOVSXD/0x272b --> MOVSXD RCX, EAX
Yey :)
Thanks again -- also a PyPI release of the latest fixes would be much appreciated :)
Original issue reported on code.google.com by
felipe.a...@gmail.com
on 27 Feb 2015 at 11:28