feat(binana): change tool to deposit generated files into an 'artifacts' folder that isn't retained by repository history

This commit is contained in:
phaneron 2026-02-28 02:34:20 -05:00
parent 68f52b8efd
commit 47b08df145
44 changed files with 904 additions and 622 deletions

View file

@ -1,36 +1,36 @@
from ghidra.program.model.symbol.SourceType import *
functionManager = currentProgram.getFunctionManager()
file_location = askFile("Choose a file to write to", "Go baby go!")
listing = currentProgram.getListing()
def export_function_symbols(file):
monitor.setMessage("Exporting function symbols...")
for f in functionManager.getFunctionsNoStubs(1):
monitor.checkCanceled() # throws exception if canceled
if f.isExternal() or f.isThunk():
continue
func_name = f.getName()
if func_name.startswith("FUN_"):
continue
func_start_address = f.getBody().getMinAddress().getOffset()
func_end_address = f.getBody().getMaxAddress().getOffset() + 1
line_template = "{name} {start_address:08X} f end={end_address:08X}\n"
func_line = line_template.format(name = func_name, start_address = func_start_address, end_address = func_end_address)
file.write(func_line)
return
with open(file_location.absolutePath, "w") as file:
export_function_symbols(file)
from ghidra.program.model.symbol.SourceType import *
functionManager = currentProgram.getFunctionManager()
file_location = askFile("Choose a file to write to", "Go baby go!")
listing = currentProgram.getListing()
def export_function_symbols(file):
monitor.setMessage("Exporting function symbols...")
for f in functionManager.getFunctionsNoStubs(1):
monitor.checkCanceled() # throws exception if canceled
if f.isExternal() or f.isThunk():
continue
func_name = f.getName()
if func_name.startswith("FUN_"):
continue
func_start_address = f.getBody().getMinAddress().getOffset()
func_end_address = f.getBody().getMaxAddress().getOffset() + 1
line_template = "{name} {start_address:08X} f end={end_address:08X}\n"
func_line = line_template.format(name = func_name, start_address = func_start_address, end_address = func_end_address)
file.write(func_line)
return
with open(file_location.absolutePath, "w") as file:
export_function_symbols(file)
file.close()