mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-22 20:31:14 +00:00
erpt: support older erpt binaries
This commit is contained in:
parent
feba788bc6
commit
5ac9e45d86
1 changed files with 10 additions and 3 deletions
|
@ -273,8 +273,9 @@ def get_full(nxo):
|
||||||
s.resolved = LOAD_BASE + s.value
|
s.resolved = LOAD_BASE + s.value
|
||||||
if s.name:
|
if s.name:
|
||||||
if s.type == STT_FUNC:
|
if s.type == STT_FUNC:
|
||||||
print(hex(s.resolved), s.name)
|
#print(hex(s.resolved), s.name)
|
||||||
#idaapi.add_entry(s.resolved, s.resolved, s.name, 0)
|
#idaapi.add_entry(s.resolved, s.resolved, s.name, 0)
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
#idaapi.force_name(s.resolved, s.name)
|
#idaapi.force_name(s.resolved, s.name)
|
||||||
pass
|
pass
|
||||||
|
@ -354,11 +355,17 @@ def find_categories(full, num_fields):
|
||||||
|
|
||||||
def find_types(full, num_fields):
|
def find_types(full, num_fields):
|
||||||
KNOWN = range(10) + [4, 4, 2, 4]
|
KNOWN = range(10) + [4, 4, 2, 4]
|
||||||
|
KNOWN_OLD = range(10) + [4, 4, 0, 4]
|
||||||
|
try:
|
||||||
ind = full.index(''.join(pk('<I', i) for i in KNOWN))
|
ind = full.index(''.join(pk('<I', i) for i in KNOWN))
|
||||||
|
except ValueError:
|
||||||
|
ind = full.index(''.join(pk('<I', i) for i in KNOWN_OLD))
|
||||||
return list(up('<'+'I'*num_fields, full[ind:ind+4*num_fields]))
|
return list(up('<'+'I'*num_fields, full[ind:ind+4*num_fields]))
|
||||||
|
|
||||||
def find_flags(full, num_fields):
|
def find_flags(full, num_fields):
|
||||||
KNOWN = '\x00' + ('\x01'*6) + '\x00\x01\x01\x00'
|
KNOWN = '\x00' + ('\x01'*6) + '\x00\x01\x01\x00'
|
||||||
|
if num_fields < 443 + len(KNOWN):
|
||||||
|
return [0] * num_fields
|
||||||
ind = full.index(KNOWN) - 443
|
ind = full.index(KNOWN) - 443
|
||||||
return list(up('<'+'B'*num_fields, full[ind:ind+num_fields]))
|
return list(up('<'+'B'*num_fields, full[ind:ind+num_fields]))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue