From 2eb363c83b8bccc6df3c3017ad64cedec6278505 Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 28 Nov 2024 20:16:19 +0100 Subject: [PATCH] Check commit hash length --- tools/ghidra_scripts/DecompMapToGhidra.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/ghidra_scripts/DecompMapToGhidra.py b/tools/ghidra_scripts/DecompMapToGhidra.py index 1def00c3..d17d97a7 100644 --- a/tools/ghidra_scripts/DecompMapToGhidra.py +++ b/tools/ghidra_scripts/DecompMapToGhidra.py @@ -280,6 +280,9 @@ def apply_symbols_map(symbols_map, file_name, build_dir): path = str(askDirectory("Program build directory (e.g. build/SOUE01)", "Import")) commit = askString("Commit hash for symbol history", "Confirm") +if len(commit) < 7: + raise ValueError("commit hash " + commit + " is too short") +commit = commit[:7] new_contents = None main_symbols = os.path.join(path, "main.elf.MAP") symbols_map = None