feat(ghidra): implement read-only inventory operations

This commit is contained in:
N0zoM1z0
2026-07-16 02:59:37 +09:00
committed by N0zoM1z0
parent f0e625d7ee
commit b1c07dd9c6
101 changed files with 3825 additions and 377 deletions
+5
View File
@@ -8,6 +8,11 @@ their Mach-O symbols and strings with native command-line tools.
Only source files are versioned. Generated binaries, generated large-fixture
source, debug information, and manifests must remain under `build/`.
`ghidra/inventory.c` is also compiled into temporary Linux ELF debug and
stripped variants by `npm run verify:ghidra`. It fixes local functions, external
`puts` linkage, defined strings, and writable/executable memory needed to prove
the read-only Ghidra inventory contracts without committing a binary.
The C fixture fixes a known call chain and strings. The version pair fixes an
added symbol, changed string, and changed call relationship. The generated
large fixture contains 1,205 uniquely named functions and strings so provider
+15
View File
@@ -0,0 +1,15 @@
#include <stdio.h>
volatile int rea_ghidra_inventory_global = 7;
__attribute__((noinline, used)) int rea_ghidra_inventory_leaf(int value) {
puts("REA_GHIDRA_LEAF_VALUE");
return value + rea_ghidra_inventory_global;
}
__attribute__((noinline, used)) int rea_ghidra_inventory_entry(void) {
puts("REA_GHIDRA_INVENTORY_ENTRY");
return rea_ghidra_inventory_leaf(35);
}
int main(void) { return rea_ghidra_inventory_entry() == 42 ? 0 : 1; }