Skip to content

Commit 8072da8

Browse files
committed
feat: add win32 adapt
1 parent 04f28b3 commit 8072da8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

libsurgeon.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,9 @@ def process_archive(
618618

619619
# Validate Ghidra
620620
ghidra_headless = os.path.join(ghidra_path, "support", "analyzeHeadless")
621+
# On Windows, use .bat extension
622+
if sys.platform == "win32":
623+
ghidra_headless += ".bat"
621624
if not os.path.isfile(ghidra_headless):
622625
raise FileNotFoundError(f"Ghidra analyzeHeadless not found: {ghidra_headless}")
623626

@@ -908,6 +911,9 @@ def process_elf_file(
908911

909912
# Validate Ghidra
910913
ghidra_headless = os.path.join(ghidra_path, "support", "analyzeHeadless")
914+
# On Windows, use .bat extension
915+
if sys.platform == "win32":
916+
ghidra_headless += ".bat"
911917
if not os.path.isfile(ghidra_headless):
912918
result.error = f"Ghidra analyzeHeadless not found: {ghidra_headless}"
913919
return result
@@ -1363,6 +1369,9 @@ def main():
13631369

13641370
# Validate Ghidra path
13651371
ghidra_headless = os.path.join(args.ghidra, "support", "analyzeHeadless")
1372+
# On Windows, use .bat extension
1373+
if sys.platform == "win32":
1374+
ghidra_headless += ".bat"
13661375
if not os.path.isfile(ghidra_headless):
13671376
log_error(f"Ghidra analyzeHeadless not found: {ghidra_headless}")
13681377
sys.exit(1)

0 commit comments

Comments
 (0)