-
Notifications
You must be signed in to change notification settings - Fork 20
Description
I keep on getting this error when parsing a Java object file:
Traceback (most recent call last):
File "src/github.com/python-javaobj/javaobj.py", line 623, in _read_and_exec_opcode
handler = self.opmap[opid]
KeyError: 8
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./test.py", line 48, in
obj = javaobj.loads(data)
File "src/github.com/python-javaobj/javaobj.py", line 206, in loads
ignore_remaining_data=ignore_remaining_data)
File "src/github.com/python-javaobj/javaobj.py", line 187, in load
return marshaller.readObject(ignore_remaining_data=ignore_remaining_data)
File "src/github.com/python-javaobj/javaobj.py", line 564, in readObject
_, res = self._read_and_exec_opcode(ident=0)
File "src/github.com/python-javaobj/javaobj.py", line 629, in _read_and_exec_opcode
return opid, handler(ident=ident)
File "src/github.com/python-javaobj/javaobj.py", line 913, in do_object
opcode, obj = self._read_and_exec_opcode(ident=ident + 1)
File "src/github.com/python-javaobj/javaobj.py", line 627, in _read_and_exec_opcode
.format(opid, position))
RuntimeError: Unknown OpCode in the stream: 0x8 (at offset 0x7C)
And I think it's because the decoder isn't parsing this portion properly for a TC_BLOCKDATA section:
006D 68 6F 6C 64 78 70 3F 40 00 00 00 00 00 0C 77 08 holdxp?@......w.
007D 00 00 00 10 00 00 00 0A 74 00 1C 24 31 35 35 30 ........t..$1550
It's that 0x08 byte at the end of the first line and the proper opcode is the byte before it 0x77 which relates to the start of a TC_BLOCKDATA section.
Please let me know if there's anything else I can do to help debug.