mirror of
https://github.com/morluto/rea
synced 2026-10-25 22:08:11 -04:00
docs: correct drift and reorganize English guides (#2207)
Put setup, developer commands, MCP replies, and investigation recipes before client details and implementation references. Preserve existing guide anchors, examples, provenance, partial-result recovery, and provider restrictions. Correct verified documentation drift, synchronize the Ghidra capability wording, and regenerate metadata for skill version 40. Keep uncertain platform and lifecycle findings unchanged. Refs #2156. Validation: 56 focused tests, check:fast, docs:check, VitePress production build, format and link/example checks. Real isolated CLI/MCP probes cover Ghidra, NativeAOT, HAR, cancellation, Chrome, large ELF delivery, native type limits, and the new JS/managed/process/setup recipes. Heavy work uses two CPUs; a resource-heavy DOM probe was stopped and replaced by a smaller real CDP payload-limit control. Windows, macOS GUI, ADB, and the full CI matrix were not executed. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
@@ -26,6 +26,20 @@ current tool set.
|
||||
The canonical tool inventory is the
|
||||
[build-generated catalog](mcp-contracts.md#generated-catalog).
|
||||
|
||||
## Inspect an assembly
|
||||
|
||||
```bash
|
||||
rea inspect-managed-artifact /absolute/path/Assembly.dll --json
|
||||
rea inspect-managed-members /absolute/path/Assembly.dll --json
|
||||
```
|
||||
|
||||
Use the artifact result to identify the assembly and its metadata coverage.
|
||||
Member results retain build-local tokens, signatures, CIL bodies, and decoded
|
||||
relationships. Use an exact reported `full_name` with `--type` when a focused
|
||||
inspection is needed; see [selected member inspection](#selected-member-inspection).
|
||||
Compare separate builds with [member comparison](#member-comparison), preserving
|
||||
their paths, digests, and selection scope.
|
||||
|
||||
## Shipped scope
|
||||
|
||||
The canonical parser admits PE/CLI bytes and their metadata/CIL without loading
|
||||
@@ -94,19 +108,39 @@ assembly. Older member Evidence without `selection` remains readable.
|
||||
|
||||
## Analysis objective
|
||||
|
||||
REA's managed-code track is intended to answer five different questions without
|
||||
collapsing them:
|
||||
Start by identifying the artifact with `inspect_managed_artifact`, then inspect
|
||||
its types and CIL with `inspect_managed_members`. Use [member comparison](#member-comparison)
|
||||
for another build, and [managed/native boundary rules](#managednative-boundary-rules)
|
||||
when matching declared native calls to supplied native Evidence. Static inspection
|
||||
does not load or execute the assembly. Reconstructed structure and unresolved
|
||||
native/runtime questions retain their own authority and coverage.
|
||||
|
||||
1. What exact artifact and managed deployment form is this?
|
||||
2. What do its admitted metadata and CIL bytes state?
|
||||
3. What source-like or behavioral structure can be reconstructed or inferred?
|
||||
4. Which findings survive an exact-build check or a cross-build structural
|
||||
comparison?
|
||||
5. Which remaining questions require native analysis or runtime evidence that
|
||||
static inspection cannot supply?
|
||||
## Member comparison
|
||||
|
||||
The ordinary workflow ends at question four. Static analysis never loads or
|
||||
executes the target.
|
||||
Names and semantic labels do not establish durable member identity. Comparison
|
||||
preserves observed differences, structural inferences, and unknowns separately.
|
||||
|
||||
Cross-version matching first prefers exact CIL/signature identity. When that
|
||||
does not match, it pairs an exact declared type, method name, and raw signature
|
||||
before trying structural body shape. The exact-signature key uses names only
|
||||
as part of that full tuple; names alone never select a pair. Duplicate tuples
|
||||
remain ambiguous rather than being paired by token order. Fields follow the
|
||||
same exact tiers. The raw signature is exact whether or not REA decoded it, so
|
||||
undecoded signatures pair by that tuple too, but they never enter structural
|
||||
rounds. An unmatched member is therefore reported as `unknown`, not added or
|
||||
removed, when its own signature was not decoded or when the other side has an
|
||||
unpaired member, one-sided or ambiguous, with the same declared type and name
|
||||
whose signature was not decoded.
|
||||
|
||||
For a matched method, an unavailable or partial body makes body-shape facets
|
||||
unknown while preserving observed signature differences. Structural identity
|
||||
compares normalized signatures, the limited decoded-CIL tuple fingerprint,
|
||||
constants, and bounded shape context. It reports all candidates at the winning
|
||||
score and remains ambiguous when the evidence does not distinguish them. The
|
||||
digest does not itself remap metadata tokens.
|
||||
|
||||
Tokens are always remapped through observed structure. A caller cannot carry
|
||||
`0x06001234` into a new MVID and assume it names the same method.
|
||||
|
||||
## NativeAOT metadata recovery
|
||||
|
||||
@@ -128,24 +162,38 @@ lists supported OS/architecture targets and deployment limitations, while its
|
||||
[native library guide](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/libraries)
|
||||
describes exported shared-library entry points.
|
||||
|
||||
REA supports an optional headless adapter for the Ghidra NativeAOT analyzer.
|
||||
Supply a locally built `REA_GHIDRA_NATIVEAOT_JAR`; REA does not install the
|
||||
extension or its toolchain. The verified boundary is .NET 8.0.22 RTR 9.1,
|
||||
x86-64 ELF and native Windows PE targets analyzed on Linux x64 with Ghidra
|
||||
12.1.4 and JDK 21. Other layouts, architectures, and hosts are unsupported.
|
||||
See [NativeAOT recovery](ghidra-nativeaot.md) for build/configuration, recovered
|
||||
metadata, derived-memory provenance, and the real verification lane.
|
||||
REA offers a built-in read-only snapshot parser for x64 PE/RTR 9.1 metadata and
|
||||
an optional Linux headless Ghidra adapter for annotations and broader recovery.
|
||||
The adapter requires a locally built `REA_GHIDRA_NATIVEAOT_JAR`; REA does not
|
||||
install it or its toolchain. The [NativeAOT guide](ghidra-nativeaot.md) defines
|
||||
these routes, their layout/host restrictions, derived-memory provenance, and
|
||||
verification coverage.
|
||||
|
||||
REA's experimental Windows Ghidra boundary admits native x86 and x86-64 PE
|
||||
applications and DLLs for static analysis. This does not establish Windows
|
||||
NativeAOT metadata-recovery coverage.
|
||||
|
||||
For NativeAOT analysis, preserve the selected native artifact's path and digest
|
||||
and report recovered type data as provider observations. Linking those types
|
||||
and report recovered type data with its returned provenance. Linking those types
|
||||
to native function addresses requires verified
|
||||
provider evidence; names or vtable similarity alone do not prove that a native
|
||||
function implements a specific managed method.
|
||||
|
||||
## Managed/native boundary rules
|
||||
|
||||
`verify_managed_native_boundaries` compares declared P/Invoke module and entry
|
||||
point identities with supplied native export or function evidence. Name/module
|
||||
matches establish declaration links; they do not establish that a call executed.
|
||||
|
||||
Metadata tokens are not native addresses. Native body mapping for C++/CLI,
|
||||
ReadyToRun, NativeAOT, and IL2CPP requires separately verified format and provider
|
||||
support. The managed static tools do not recover those mappings. The optional
|
||||
[Ghidra NativeAOT extension](ghidra-nativeaot.md) has its own supported boundary.
|
||||
|
||||
Declared import inventory supports a bounded positive claim. Its absence does
|
||||
not exclude dynamic resolution, generated code, protected code, native helpers,
|
||||
or server-side behavior.
|
||||
|
||||
## Evidence record shape
|
||||
|
||||
Member comparison, application graph projection, and managed/native verification
|
||||
@@ -229,48 +277,6 @@ For example, a decoded `nop; ret` body serializes exactly as
|
||||
This vector specifies the tuple order, `null` handling, absence of whitespace,
|
||||
UTF-8 encoding, and lowercase hexadecimal output.
|
||||
|
||||
## Member comparison
|
||||
|
||||
Names and semantic labels do not establish durable member identity. Comparison
|
||||
preserves observed differences, structural inferences, and unknowns separately.
|
||||
|
||||
Cross-version matching first prefers exact CIL/signature identity. When that
|
||||
does not match, it pairs an exact declared type, method name, and raw signature
|
||||
before trying structural body shape. The exact-signature key uses names only
|
||||
as part of that full tuple; names alone never select a pair. Duplicate tuples
|
||||
remain ambiguous rather than being paired by token order. Fields follow the
|
||||
same exact tiers. The raw signature is exact whether or not REA decoded it, so
|
||||
undecoded signatures pair by that tuple too, but they never enter structural
|
||||
rounds. An unmatched member is therefore reported as `unknown`, not added or
|
||||
removed, when its own signature was not decoded or when the other side has an
|
||||
unpaired member, one-sided or ambiguous, with the same declared type and name
|
||||
whose signature was not decoded.
|
||||
|
||||
For a matched method, an unavailable or partial body makes body-shape facets
|
||||
unknown while preserving observed signature differences. Structural identity
|
||||
compares normalized signatures, the limited decoded-CIL tuple fingerprint,
|
||||
constants, and bounded shape context. It reports all candidates at the winning
|
||||
score and remains ambiguous when the evidence does not distinguish them. The
|
||||
digest does not itself remap metadata tokens.
|
||||
|
||||
Tokens are always remapped through observed structure. A caller cannot carry
|
||||
`0x06001234` into a new MVID and assume it names the same method.
|
||||
|
||||
## Managed/native boundary rules
|
||||
|
||||
`verify_managed_native_boundaries` compares declared P/Invoke module and entry
|
||||
point identities with supplied native export or function evidence. Name/module
|
||||
matches establish declaration links; they do not establish that a call executed.
|
||||
|
||||
Metadata tokens are not native addresses. Native body mapping for C++/CLI,
|
||||
ReadyToRun, NativeAOT, and IL2CPP requires separately verified format and provider
|
||||
support. The managed static tools do not recover those mappings. The optional
|
||||
[Ghidra NativeAOT extension](ghidra-nativeaot.md) has its own supported boundary.
|
||||
|
||||
Declared import inventory supports a bounded positive claim. Its absence does
|
||||
not exclude dynamic resolution, generated code, protected code, native helpers,
|
||||
or server-side behavior.
|
||||
|
||||
## Tool and packaging boundary
|
||||
|
||||
The production parser is REA-owned TypeScript and ships with the existing Node
|
||||
|
||||
Reference in New Issue
Block a user