feat(target): explain static WASM inspection after native rejection

Explain recognized WASM v1 native-admission rejection with an exact call to the existing static inspection tool and its caller-supplied WABT prerequisites. Preserve selected paths, explicit raw-binary choices, typed missing-tool outcomes and connection usability.

Refs #1852

Co-authored-by: SII-YDD <38822679+SII-YDD@users.noreply.github.com>
Co-authored-by: Ysopwnable <161784452+N0zoM1z0@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
This commit is contained in:
SII-YDD
2026-10-12 07:00:30 +08:00
committed by GitHub
co-authored by Ysopwnable factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Kaoru0822
parent 89f5e489ad
commit 1f17ac8228
9 changed files with 238 additions and 47 deletions
+25 -13
View File
@@ -131,6 +131,8 @@ for (const little of [true, false]) {
const fp64 = await inspect(bytes, little);
assert.ok(fp64.ok);
const changed = target({ ...metadata(little), abiFlags: fp64.value });
assert.equal(fp64.value?.cpr1Size, 2);
assert.equal(fp64.value?.fpAbi, 6);
assert.match(ghidraMipsUnsupportedReason(changed) ?? "", /FP64/u);
assert.notDeepEqual(ghidraMipsProfileParameters(changed), before);
});
@@ -271,6 +273,13 @@ const unsupported: [string, (bytes: Buffer) => void, RegExp][] = [
},
/MIPS32r2/u,
],
[
"soft-float with declared CPR1",
(b) => {
b[abiOffset + 7] = 3;
},
/soft-float without CPR1/u,
],
[
"unspecified FP ABI",
(b) => {
@@ -301,19 +310,22 @@ for (const [name, change, reason] of unsupported) {
);
});
}
it("resolves soft-float ABI metadata and commits its integer-register storage policy", async () => {
const bytes = fixture();
bytes[abiOffset + 5] = 0;
bytes[abiOffset + 7] = 3;
const resolved = await resolveFixture(bytes);
assert.equal(resolved.mips.abiFlags?.cpr1Size, 0);
assert.equal(resolved.mips.abiFlags?.fpAbi, 3);
assert.equal(ghidraMipsUnsupportedReason(resolved), null);
assert.equal(
ghidraMipsProfileParameters(resolved).mips_soft_float_storage,
"o32-soft-float-prototype-v1",
);
});
it.each([true, false])(
"resolves soft-float ABI metadata and commits its integer-register storage policy (little endian: %s)",
async (little) => {
const bytes = fixture(little);
bytes[abiOffset + 5] = 0;
bytes[abiOffset + 7] = 3;
const resolved = await resolveFixture(bytes);
assert.equal(resolved.mips.abiFlags?.cpr1Size, 0);
assert.equal(resolved.mips.abiFlags?.fpAbi, 3);
assert.equal(ghidraMipsUnsupportedReason(resolved), null);
assert.equal(
ghidraMipsProfileParameters(resolved).mips_soft_float_storage,
"o32-soft-float-prototype-v1",
);
},
);
it("preserves the caller's cancellation error during table inspection", async () => {
const cancelled = new Error("caller cancellation sentinel");
let checks = 0;