Handle incorrect zero size fields

Previously the Configfile would say something like
'HWInitCodeOffset=0x00000000=HWInit' if the size field was mistakenly
set to zero. Now we just search for whatever can be found at that
location.
This commit is contained in:
Elliot Nunn 2019-06-10 11:51:31 +08:00
parent 452519f829
commit 42e89b5e22
1 changed files with 1 additions and 1 deletions

View File

@ -156,7 +156,7 @@ def dump_configinfo(binary, offset, filename_dict, push_line):
elif key == 'BootstrapVersion':
value = shlex.quote(raw_value.decode('mac_roman'))
elif key.endswith('Offset') and key.startswith(('Mac68KROM', 'ExceptionTable', 'HWInitCode', 'KernelCode', 'EmulatorCode', 'OpcodeTable', 'OpenFWBundle')):
if getattr(s, key.replace('Offset', 'Size')) == 0:
if raw_value == 0:
value = '0x00000000'
else:
value = 'BASE0x%+X' % (raw_value - s.ROMImageBaseOffset)