Survive n(loader sections) != 1

This commit is contained in:
Elliot Nunn 2019-10-18 12:33:07 +08:00
parent 098ed93e93
commit d70ad36327
1 changed files with 2 additions and 2 deletions

View File

@ -425,6 +425,8 @@ def dump_lowlevel(basepath):
)
def get_relocations():
relocations = []
for idx in range(relocSectionCount):
ofs = 56 + 24 * importedLibraryCount + 4 * totalImportedSymbolCount + 12 * idx
sectionIndex, _, relocCount, firstRelocOffset, = struct.unpack_from('>HHLL', loader, ofs)
@ -445,8 +447,6 @@ def dump_lowlevel(basepath):
if len(section_list) >= 2 and _sec_kind_is_instantiated(section_list[1]['sectionKind']):
sectionD = section_list[1]['filename']
relocations = []
def nextblock():
if not data: return None
x = data.pop(0)