feat(ghidra): integrate optional NativeAOT metadata recovery (#748)

* feat(ghidra): integrate optional NativeAOT metadata recovery

* fix(ghidra): bind extension snapshots to configured artifacts

* test(ghidra): verify lazy NativeAOT startup failures

* fix(ghidra): preserve NativeAOT failure reasons and coverage

* fix(ghidra): preserve NativeAOT x64 calling conventions

* test(ghidra): guard recovered NativeAOT method conventions

* fix(ghidra): reject blocking extension file inputs

* fix(ghidra): diagnose incompatible NativeAOT extension classes

* test(ghidra): verify real extension initialization failures

* fix(ghidra): keep extension descriptor fields optional
This commit is contained in:
N0zoM1z0
2026-10-07 00:57:08 +08:00
committed by GitHub
parent 6d1f39b250
commit fb679b63c2
43 changed files with 2695 additions and 22 deletions
+4 -1
View File
@@ -4,7 +4,7 @@ description: Reverse engineer native, managed, Electron/JavaScript, packaged, fi
metadata:
version: "25"
tool_count: 125
catalog_digest: "297aced29e7ce5e845c505d5f2e9e2dee42b7ed3e628f088f424fe8088c9e8dc"
catalog_digest: "ed9c36900e9223561d38ba30a44921f4ff101d5eca989920f9edc9dc91df470b"
---
# REA
@@ -89,6 +89,9 @@ explicit path or endpoint and do not need it.
`extract_firmware` when extraction is requested, with a caller-selected new
absolute output directory. These tools use caller-supplied Binwalk/Unblob on
Linux; see the [firmware guide](https://github.com/morluto/rea/blob/main/docs/firmware-analysis.md).
- .NET NativeAOT PE/ELF: native Ghidra analysis. Native code can yield pseudocode;
consult the NativeAOT workflow in `references/native-and-artifacts.md` for
optional metadata recovery and its supported host/layout boundary.
- User-owned browser page already open: `list_browser_targets`.
- User-owned Electron runtime already open: `list_electron_targets`.
- Native executable, library, or analysis database: `open_binary`, then
@@ -37,6 +37,30 @@ assembly. Keep managed/native boundaries and unavailable reconstruction facts
explicit. A bring-your-own reconstruction oracle is separate from the canonical
parser and must not become an implicit setup dependency.
## .NET NativeAOT
A NativeAOT PE/ELF contains native code. Absence of PE/CLI metadata does not mean
analysis must stop at assembly. Use native function analysis for recovered
pseudocode; it is not reconstructed original C#.
With an explicitly configured NativeAOT Ghidra adapter, call
`inspect_native_load_image` after opening the target. Its optional
`observations.metadata_recovery` returns the format, positive header evidence,
coverage, derived-memory identity and type addresses/category paths inline.
Then inspect a reported type with `inspect_native_data_type`, follow its
`metadata_recovery.related_type`, interfaces and virtual slot addresses, and use
`analyze_function` plus string/xref searches for implementation evidence. Keep
`not_applicable`, partial recovery and unsupported layouts explicit. Generated
`Class_address` names and inferred System.Object/String identities are not
original names; custom field layouts remain unknown.
Recovery modifies an ephemeral analysis database and may replace loaded metadata
bytes with derived content. Original executable files remain unchanged. Distinguish
original file offsets from derived analysis memory. Windows x64 PE **targets**
can be analyzed on a supported Linux host; Windows **host** P0 does not admit
this database recovery. See the [NativeAOT guide](https://github.com/morluto/rea/blob/main/docs/ghidra-nativeaot.md)
for the tested layout and optional bring-your-own adapter build.
## Packages and extraction
Use `inspect_artifact` for application bundles, archives, ZIP/APK/IPA/MSIX/AppX,