ChipBench packages Ghidra, radare2, binwalk, chip-programming tools,
simulators, and firmware-unpacking utilities into one reproducible container
for analyzing raw chip dumps entirely from the command line or an AI CLI.
Headless Jython scripts drive import, forced-disassembly sweeps, live
queries, and bulk decompilation exports without any GUI.
Derived from a private engagement environment, generalized for public
release under AGPLv3. No engagement-specific artifacts are included.
💘 Generated with Crush
Assisted-by: Crush:glm-5.2
22 lines
827 B
Python
22 lines
827 B
Python
# -*- coding: utf-8 -*-
|
|
#
|
|
# Part of ChipBench (AGPLv3). SPDX-FileCopyrightText: 2026 Starting Line Productions LLC
|
|
# MakeFuncs.py -- create functions at hex addresses given as script args.
|
|
# Usage: -postScript MakeFuncs.py 0x1234 0x0a07 ...
|
|
from ghidra.program.model.address import AddressSet
|
|
from ghidra.app.cmd.function import CreateFunctionCmd
|
|
|
|
args = getScriptArgs()
|
|
af = currentProgram.getAddressFactory()
|
|
fm = currentProgram.getFunctionManager()
|
|
for a in args:
|
|
addr = af.getAddress(a[2:] if a.startswith("0x") else a)
|
|
if addr is None:
|
|
print("bad addr: %s" % a); continue
|
|
if fm.getFunctionAt(addr) is not None:
|
|
print("exists: %s" % addr); continue
|
|
cmd = CreateFunctionCmd(addr)
|
|
ok = cmd.applyTo(currentProgram, monitor)
|
|
print("create %s -> %s" % (addr, ok))
|
|
print("MakeFuncs done")
|