一键导入
ghidra-rename-backup
Backup and restore Ghidra function/label renames to/from a JSON file in the git repo
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Backup and restore Ghidra function/label renames to/from a JSON file in the git repo
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Reverse engineer and recreate the Hamsterball game (2000s Windows game by Raptisoft)
Start GhidraMCP headless server with the Hamsterball.exe project — always do this before any RE work
Restore all function renames from FUNCTION_MAP.md back into a fresh Ghidra project after DB loss or re-import
Complete guide to using and extending Hermes Agent — CLI usage, setup, configuration, spawning additional agents, gateway platforms, skills, voice, tools, profiles, and a concise contributor reference. Load this skill when helping users configure Hermes, troubleshoot issues, spawn agent instances, or make code contributions.
Create hand-drawn style diagrams using Excalidraw JSON format. Generate .excalidraw files for architecture diagrams, flowcharts, sequence diagrams, concept maps, and more. Files can be opened at excalidraw.com or uploaded for shareable links.
54 production-quality design systems extracted from real websites. Load a template to generate HTML/CSS that matches the visual identity of sites like Stripe, Linear, Vercel, Notion, Airbnb, and more. Each template includes colors, typography, components, layout rules, and ready-to-use CSS values.
| name | ghidra-rename-backup |
| description | Backup and restore Ghidra function/label renames to/from a JSON file in the git repo |
| version | "2026-04-13T00:00:00.000Z" |
CRITICAL: Always backup renames after a RE session. Restoring from backup is the ONLY way to recover if the Ghidra project DB gets corrupted or re-imported.
~/hamsterball-re/analysis/ghidra/renames.json{"renames": [{"address": "00401234", "old_name": "FUN_00401234", "new_name": "Ball_Update"}], ...}# The export is done via GhidraMCP - run the inline script
# Or use the MCP batch_create_labels tool
Use mcp_ghidra_mcp_run_script_inline with this Java code:
import ghidra.program.model.symbol.*;
import ghidra.program.model.listing.*;
import java.util.*;
var sb = new StringBuilder();
sb.append("{\n \"renames\": [\n");
var fm = currentProgram.getFunctionManager();
var iter = fm.getFunctions(true);
var first = true;
while (iter.hasNext()) {
var func = iter.next();
var name = func.getName();
if (!name.startsWith("FUN_") && !name.startsWith("LAB_")) {
if (!first) sb.append(",\n");
first = false;
sb.append(" {\"address\": \"")
.append(Long.toHexString(func.getEntryPoint().getOffset()))
.append("\", \"new_name\": \"")
.append(name.replace("\"", "\\\""))
.append("\"}");
}
}
// Also get non-function labels
var symTable = currentProgram.getSymbolTable();
var symIter = symTable.getSymbolIterator();
while (symIter.hasNext()) {
var sym = symIter.next();
var name = sym.getName();
var addr = sym.getAddress();
if (!name.startsWith("FUN_") && !name.startsWith("LAB_") && !name.startsWith("DAT_") && !name.startsWith("EXT_") && !name.startsWith("Start") && !name.startsWith("thunk_") && fm.getFunctionContaining(addr) == null) {
if (!first) sb.append(",\n");
first = false;
sb.append(" {\"address\": \"")
.append(Long.toHexString(addr.getOffset()))
.append("\", \"new_name\": \"")
.append(name.replace("\"", "\\\""))
.append("\"}");
}
}
sb.append("\n ]\n}");
println(sb.toString());
Capture the output and save to ~/hamsterball-re/analysis/ghidra/renames.json.
~/hamsterball-re/analysis/ghidra/renames.jsonmcp_ghidra_mcp_rename_or_label with the address and new_nameimport json
with open('/home/evan/hamsterball-re/analysis/ghidra/renames.json') as f:
data = json.load(f)
renames = data['renames']
print(f"Total renames to apply: {len(renames)}")
# Split into batches of 50
batches = [renames[i:i+50] for i in range(0, len(renames), 50)]
print(f"Batches: {len(batches)}")
Then for each batch, call mcp_ghidra_mcp_batch_create_labels with the labels array.
analyzeHeadless to re-import, all previous renames are LOST unless restored from backup.--program /Hamsterball.exe (with leading slash) to load a project program.| Action | Command |
|---|---|
| Export renames | Run inline script, save output to renames.json |
| Restore renames | Read renames.json, batch_create_labels |
| Verify count | mcp_ghidra_mcp_compare_programs_documentation |
| Commit to git | cd ~/hamsterball-re && git add analysis/ghidra/renames.json && git commit -m "backup renames" |