diff options
| author | robojumper <robojumper@gmail.com> | 2024-10-25 22:57:11 +0200 |
|---|---|---|
| committer | robojumper <robojumper@gmail.com> | 2024-11-28 20:05:35 +0100 |
| commit | 38db6c087dd2d04b9d68fcc6e1a357bc5c9f0845 (patch) | |
| tree | 8327cbd1350cdef7031aad4964308f6d1e2db3ff /tools | |
| parent | 10cda760205bfdc272b3fa6476f70231e1b06221 (diff) | |
Small fixes
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/ghidra_scripts/DecompMapToGhidra.py | 2 | ||||
| -rw-r--r-- | tools/ghidra_scripts/demangle.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/tools/ghidra_scripts/DecompMapToGhidra.py b/tools/ghidra_scripts/DecompMapToGhidra.py index 053edb14..2ad0074b 100644 --- a/tools/ghidra_scripts/DecompMapToGhidra.py +++ b/tools/ghidra_scripts/DecompMapToGhidra.py @@ -233,7 +233,7 @@ def update_addr(addr, mangled_name, create_function=False): createLabel(addr, symbol_str, namespace, True, IMPORTED) if create_function: - createFunction(addr, postprocessed) + createFunction(addr, name_list[-1]) if symbol_needs_history(mangled_name): unit.setComment(PLATE_COMMENT, complete_plate_comment) diff --git a/tools/ghidra_scripts/demangle.py b/tools/ghidra_scripts/demangle.py index 9b116b5d..320d1564 100644 --- a/tools/ghidra_scripts/demangle.py +++ b/tools/ghidra_scripts/demangle.py @@ -363,7 +363,8 @@ def resolve_templates(s, remangle_add_length): break elif re.match(r'[-\d]+[>,]', s[i:]) != None: # Integer literal - literal = re.match(r'[-\d]+', s[i:])[0] + # ss/robojumper: fix [0] -> .group(0) + literal = re.match(r'[-\d]+', s[i:]).group(0) template_str += literal if is_demangle() else 'XLi%sEE' % literal.replace('-', 'n') i += len(literal) else: @@ -518,7 +519,8 @@ def demangle_try(s): try: return demangle(s) except Exception as e: - sys.stderr.write('Demangler error: ' + str(e) + '\n') + # ss/robojumper: more context + sys.stderr.write('Demangler error: ' + str(e) + ' trying to demangle ' + s + '\n') raise e def main(): |
