@@ -297,6 +297,13 @@ def load_raw_disassembly(self, start_ip):
297
297
line_addr = start_ip + total_read
298
298
(insn_tokens , length ) = arch_dis .get_instruction_text (data [total_read :], line_addr )
299
299
300
+ # terrible libshiboken workaround
301
+ for tok in insn_tokens :
302
+ if tok .type == InstructionTextTokenType .PossibleAddressToken and (tok .value & 0x80000000 ) and tok .size == 4 :
303
+ #print('fixing %s' % ''.join(map(str,insn_tokens)))
304
+ tok .size = 8
305
+ tok .value &= 0x7FFFFFFFFFFFFFFF
306
+
300
307
if insn_tokens is None :
301
308
insn_tokens = [InstructionTextToken (InstructionTextTokenType .TextToken , "??" )]
302
309
length = arch_dis .instr_alignment
@@ -337,16 +344,6 @@ def load_raw_disassembly(self, start_ip):
337
344
338
345
total_read += length
339
346
340
- # terrible workaround for libshiboken conversion issue
341
- for line in lines :
342
- # line is LinearDisassemblyLine
343
- last_tok = line .contents .tokens [- 1 ]
344
- #if last_tok.type != InstructionTextTokenType.PossibleAddressToken: continue
345
- #if last_tok.width != 18: continue # strlen("0xFFFFFFFFFFFFFFF0")
346
- if last_tok .size != 8 : continue
347
- #print('fixing: %s' % line)
348
- last_tok .value &= 0x7FFFFFFFFFFFFFFF
349
-
350
347
self .binary_text .setLines (lines )
351
348
352
349
def show_raw_disassembly (self , raw ):
0 commit comments