Towards better 3.0 decompilation

Sync scanner2 and scanner3 better
This commit is contained in:
rocky
2017-01-08 17:40:57 -05:00
parent 3f40c16587
commit ec0669367f
3 changed files with 382 additions and 11 deletions

View File

@@ -484,20 +484,21 @@ class Scanner2(scan.Scanner):
in python2.3+
"""
# TODO: check the struct boundaries more precisely -Dan
code = self.code
# Detect parent structure
parent = self.structs[0]
start = parent['start']
end = parent['end']
# Pick inner-most parent for our offset
for struct in self.structs:
_start = struct['start']
_end = struct['end']
if (_start <= offset < _end) and (_start >= start and _end <= end):
start = _start
end = _end
current_start = struct['start']
current_end = struct['end']
if ((current_start <= offset < current_end)
and (current_start >= start and current_end <= end)):
start = current_start
end = current_end
parent = struct
if op == self.opc.SETUP_LOOP: