From 72f63e51fa2f2279b72c0ae02818a1f8a2e46340 Mon Sep 17 00:00:00 2001 From: Taksh Date: Tue, 24 Nov 2026 21:03:13 +0530 Subject: [PATCH 01/11] Verify oletools 0.60.2 RTF OLE1 Package extraction --- docs/priority-candidates.json | 6 +-- docs/priority-candidates.md | 2 +- examples/resource-intake/README.md | 7 ++- examples/resource-intake/requirements.txt | 1 + examples/resource-intake/verify.py | 55 ++++++++++++++++++++++- 5 files changed, 64 insertions(+), 7 deletions(-) diff --git a/docs/priority-candidates.json b/docs/priority-candidates.json index 2d33a30..86e0f61 100644 --- a/docs/priority-candidates.json +++ b/docs/priority-candidates.json @@ -208,9 +208,9 @@ "section": "Malware analysis", "description": "Python tools for inspecting Office, OLE, and RTF files and extracting macros, embedded objects, and other document artifacts.", "research_priority": "A0", - "checked_at": "2026-10-13", - "next_review": "2026-11-13", - "evidence_type": "documented", + "checked_at": "2026-11-24", + "next_review": "2026-12-24", + "evidence_type": "reproduced", "task": "Office, OLE, and RTF analysis", "incremental_value": "Fills the document-input gap: macro extraction, embedded objects, and related document artifacts rather than predominantly PE inputs.", "constraints": "Coverage varies by subtool; XLM workflows have optional dependencies. README news mentions 0.60.3 while the latest GitHub release endpoint returns 0.60.2. Own code uses BSD-style terms, with MIT/third-party exceptions.", diff --git a/docs/priority-candidates.md b/docs/priority-candidates.md index fe01d26..16fa21a 100644 --- a/docs/priority-candidates.md +++ b/docs/priority-candidates.md @@ -18,7 +18,7 @@ The [machine-readable snapshot](priority-candidates.json) retains source revisio | [Construct](https://raw.githubusercontent.com/construct/construct/28c6e5779f2b76d55474914607291a3821502000/README.rst) · [source 1](https://raw.githubusercontent.com/construct/construct/28c6e5779f2b76d55474914607291a3821502000/LICENSE) | **File formats:** Bidirectional binary schemas. Complements Kaitai with composable Python parsing and building, useful for checking field hypotheses and reconstructing files. | Schemas must correctly model lengths, context, and validation. GitHub reports NOASSERTION, but the reviewed LICENSE contains MIT terms. **Reproduced.** Golden bytes, parse/build, wrong magic, truncation, trailing-data rejection. | | [Vineflower](https://raw.githubusercontent.com/Vineflower/vineflower/b8273988af850e8cfb234ca08d129058502b032f/README.md) | **Android and managed code:** Modern JVM class decompilation. Adds a standalone JVM decompiler beside the existing Android DEX and managed-code workbenches. | Current releases require Java 17+ to run; host requirements and target class versions are separate. Obfuscation and other Java versions were not tested. Apache-2.0. **Reproduced.** Java 17 record/switch expression, rebuild, main output and five branch vectors. | | [ghidriff](https://raw.githubusercontent.com/clearbluejar/ghidriff/4f5d895fcbb1eacd65efd81145922c15bb7e741d/README.md) | **Diffing and analysis frameworks:** Reviewable patch-diff reports. Adds CLI automation and JSON/Markdown/optional HTML reports to the existing pairwise diffing tools. | Ghidra, PyGhidra/JPype, and the matching JDK must be pinned. The reviewed development target is Ghidra 12.0.4 with PyGhidra 3.x; older examples do not prove broad compatibility. GPL-3.0. **Documented.** | -| [oletools](https://raw.githubusercontent.com/decalage2/oletools/ec10260989dbc48b9109e3d05d22beee19cf2333/README.md) · [source 1](https://raw.githubusercontent.com/decalage2/oletools/ec10260989dbc48b9109e3d05d22beee19cf2333/LICENSE.md) | **Malware analysis:** Office, OLE, and RTF analysis. Fills the document-input gap: macro extraction, embedded objects, and related document artifacts rather than predominantly PE inputs. | Coverage varies by subtool; XLM workflows have optional dependencies. README news mentions 0.60.3 while the latest GitHub release endpoint returns 0.60.2. Own code uses BSD-style terms, with MIT/third-party exceptions. **Documented.** | +| [oletools](https://raw.githubusercontent.com/decalage2/oletools/ec10260989dbc48b9109e3d05d22beee19cf2333/README.md) · [source 1](https://raw.githubusercontent.com/decalage2/oletools/ec10260989dbc48b9109e3d05d22beee19cf2333/LICENSE.md) | **Malware analysis:** Office, OLE, and RTF analysis. Fills the document-input gap: macro extraction, embedded objects, and related document artifacts rather than predominantly PE inputs. | Coverage varies by subtool; XLM workflows have optional dependencies. README news mentions 0.60.3 while the latest GitHub release endpoint returns 0.60.2. Own code uses BSD-style terms, with MIT/third-party exceptions. **Reproduced (CI).** `oletools.rtfobj` 0.60.2 extracts a synthetic OLE1 Package (`probe.txt`) across clean and obfuscated hex; plain RTF yields 0 objects; non-OLE1 `\objdata` yields an object with `is_ole=False` and `is_package=False`. | | [AssetRipper](https://raw.githubusercontent.com/AssetRipper/AssetRipper/beeb50ee1c223e856c860caa338e5309404956a3/README.md) · [source 1](https://assetripper.com/premium/features/) | **Language runtimes and packagers:** Unity assets and dependencies. Complements Cpp2IL/Il2CppDumper code and metadata analysis with asset inspection and export. | The README claims Unity 3.5.0–6000.4.X, with varying support quality. The GPL-3.0 base and paid Premium features must be distinguished. **Documented.** | | [Speakeasy](https://raw.githubusercontent.com/mandiant/speakeasy/aa9f22643f4519e0555141cd16ee25eb971b5518/README.md) · [source 1](https://raw.githubusercontent.com/mandiant/speakeasy/aa9f22643f4519e0555141cd16ee25eb971b5518/doc/limitations.md) | **Malware analysis:** Modeled Windows execution and API reports. A smaller emulation/reporting path beside full sandbox VMs. | API, filesystem, registry, and runtime behavior are modeled. Signature-only stubs can report success without real side effects; unknown APIs may stop execution. MIT. **Documented.** | | [strace](https://raw.githubusercontent.com/strace/strace/6cba874722375675e97f68367674c1cde3cce77c/README.md) · [source 1](https://raw.githubusercontent.com/strace/strace/6cba874722375675e97f68367674c1cde3cce77c/COPYING) | **Dynamic instrumentation and tracing:** Linux syscall and signal observation. A practical first step for mapping process I/O before using a debugger or instrumentation framework. | Linux ptrace permissions and container policy affect attachment. It is syscall-level tracing. COPYING specifies LGPL-2.1-or-later for the main program, with separate test/UAPI terms. **Documented.** | diff --git a/examples/resource-intake/README.md b/examples/resource-intake/README.md index 713e0e7..47efb52 100644 --- a/examples/resource-intake/README.md +++ b/examples/resource-intake/README.md @@ -1,6 +1,6 @@ # Bounded resource examples -These self-authored fixtures demonstrate Construct, Scapy, YARA-X, Vineflower, CFR, Malduck, hermes-dec, MemProcFS, boofuzz, Keystone, esptool, and Z3 in CI, plus a local PyLingual check. They are small selection examples, not upstream test suites or evidence of full platform/version support. +These self-authored fixtures demonstrate Construct, Scapy, YARA-X, Vineflower, CFR, Malduck, hermes-dec, MemProcFS, boofuzz, Keystone, esptool, Z3, and oletools in CI, plus a local PyLingual check. They are small selection examples, not upstream test suites or evidence of full platform/version support. Use Python 3.11 with `venv`/`pip` support, JDK 17, Node.js, and an Internet connection for the pinned packages, JAR, and Hermes compilers. From the repository root: @@ -44,6 +44,7 @@ $resourcePython = Join-Path $resourceExamplesDir "venv\Scripts\python.exe" | Keystone 0.9.2 (with Capstone 5.0.9) | x86-64 `push rbp; mov rbp, rsp; mov eax, dword ptr [rbx + rcx*4 + 8]; xor eax, eax; pop rbp; ret` and ARM64 `mov x0, #1; add x1, x2, x3; ldr x0, [x1, #8]; b #0x1010; ret` at base `0x1000` assemble to bytes encoded by hand from the Intel SDM and Arm ARM (`554889e58b448b0831c05dc3`, `200080d24100038b200440f901000014c0035fd6`); Capstone disassembles them back to the same text, which reassembles to the same bytes; `b #0x1010` at `0x2000` becomes the backward branch `04fcff17` | Two short sequences on two ISAs, Linux x86-64 only; see the limits below | | esptool 5.6.0 | A 128-byte ESP32 application image built by hand from the [5.6.0 documented layout](https://raw.githubusercontent.com/espressif/esptool/e970488de2c8f1906ca9b08de681b3f9dc58b2d5/docs/en/advanced-topics/firmware-image-format.rst): entry `0x40080400`, a 16-byte DRAM segment at `0x3ffb0000` and a 32-byte IRAM segment at `0x40080400`, checksum `0xf3` (`0xEF` XOR the segment data) and an appended SHA-256 `f8d0bbc1…c9cb`; `image-info` reports the header, both segments at file offsets `0x18` and `0x30`, and a valid checksum and hash, with no device connected. A synthetic variant with chip ID 9 is detected as ESP32-S3 (header identification only); flipping one data bit gives checksum `0xf2` and hash `b1f33ee1…4147`, both reported as invalid | Offline `image-info` on one ESP32 application layout; no serial port, flashing, or bootloader images; see the limits below | | Z3 (z3-solver 5.3.1.0) | A synthetic 16-bit serial check written as a decompiler would show it (`((x * 0x9E37) ^ (x >> 5)) + rotl(x, 3)` with unsigned arithmetic) and target `0x002a`; brute-forcing all 65,536 inputs in plain Python finds exactly `0x1bb9`, `0x9cff`, and `0xb62c`, and Z3's bit-vector solver, asked again with each found serial blocked, returns the same three and then `unsat` | Python API, one 16-bit constraint; no SMT-LIB files, tactics, timeouts, or `unknown` results; see the limits below | +| oletools 0.60.2 | A synthetic RTF document containing an OLE1 `Package` stream (`probe.txt`, payload `OLE-RTF-PROBE-PAYLOAD-1`); `RtfObjParser` recovers the class name, filename, and exact payload bytes from both clean hex and hex interrupted by whitespace and `{\bin0}`; a plain RTF yields zero objects | `oletools.rtfobj` Python API on one synthetic OLE1 Package; no VBA/XLM macros or Office Open XML; see the limit below | The branch oracle for `Probe.java` is: @@ -87,6 +88,10 @@ The Z3 check also records two limits, both described in the [5.3.1 Python API](h - `>>` on a bit-vector is an arithmetic (signed) shift; C's unsigned `>>` is `LShR`. Written with `>>`, the same check returns only `0x1bb9`, silently missing the two serials whose top bit is set, without an error. The two shifts agree whenever the top bit is clear. - `model.eval(y, model_completion=True)` gives an unconstrained variable the value 0 and adds it to the model, so afterwards `model[y]` is 0 and `model.decls()` lists `y` as if the solver had chosen it. +The oletools check also records one limit: + +- Non-OLE1 bytes inside `\objdata` are still returned as an extracted object in `parser.objects` with `is_ole=False`, `is_package=False`, and `olepkgdata=None` (no exception is raised), so callers must check `is_ole`/`is_package` before treating an extracted object as a valid OLE package. + Without `-dtb`, MemProcFS rejects a raw image that contains no identifiable operating system (`Unable to locate valid DTB`). The Linux `memprocfs` wheel does not include `leechcore.so`; the runner uses the one from `leechcorepyc` by starting the probe with `LD_LIBRARY_PATH` pointing at its directory. The [dated local result](verified.json) records host/tool versions, input hashes, artifact digests, and the tested scope; it was produced in a Linux x86_64 container. CI repeats the examples and uploads current results through the [resource-example workflow](../../.github/workflows/resource-examples.yml). The current job uses Linux x86-64, Python 3.11, Java 17, Node.js 22, and `libusb-1.0`; it makes no Windows, macOS, hardware, or other-version claim. diff --git a/examples/resource-intake/requirements.txt b/examples/resource-intake/requirements.txt index 7c33a88..8c5d2a5 100644 --- a/examples/resource-intake/requirements.txt +++ b/examples/resource-intake/requirements.txt @@ -10,3 +10,4 @@ keystone-engine==0.9.2; sys_platform == "linux" and platform_machine == "x86_64" capstone==5.0.9; sys_platform == "linux" and platform_machine == "x86_64" esptool==5.6.0 z3-solver==5.3.1.0 +oletools==0.60.2 diff --git a/examples/resource-intake/verify.py b/examples/resource-intake/verify.py index f5af22f..06b28eb 100644 --- a/examples/resource-intake/verify.py +++ b/examples/resource-intake/verify.py @@ -1,4 +1,4 @@ -"""Reproduce twelve narrow resource examples with independent expected outputs.""" +"""Reproduce thirteen narrow resource examples with independent expected outputs.""" import argparse import ctypes.util from datetime import datetime, timezone @@ -314,7 +314,7 @@ def keystone_host(): def required_packages(): - packages = {"construct": "2.10.70", "scapy": "2.8.0", "yara-x": "1.21.0", "hermes-dec": "0.1.8", "malduck": "4.4.1", "boofuzz": "0.4.2", "esptool": "5.6.0", "z3-solver": "5.3.1.0"} + packages = {"construct": "2.10.70", "scapy": "2.8.0", "yara-x": "1.21.0", "hermes-dec": "0.1.8", "malduck": "4.4.1", "boofuzz": "0.4.2", "esptool": "5.6.0", "z3-solver": "5.3.1.0", "oletools": "0.60.2"} if memprocfs_host(): packages.update(MEMPROCFS_PACKAGES) if keystone_host(): @@ -530,6 +530,54 @@ def verify_z3(): return {"target": hex(SERIAL_TARGET), "serials": [hex(v) for v in serials], "arithmetic_shift_serials": [hex(v) for v in naive]} +def verify_oletools(): + import oletools.rtfobj + + payload = b"OLE-RTF-PROBE-PAYLOAD-1" + filename, src_path, tmp_path = b"probe.txt", b"C:\\work\\probe.txt", b"C:\\temp\\probe.txt" + pkg = ( + struct.pack("> in place of LShR finds only the one with the top bit clear; model_completion adds a default value to the model"}, + {"name": "oletools", "version": "0.60.2", "result": "passed", "scope": "Synthetic RTF with an embedded OLE1 Package: RtfObjParser recovers filename and payload across clean and obfuscated (whitespace + \\bin0) hex; plain RTF yields 0 objects; non-OLE1 \\objdata still yields an object with is_ole=False and is_package=False"}, ], "inputs": [{"path": name, "sha256": sha256(SOURCE / name)} for name in ("BranchDemo.java", "Probe.java", "Shapes.java", "SealedProbe.java", "hbc_fixture.js", "malduck_modules/duckcfg/__init__.py", "malduck_modules/duckcfg/duckcfg.yar", "memprocfs_probe.py", "verify.py", "requirements.txt")], "golden_hex": GOLDEN.hex(), @@ -658,6 +708,7 @@ def verify(work, jar, cfr_jar=None): "keystone": {"base": hex(ASM_BASE), "x64": {"source": X64_SOURCE, "bytes": X64_BYTES}, "arm64": {"source": A64_SOURCE, "bytes": A64_BYTES, "backward_branch_at_0x2000": A64_BACKWARD_BRANCH}}, "z3": z3_summary, + "oletools": oletools_summary, "esptool": {"image_sha256": esp_digest, "entry": hex(ESP_ENTRY), "checksum": hex(ESP_CHECKSUM), "validation_hash": ESP_DIGEST, "corrupt_checksum": hex(ESP_CORRUPT_CHECKSUM), "corrupt_validation_hash": ESP_CORRUPT_DIGEST}, } From 439dc790ac4d9f0211513968141e9323c8057a3c Mon Sep 17 00:00:00 2001 From: Taksh Date: Tue, 24 Nov 2026 21:16:22 +0530 Subject: [PATCH 02/11] Verify WhatsABI 0.30.0 selector recovery on a hand-built jump table --- .github/workflows/resource-examples.yml | 3 + README.md | 2 +- docs/catalog-expansion-review.md | 2 +- examples/resource-intake/README.md | 5 +- examples/resource-intake/verify.py | 21 +- examples/resource-intake/whatsabi/.gitignore | 1 + .../whatsabi/package-lock.json | 229 ++++++++++++++++++ .../resource-intake/whatsabi/package.json | 8 + examples/resource-intake/whatsabi/probe.mjs | 28 +++ 9 files changed, 293 insertions(+), 6 deletions(-) create mode 100644 examples/resource-intake/whatsabi/.gitignore create mode 100644 examples/resource-intake/whatsabi/package-lock.json create mode 100644 examples/resource-intake/whatsabi/package.json create mode 100644 examples/resource-intake/whatsabi/probe.mjs diff --git a/.github/workflows/resource-examples.yml b/.github/workflows/resource-examples.yml index 497a67b..3222d05 100644 --- a/.github/workflows/resource-examples.yml +++ b/.github/workflows/resource-examples.yml @@ -45,6 +45,9 @@ jobs: run: sudo apt-get install -y --no-install-recommends libusb-1.0-0 - name: Install pinned example dependencies run: python -m pip install -r examples/resource-intake/requirements.txt + - name: Install pinned WhatsABI example + run: npm ci --ignore-scripts + working-directory: examples/resource-intake/whatsabi - name: Reproduce the bounded examples run: python examples/resource-intake/verify.py --output "$RUNNER_TEMP/resource-intake" - name: Upload reproduction results diff --git a/README.md b/README.md index ae2ad6d..6adc2ea 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,7 @@ Run samples only in isolated, disposable environments, and follow your organizat - [r2flutter](https://github.com/radareorg/r2flutter) - radare2 plugin and CLI for recovering Dart AOT snapshot metadata from Flutter binaries; requires radare2 6.2.2+, primarily targets AArch64, and depends on snapshot layout. - [Redress](https://github.com/goretk/redress) - Recovers compiler metadata, packages, types, and symbols from stripped Go executables; target Go-version compatibility depends on the selected release and GoRE parser. - [reFlutter](https://github.com/Impact-I/reFlutter) - Flutter mobile-analysis framework that instruments matching engine builds and produces method or type information; Android/iOS architecture and engine-version support varies. -- [WhatsABI](https://github.com/shazow/whatsabi) - TypeScript library for inferring Ethereum ABI entries and resolving proxy metadata from bytecode; inferred signatures and types are not original-source recovery. +- [WhatsABI](https://github.com/shazow/whatsabi) - TypeScript library for inferring Ethereum ABI entries and resolving proxy metadata from bytecode; selector recovery follows the JUMPI table, and inferred signatures and types are not original-source recovery. ## Web and protocols diff --git a/docs/catalog-expansion-review.md b/docs/catalog-expansion-review.md index f8b7c7b..dbdb6a4 100644 --- a/docs/catalog-expansion-review.md +++ b/docs/catalog-expansion-review.md @@ -36,7 +36,7 @@ The earlier inventory said 48, but its diff added 55 top-level resources. Four n | [r2flutter](https://github.com/radareorg/r2flutter) · [source 1](https://raw.githubusercontent.com/radareorg/r2flutter/441d614937c8ada56e4d0c1175050667842c0971/README.md) · [source 2](https://raw.githubusercontent.com/radareorg/r2flutter/441d614937c8ada56e4d0c1175050667842c0971/doc/support.md) | radare2 plugin and CLI for recovering Dart AOT snapshot metadata from Flutter binaries | The support document distinguishes source layout profiles and structural guesses from actual regression coverage. It describes Android and iOS containers; do not restrict it to Android solely on an older review comment. | | [Redress](https://github.com/goretk/redress) · [source 1](https://raw.githubusercontent.com/goretk/redress/198e6dc82f17ca6e9edb80b22a85af17f1a3b031/README.md) | Recovers compiler metadata, packages, types, and symbols from stripped Go executables | The default branch and latest release are different evidence channels. Latest release v1.2.98 was published 2026-10-20; no unsupported mothballed classification is used. | | [reFlutter](https://github.com/Impact-I/reFlutter) · [source 1](https://raw.githubusercontent.com/Impact-I/reFlutter/590b1d2f12a274a249fb84a7fc4e2236fbe4639d/README.md) | Flutter mobile-analysis framework that instruments matching engine builds and produces method or type information | The current source documents Android arm64/arm32/x64 and iOS arm64 with engine/version constraints. That is documentation, not execution of each target. | -| [WhatsABI](https://github.com/shazow/whatsabi) · [source 1](https://raw.githubusercontent.com/shazow/whatsabi/eefa62383640b9056aade49d1d5ed2206ffcdb3b/README.md) | TypeScript library for inferring Ethereum ABI entries and resolving proxy metadata from bytecode | inferred signatures and types are not original-source recovery. | +| [WhatsABI](https://github.com/shazow/whatsabi) · [source 1](https://raw.githubusercontent.com/shazow/whatsabi/eefa62383640b9056aade49d1d5ed2206ffcdb3b/README.md) | TypeScript library for inferring Ethereum ABI entries and resolving proxy metadata from bytecode | Inferred signatures and types are not original-source recovery. The resource-intake example pins 0.30.0: `selectorsFromBytecode` returns the keccak prefixes of `foo()` and `bar(uint256)` from a hand-built jump table, `abiFromBytecode` stays empty when those targets are not JUMPDESTs, and a PUSH4 with no JUMPI is ignored. | | [Netzob](https://github.com/netzob/netzob) · [source 1](https://raw.githubusercontent.com/netzob/netzob/088fe769e98e0bfbd3ed99e66b3982446bf8d197/README.rst) | Python protocol-inference library for exploring fields, messages, and state models from captures | README documents Python 3.8+ plus native libpcap/libffi/build dependencies. Old packaged examples are not proof of compatibility with every newer Python. | | [avatar2](https://github.com/avatartwo/avatar2) · [source 1](https://raw.githubusercontent.com/avatartwo/avatar2/56a90cfe738886236dcbc3653756bdbdec6aaf92/README.md) | Coordinates debuggers, emulators, and physical targets for embedded analysis | each endpoint needs its own compatible backend and any associated hardware. | | [ChipWhisperer](https://github.com/newaetech/chipwhisperer) · [source 1](https://raw.githubusercontent.com/newaetech/chipwhisperer/febd64ea455fcc69c869f68d834a4b53ead7f022/README.md) | Hardware and Python tooling for side-channel power analysis and fault-injection experiments | Capture board, target board, firmware and trace-analysis software are separate components; software/source availability does not supply hardware. | diff --git a/examples/resource-intake/README.md b/examples/resource-intake/README.md index 713e0e7..9cddc63 100644 --- a/examples/resource-intake/README.md +++ b/examples/resource-intake/README.md @@ -1,6 +1,6 @@ # Bounded resource examples -These self-authored fixtures demonstrate Construct, Scapy, YARA-X, Vineflower, CFR, Malduck, hermes-dec, MemProcFS, boofuzz, Keystone, esptool, and Z3 in CI, plus a local PyLingual check. They are small selection examples, not upstream test suites or evidence of full platform/version support. +These self-authored fixtures demonstrate Construct, Scapy, YARA-X, Vineflower, CFR, Malduck, hermes-dec, MemProcFS, boofuzz, Keystone, esptool, Z3, and WhatsABI in CI, plus a local PyLingual check. They are small selection examples, not upstream test suites or evidence of full platform/version support. Use Python 3.11 with `venv`/`pip` support, JDK 17, Node.js, and an Internet connection for the pinned packages, JAR, and Hermes compilers. From the repository root: @@ -13,7 +13,7 @@ python3.11 -m venv "$resource_examples_dir/venv" The runner downloads [Vineflower 1.12.0](https://github.com/Vineflower/vineflower/releases/tag/1.12.0), [CFR 0.152](https://github.com/leibnitz27/cfr/releases/tag/0.152), and two `hermes-compiler` npm tarballs, and checks each SHA-256 before executing anything from them. An existing JAR can be supplied with `--vineflower-jar /path/to/vineflower-1.12.0.jar`; the same digest check still applies, and `--cfr-jar /path/to/cfr-0.152.jar` does the same for CFR. Failed assertions or commands fail the run; a successful run writes `results.json` and retains generated artifacts in a unique directory under the selected output path. -The Hermes fixture additionally needs Node.js (CI uses Node.js 22). Its pinned compilers provide Linux x86-64, universal macOS, and Windows x86-64 binaries; native Windows/macOS execution is not part of this repository's verification. +The Hermes fixture and the WhatsABI probe need Node.js (CI uses Node.js 22). WhatsABI is installed with `npm ci` in `examples/resource-intake/whatsabi` before the runner starts. The pinned Hermes compilers provide Linux x86-64, universal macOS, and Windows x86-64 binaries; native Windows/macOS execution is not part of this repository's verification. MemProcFS runs only on Linux x86-64, where it also needs the system `libusb-1.0` library (`sudo apt-get install libusb-1.0-0` on Debian/Ubuntu). Its pinned wheels are installed only on that host, and on other hosts the runner records MemProcFS as `skipped`. @@ -44,6 +44,7 @@ $resourcePython = Join-Path $resourceExamplesDir "venv\Scripts\python.exe" | Keystone 0.9.2 (with Capstone 5.0.9) | x86-64 `push rbp; mov rbp, rsp; mov eax, dword ptr [rbx + rcx*4 + 8]; xor eax, eax; pop rbp; ret` and ARM64 `mov x0, #1; add x1, x2, x3; ldr x0, [x1, #8]; b #0x1010; ret` at base `0x1000` assemble to bytes encoded by hand from the Intel SDM and Arm ARM (`554889e58b448b0831c05dc3`, `200080d24100038b200440f901000014c0035fd6`); Capstone disassembles them back to the same text, which reassembles to the same bytes; `b #0x1010` at `0x2000` becomes the backward branch `04fcff17` | Two short sequences on two ISAs, Linux x86-64 only; see the limits below | | esptool 5.6.0 | A 128-byte ESP32 application image built by hand from the [5.6.0 documented layout](https://raw.githubusercontent.com/espressif/esptool/e970488de2c8f1906ca9b08de681b3f9dc58b2d5/docs/en/advanced-topics/firmware-image-format.rst): entry `0x40080400`, a 16-byte DRAM segment at `0x3ffb0000` and a 32-byte IRAM segment at `0x40080400`, checksum `0xf3` (`0xEF` XOR the segment data) and an appended SHA-256 `f8d0bbc1…c9cb`; `image-info` reports the header, both segments at file offsets `0x18` and `0x30`, and a valid checksum and hash, with no device connected. A synthetic variant with chip ID 9 is detected as ESP32-S3 (header identification only); flipping one data bit gives checksum `0xf2` and hash `b1f33ee1…4147`, both reported as invalid | Offline `image-info` on one ESP32 application layout; no serial port, flashing, or bootloader images; see the limits below | | Z3 (z3-solver 5.3.1.0) | A synthetic 16-bit serial check written as a decompiler would show it (`((x * 0x9E37) ^ (x >> 5)) + rotl(x, 3)` with unsigned arithmetic) and target `0x002a`; brute-forcing all 65,536 inputs in plain Python finds exactly `0x1bb9`, `0x9cff`, and `0xb62c`, and Z3's bit-vector solver, asked again with each found serial blocked, returns the same three and then `unsat` | Python API, one 16-bit constraint; no SMT-LIB files, tactics, timeouts, or `unknown` results; see the limits below | +| WhatsABI 0.30.0 | A hand-built EVM jump table whose PUSH4 immediates are the first 4 bytes of keccak256(`foo()`) and keccak256(`bar(uint256)`), `c2985578` and `0423a132`; `selectorsFromBytecode` returns both. `abiFromBytecode` returns nothing because those PUSH1 targets are not JUMPDESTs. A lone PUSH4 `deadbeef` with no JUMPI returns nothing | One jump table and one negative bytecode; no proxy resolution, signature database, or chain lookup | The branch oracle for `Probe.java` is: diff --git a/examples/resource-intake/verify.py b/examples/resource-intake/verify.py index f5af22f..e954f62 100644 --- a/examples/resource-intake/verify.py +++ b/examples/resource-intake/verify.py @@ -1,4 +1,4 @@ -"""Reproduce twelve narrow resource examples with independent expected outputs.""" +"""Reproduce thirteen narrow resource examples with independent expected outputs.""" import argparse import ctypes.util from datetime import datetime, timezone @@ -530,6 +530,20 @@ def verify_z3(): return {"target": hex(SERIAL_TARGET), "serials": [hex(v) for v in serials], "arithmetic_shift_serials": [hex(v) for v in naive]} +def verify_whatsabi(): + root = SOURCE / "whatsabi" + if not (root / "node_modules" / "@shazow" / "whatsabi").is_dir(): + raise SystemExit(f'Missing WhatsABI install. From {root} run `npm ci`.') + completed = subprocess.run( + ["node", "probe.mjs"], cwd=root, text=True, capture_output=True, check=True, + ) + report = json.loads(completed.stdout) + assert report["selectors"] == ["0xc2985578", "0x0423a132"], report["selectors"] + assert report["abi"] == [] + assert report["lone_push4"] == [] + return report + + def verify(work, jar, cfr_jar=None): for package, expected in required_packages().items(): try: @@ -617,6 +631,7 @@ def verify(work, jar, cfr_jar=None): boofuzz_summary = verify_boofuzz(work) esp_digest = verify_esptool(work) z3_summary = verify_z3() + whatsabi_summary = verify_whatsabi() keystone_result = {"name": "Keystone", "version": "0.9.2", "result": "skipped", "scope": "This check runs on Linux x86-64 only"} if keystone_host(): verify_keystone() @@ -643,8 +658,9 @@ def verify(work, jar, cfr_jar=None): keystone_result, {"name": "esptool", "version": "5.6.0", "result": "passed", "scope": "Offline image-info on a synthetic ESP32 image: header, segments, checksum and SHA-256; chip ID 9 is auto-detected as ESP32-S3; checksum/hash mismatches exit 0, a truncated segment exits 2, and --chip overrides the header chip ID without a warning while the checksum and hash stay valid"}, {"name": "Z3", "version": "5.3.1.0", "result": "passed", "scope": "Synthetic 16-bit serial check: blocking-clause enumeration finds exactly the three serials a brute-force search finds; an arithmetic >> in place of LShR finds only the one with the top bit clear; model_completion adds a default value to the model"}, + {"name": "WhatsABI", "version": "0.30.0", "result": "passed", "scope": "Hand-built EVM jump table: selectorsFromBytecode returns keccak256 prefixes of foo() and bar(uint256); abiFromBytecode is empty because the targets are not JUMPDESTs; a PUSH4 with no JUMPI is ignored"}, ], - "inputs": [{"path": name, "sha256": sha256(SOURCE / name)} for name in ("BranchDemo.java", "Probe.java", "Shapes.java", "SealedProbe.java", "hbc_fixture.js", "malduck_modules/duckcfg/__init__.py", "malduck_modules/duckcfg/duckcfg.yar", "memprocfs_probe.py", "verify.py", "requirements.txt")], + "inputs": [{"path": name, "sha256": sha256(SOURCE / name)} for name in ("BranchDemo.java", "Probe.java", "Shapes.java", "SealedProbe.java", "hbc_fixture.js", "malduck_modules/duckcfg/__init__.py", "malduck_modules/duckcfg/duckcfg.yar", "memprocfs_probe.py", "whatsabi/probe.mjs", "whatsabi/package.json", "whatsabi/package-lock.json", "verify.py", "requirements.txt")], "golden_hex": GOLDEN.hex(), "vineflower_artifact": {"url": JAR_URL, "sha256": JAR_SHA256}, "cfr": cfr_summary, @@ -658,6 +674,7 @@ def verify(work, jar, cfr_jar=None): "keystone": {"base": hex(ASM_BASE), "x64": {"source": X64_SOURCE, "bytes": X64_BYTES}, "arm64": {"source": A64_SOURCE, "bytes": A64_BYTES, "backward_branch_at_0x2000": A64_BACKWARD_BRANCH}}, "z3": z3_summary, + "whatsabi": whatsabi_summary, "esptool": {"image_sha256": esp_digest, "entry": hex(ESP_ENTRY), "checksum": hex(ESP_CHECKSUM), "validation_hash": ESP_DIGEST, "corrupt_checksum": hex(ESP_CORRUPT_CHECKSUM), "corrupt_validation_hash": ESP_CORRUPT_DIGEST}, } diff --git a/examples/resource-intake/whatsabi/.gitignore b/examples/resource-intake/whatsabi/.gitignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/examples/resource-intake/whatsabi/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/examples/resource-intake/whatsabi/package-lock.json b/examples/resource-intake/whatsabi/package-lock.json new file mode 100644 index 0000000..0732111 --- /dev/null +++ b/examples/resource-intake/whatsabi/package-lock.json @@ -0,0 +1,229 @@ +{ + "name": "whatsabi-example", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "whatsabi-example", + "dependencies": { + "@shazow/whatsabi": "0.30.0" + } + }, + "node_modules/@adraffy/ens-normalize.ts": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize.ts/-/ens-normalize.ts-1.0.1.tgz", + "integrity": "sha512-7wvZTCkt4A/beL2KqvUVBftZvyugvqANY74YFkTOLwX4JtsgIBOMGogItvGrd+yOg2ctDkvrZ6+HV0WtsZ6Q9g==", + "license": "MIT" + }, + "node_modules/@noble/ciphers": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-2.4.0.tgz", + "integrity": "sha512-AnjFn0Jv92laAkvMrghlFZq4qQCIN/4DxFV/eooqtC2YTjB7kBeLMS2T9KJX4Dn+ZVXLOwK0lSgqDtx9gvxtiw==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/curves": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-2.4.0.tgz", + "integrity": "sha512-P4/62zrgfH33CneE3Dn4WhJVA22YUU0eR51wKIan4NVRvwsA0YnPTwWGpNbpuacSujmSFLvyzpyuR30+fbq2Ew==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "2.4.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.4.0.tgz", + "integrity": "sha512-X5XaVWZIBCT7HHZGm5I7ZQXDwLG+bGXuSrMQAW+7Zvl87h1kmc1ZB1VSRJcpUfoUrGQp4Fkoxm5kZ+Ms+aW+eA==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/post-quantum": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@noble/post-quantum/-/post-quantum-0.6.1.tgz", + "integrity": "sha512-+pormrDZwjRw05U8ADK4JpHejo87+gBd+muRBB/ozztH5yhDLMDF4jHQWN3NQQAsu1zBNPWTG0ZwVI0CR29H0A==", + "license": "MIT", + "dependencies": { + "@noble/ciphers": "~2.2.0", + "@noble/curves": "~2.2.0", + "@noble/hashes": "~2.2.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/post-quantum/node_modules/@noble/ciphers": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-2.2.0.tgz", + "integrity": "sha512-Z6pjIZ/8IJcCGzb2S/0Px5J81yij85xASuk1teLNeg75bfT07MV3a/O2Mtn1I2se43k3lkVEcFaR10N4cgQcZA==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/post-quantum/node_modules/@noble/curves": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-2.2.0.tgz", + "integrity": "sha512-T/BoHgFXirb0ENSPBquzX0rcjXeM6Lo892a2jlYJkqk83LqZx0l1Of7DzlKJ6jkpvMrkHSnAcgb5JegL8SeIkQ==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "2.2.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/post-quantum/node_modules/@noble/hashes": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.2.0.tgz", + "integrity": "sha512-IYqDGiTXab6FniAgnSdZwgWbomxpy9FtYvLKs7wCUs2a8RkITG+DFGO1DM9cr+E3/RgADRpFjrKVaJ1z6sjtEg==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/base": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-2.4.0.tgz", + "integrity": "sha512-thZ1TuJwFwBblOhgsjDKvvGirBxNp+wSvY/DR6tJBJOTDhdAAcHJ8Vbr2eFnqaxeca4+t0i9KBf+uHYGWwZORg==", + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-2.4.0.tgz", + "integrity": "sha512-i3DS0CptAocyvqE4n3SUkpzeQK4vJMFwWLofTwRiiKo2aWojBOfyMCgfKw9HVpO6fSY5AK86sHS/Uzn8kK9Few==", + "license": "MIT", + "dependencies": { + "@noble/curves": "2.4.0", + "@noble/hashes": "2.4.0", + "@scure/base": "2.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip39": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-2.4.0.tgz", + "integrity": "sha512-82dxFbZUYboyOf0AXiydsQrFQ5Q4h9mX+O2UkE91ROYmsc0BKMGZLwDmy96Jpa2+vrtoxomjUhy1RPIgH/r2nA==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "2.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@shazow/whatsabi": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/@shazow/whatsabi/-/whatsabi-0.30.0.tgz", + "integrity": "sha512-2V6s8TZucnEjs2SHAhtsB/Fpji3GNctCC6hIyhyDJfPFZ/tQJ/rIWd1AfhN6LxYNx9uzRUQSwFW4cp4kkNK8Mg==", + "license": "MIT", + "dependencies": { + "ox": "^1.8.8" + }, + "engines": { + "node": ">=20.19.0" + } + }, + "node_modules/abitype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.3.0.tgz", + "integrity": "sha512-fk6Te+bojIFrMvMZrnOO+SxCB+RUksTGOzq/60ZRvs1L+BVzvi2bqt9L3W/17ZLdZsyM1FuYf65P5nlmoiH1Bg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/wevm" + }, + "peerDependencies": { + "typescript": ">=5.0.4", + "zod": "^3.22.0 || ^4.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + }, + "zod": { + "optional": true + } + } + }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" + }, + "node_modules/ox": { + "version": "1.8.21", + "resolved": "https://registry.npmjs.org/ox/-/ox-1.8.21.tgz", + "integrity": "sha512-mPbCARuTYfNHPMynzFMekICzp5AJUnz6j8Db1qpv90Pi/Prt02FRvFR2sOlMzG7v4qWB12KqI750gRoyZnWG6g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "license": "MIT", + "dependencies": { + "@adraffy/ens-normalize.ts": "^1.0.0", + "@noble/ciphers": "^2.2.0", + "@noble/curves": "^2.2.0", + "@noble/hashes": "^2.2.0", + "@noble/post-quantum": "^0.6.1", + "@scure/bip32": "^2.0.0", + "@scure/bip39": "^2.0.0", + "abitype": "^1.3.0", + "eventemitter3": "5.0.1", + "zod": "^4.4.3" + }, + "peerDependencies": { + "typescript": ">=5.4.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/zod": { + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/examples/resource-intake/whatsabi/package.json b/examples/resource-intake/whatsabi/package.json new file mode 100644 index 0000000..042b796 --- /dev/null +++ b/examples/resource-intake/whatsabi/package.json @@ -0,0 +1,8 @@ +{ + "name": "whatsabi-example", + "private": true, + "type": "module", + "dependencies": { + "@shazow/whatsabi": "0.30.0" + } +} diff --git a/examples/resource-intake/whatsabi/probe.mjs b/examples/resource-intake/whatsabi/probe.mjs new file mode 100644 index 0000000..8eda934 --- /dev/null +++ b/examples/resource-intake/whatsabi/probe.mjs @@ -0,0 +1,28 @@ +import { whatsabi } from "@shazow/whatsabi"; + +// Hand-built jump table. Selectors are keccak256("foo()") and keccak256("bar(uint256)"), first 4 bytes. +// The PUSH1 targets are not JUMPDESTs, so this is selector recovery only. +const dispatcher = + "0x63c29855788114600e57630423a1328114601657600080fd5b5b"; +// PUSH4 that is not followed by the JUMPI table pattern. +const lone = "0x63deadbeef00"; + +const selectors = whatsabi.selectorsFromBytecode(dispatcher); +const abi = whatsabi.abiFromBytecode(dispatcher); +const loneSelectors = whatsabi.selectorsFromBytecode(lone); + +if (JSON.stringify(selectors) !== JSON.stringify(["0xc2985578", "0x0423a132"])) { + throw new Error("dispatcher selectors " + JSON.stringify(selectors)); +} +if (abi.length !== 0) { + throw new Error("expected no ABI without valid JUMPDESTs " + JSON.stringify(abi)); +} +if (loneSelectors.length !== 0) { + throw new Error("lone PUSH4 was treated as a selector " + JSON.stringify(loneSelectors)); +} + +process.stdout.write(JSON.stringify({ + selectors, + abi, + lone_push4: loneSelectors, +}) + "\n"); From 2f7320a2aea48aafa24f7b7e0ffb56c5bffb2203 Mon Sep 17 00:00:00 2001 From: Taksh Date: Wed, 25 Nov 2026 08:44:44 +0530 Subject: [PATCH 03/11] Verify LIEF 0.16.6 against a hand-built ELF64 --- README.md | 2 +- examples/resource-intake/README.md | 7 +++- examples/resource-intake/requirements.txt | 1 + examples/resource-intake/verify.py | 40 +++++++++++++++++++++-- 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ae2ad6d..44e6ae6 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Find a tool by the work you need to do. Each entry describes its purpose; commer - [Detect It Easy](https://github.com/horsicq/Detect-It-Easy) - Identifies executable formats, compilers, packers, and other file characteristics. - [FLOSS](https://github.com/mandiant/flare-floss) - Recovers obfuscated strings, including strings constructed on the stack. - [hexvero](https://github.com/maximilianfeix/hexvero) - Statically triages Electron archives and JavaScript bundles for IPC channels, preload bridges, and window settings, plus ELF/Mach-O/PE imports and hardening; its CLI, MCP server, and local web UI require Node.js 22.12+, and pattern-based JavaScript analysis can miss indirect code. -- [LIEF](https://github.com/lief-project/LIEF) - Parses and modifies executable formats such as PE, ELF, and Mach-O from code. +- [LIEF](https://github.com/lief-project/LIEF) - Parses and modifies executable formats such as PE, ELF, and Mach-O from code; a truncated ELF can still come back as a binary with zeroed header fields. - [Malcat](https://malcat.fr/) - Hex editor and disassembler for triaging unknown files, with 50+ format parsers, embedded-file extraction, YARA scanning, and Python scripting. **Commercial**, with a free Lite edition for non-professional use. - [PE-bear](https://github.com/hasherezade/pe-bear) - Graphical PE viewer and editor for a quick first look at headers, sections, imports, and resources, including malformed files. - [pestudio](https://www.winitor.com/) - Flags suspicious imports, strings, resources, and other indicators in Windows executables for initial assessment. **Commercial**, with a free basic edition for private use. diff --git a/examples/resource-intake/README.md b/examples/resource-intake/README.md index 713e0e7..6cf8584 100644 --- a/examples/resource-intake/README.md +++ b/examples/resource-intake/README.md @@ -1,6 +1,6 @@ # Bounded resource examples -These self-authored fixtures demonstrate Construct, Scapy, YARA-X, Vineflower, CFR, Malduck, hermes-dec, MemProcFS, boofuzz, Keystone, esptool, and Z3 in CI, plus a local PyLingual check. They are small selection examples, not upstream test suites or evidence of full platform/version support. +These self-authored fixtures demonstrate Construct, Scapy, YARA-X, Vineflower, CFR, Malduck, hermes-dec, MemProcFS, boofuzz, Keystone, esptool, Z3, and LIEF in CI, plus a local PyLingual check. They are small selection examples, not upstream test suites or evidence of full platform/version support. Use Python 3.11 with `venv`/`pip` support, JDK 17, Node.js, and an Internet connection for the pinned packages, JAR, and Hermes compilers. From the repository root: @@ -44,6 +44,7 @@ $resourcePython = Join-Path $resourceExamplesDir "venv\Scripts\python.exe" | Keystone 0.9.2 (with Capstone 5.0.9) | x86-64 `push rbp; mov rbp, rsp; mov eax, dword ptr [rbx + rcx*4 + 8]; xor eax, eax; pop rbp; ret` and ARM64 `mov x0, #1; add x1, x2, x3; ldr x0, [x1, #8]; b #0x1010; ret` at base `0x1000` assemble to bytes encoded by hand from the Intel SDM and Arm ARM (`554889e58b448b0831c05dc3`, `200080d24100038b200440f901000014c0035fd6`); Capstone disassembles them back to the same text, which reassembles to the same bytes; `b #0x1010` at `0x2000` becomes the backward branch `04fcff17` | Two short sequences on two ISAs, Linux x86-64 only; see the limits below | | esptool 5.6.0 | A 128-byte ESP32 application image built by hand from the [5.6.0 documented layout](https://raw.githubusercontent.com/espressif/esptool/e970488de2c8f1906ca9b08de681b3f9dc58b2d5/docs/en/advanced-topics/firmware-image-format.rst): entry `0x40080400`, a 16-byte DRAM segment at `0x3ffb0000` and a 32-byte IRAM segment at `0x40080400`, checksum `0xf3` (`0xEF` XOR the segment data) and an appended SHA-256 `f8d0bbc1…c9cb`; `image-info` reports the header, both segments at file offsets `0x18` and `0x30`, and a valid checksum and hash, with no device connected. A synthetic variant with chip ID 9 is detected as ESP32-S3 (header identification only); flipping one data bit gives checksum `0xf2` and hash `b1f33ee1…4147`, both reported as invalid | Offline `image-info` on one ESP32 application layout; no serial port, flashing, or bootloader images; see the limits below | | Z3 (z3-solver 5.3.1.0) | A synthetic 16-bit serial check written as a decompiler would show it (`((x * 0x9E37) ^ (x >> 5)) + rotl(x, 3)` with unsigned arithmetic) and target `0x002a`; brute-forcing all 65,536 inputs in plain Python finds exactly `0x1bb9`, `0x9cff`, and `0xb62c`, and Z3's bit-vector solver, asked again with each found serial blocked, returns the same three and then `unsat` | Python API, one 16-bit constraint; no SMT-LIB files, tactics, timeouts, or `unknown` results; see the limits below | +| LIEF 0.16.6 | A 120-byte ELF64 executable built with `struct`: machine `EM_X86_64`, type `EXEC`, entry `0x401000`, one `PT_LOAD` at that page with flags read and execute, and no section headers | One ELF64 image; no relocation, symbols, or other formats; see the limit below | The branch oracle for `Probe.java` is: @@ -87,6 +88,10 @@ The Z3 check also records two limits, both described in the [5.3.1 Python API](h - `>>` on a bit-vector is an arithmetic (signed) shift; C's unsigned `>>` is `LShR`. Written with `>>`, the same check returns only `0x1bb9`, silently missing the two serials whose top bit is set, without an error. The two shifts agree whenever the top bit is clear. - `model.eval(y, model_completion=True)` gives an unconstrained variable the value 0 and adds it to the model, so afterwards `model[y]` is 0 and `model.decls()` lists `y` as if the solver had chosen it. +The LIEF check also records one limit: + +- A 20-byte prefix of the same ELF still parses. The result is not `None`: the entry point is 0 and there are no segments. A wrong magic (`MZ`) is the case that returns `None`. + Without `-dtb`, MemProcFS rejects a raw image that contains no identifiable operating system (`Unable to locate valid DTB`). The Linux `memprocfs` wheel does not include `leechcore.so`; the runner uses the one from `leechcorepyc` by starting the probe with `LD_LIBRARY_PATH` pointing at its directory. The [dated local result](verified.json) records host/tool versions, input hashes, artifact digests, and the tested scope; it was produced in a Linux x86_64 container. CI repeats the examples and uploads current results through the [resource-example workflow](../../.github/workflows/resource-examples.yml). The current job uses Linux x86-64, Python 3.11, Java 17, Node.js 22, and `libusb-1.0`; it makes no Windows, macOS, hardware, or other-version claim. diff --git a/examples/resource-intake/requirements.txt b/examples/resource-intake/requirements.txt index 7c33a88..b47512f 100644 --- a/examples/resource-intake/requirements.txt +++ b/examples/resource-intake/requirements.txt @@ -10,3 +10,4 @@ keystone-engine==0.9.2; sys_platform == "linux" and platform_machine == "x86_64" capstone==5.0.9; sys_platform == "linux" and platform_machine == "x86_64" esptool==5.6.0 z3-solver==5.3.1.0 +lief==0.16.6 diff --git a/examples/resource-intake/verify.py b/examples/resource-intake/verify.py index f5af22f..e242800 100644 --- a/examples/resource-intake/verify.py +++ b/examples/resource-intake/verify.py @@ -1,4 +1,4 @@ -"""Reproduce twelve narrow resource examples with independent expected outputs.""" +"""Reproduce thirteen narrow resource examples with independent expected outputs.""" import argparse import ctypes.util from datetime import datetime, timezone @@ -314,7 +314,7 @@ def keystone_host(): def required_packages(): - packages = {"construct": "2.10.70", "scapy": "2.8.0", "yara-x": "1.21.0", "hermes-dec": "0.1.8", "malduck": "4.4.1", "boofuzz": "0.4.2", "esptool": "5.6.0", "z3-solver": "5.3.1.0"} + packages = {"construct": "2.10.70", "scapy": "2.8.0", "yara-x": "1.21.0", "hermes-dec": "0.1.8", "malduck": "4.4.1", "boofuzz": "0.4.2", "esptool": "5.6.0", "z3-solver": "5.3.1.0", "lief": "0.16.6"} if memprocfs_host(): packages.update(MEMPROCFS_PACKAGES) if keystone_host(): @@ -530,6 +530,39 @@ def verify_z3(): return {"target": hex(SERIAL_TARGET), "serials": [hex(v) for v in serials], "arithmetic_shift_serials": [hex(v) for v in naive]} +def elf64_exec(entry=0x401000): + """One LOAD segment, no section headers. The entry sits on the same page as the file base.""" + filesz = 64 + 56 + header = struct.pack( + "<16sHHIQQQIHHHHHH", + b"\x7fELF" + bytes([2, 1, 1]) + b"\x00" * 9, + 2, 62, 1, entry, 64, 0, 0, + 64, 56, 1, 64, 0, 0, + ) + vaddr = entry & ~0xFFF + program = struct.pack("> in place of LShR finds only the one with the top bit clear; model_completion adds a default value to the model"}, + {"name": "LIEF", "version": "0.16.6", "result": "passed", "scope": "Hand-built ELF64 EXEC with one LOAD segment and no section headers; wrong magic returns None; a 20-byte prefix still returns a binary with entry 0 and no segments"}, ], "inputs": [{"path": name, "sha256": sha256(SOURCE / name)} for name in ("BranchDemo.java", "Probe.java", "Shapes.java", "SealedProbe.java", "hbc_fixture.js", "malduck_modules/duckcfg/__init__.py", "malduck_modules/duckcfg/duckcfg.yar", "memprocfs_probe.py", "verify.py", "requirements.txt")], "golden_hex": GOLDEN.hex(), @@ -658,6 +693,7 @@ def verify(work, jar, cfr_jar=None): "keystone": {"base": hex(ASM_BASE), "x64": {"source": X64_SOURCE, "bytes": X64_BYTES}, "arm64": {"source": A64_SOURCE, "bytes": A64_BYTES, "backward_branch_at_0x2000": A64_BACKWARD_BRANCH}}, "z3": z3_summary, + "lief": lief_summary, "esptool": {"image_sha256": esp_digest, "entry": hex(ESP_ENTRY), "checksum": hex(ESP_CHECKSUM), "validation_hash": ESP_DIGEST, "corrupt_checksum": hex(ESP_CORRUPT_CHECKSUM), "corrupt_validation_hash": ESP_CORRUPT_DIGEST}, } From 7bc85406150261065a10066a714140ea6d59f2e2 Mon Sep 17 00:00:00 2001 From: Taksh Date: Wed, 25 Nov 2026 08:45:29 +0530 Subject: [PATCH 04/11] Verify unblob 26.6.4 ZIP chunk bounds on a padded archive --- README.md | 2 +- examples/resource-intake/README.md | 7 +++- examples/resource-intake/requirements.txt | 1 + examples/resource-intake/verify.py | 49 ++++++++++++++++++++++- 4 files changed, 55 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ae2ad6d..d694704 100644 --- a/README.md +++ b/README.md @@ -259,7 +259,7 @@ Run samples only in isolated, disposable environments, and follow your organizat - [ripcord](https://github.com/DavidClawson/ripcord) - Ghidra-based firmware-analysis pipeline producing queryable Parquet tables for DuckDB; requires Ghidra 11.2+ with PyGhidra and Python 3.11+, with optional simulation tooling. - [sigrok](https://github.com/sigrokproject) - Signal analysis tools and protocol decoders for logic analyzers and related hardware. - [UEFITool](https://github.com/LongSoft/UEFITool) - Parses UEFI firmware structures and extracts or replaces modules. -- [unblob](https://github.com/onekey-sec/unblob) - Extracts nested archives, compressed data, and filesystem images from firmware and other files. +- [unblob](https://github.com/onekey-sec/unblob) - Extracts nested archives, compressed data, and filesystem images from firmware and other files; a ZIP handler needs the chunk start at the local header, not merely an end-of-central-directory record later in the file. - [usb-rea](https://github.com/emirmrkaljevic/usb-rea) - Infers USB protocol fields, counters, checksums, and multi-packet commands from captures of labelled actions, with frame-number evidence, and generates pyusb driver code and Wireshark Lua dissectors; requires Python 3.10+, with usbmon plus dumpcap/tshark on Linux or USBPcap on Windows for capture, and remains alpha without physical-device validation. ## File formats diff --git a/examples/resource-intake/README.md b/examples/resource-intake/README.md index 713e0e7..d473946 100644 --- a/examples/resource-intake/README.md +++ b/examples/resource-intake/README.md @@ -1,6 +1,6 @@ # Bounded resource examples -These self-authored fixtures demonstrate Construct, Scapy, YARA-X, Vineflower, CFR, Malduck, hermes-dec, MemProcFS, boofuzz, Keystone, esptool, and Z3 in CI, plus a local PyLingual check. They are small selection examples, not upstream test suites or evidence of full platform/version support. +These self-authored fixtures demonstrate Construct, Scapy, YARA-X, Vineflower, CFR, Malduck, hermes-dec, MemProcFS, boofuzz, Keystone, esptool, Z3, and unblob in CI, plus a local PyLingual check. They are small selection examples, not upstream test suites or evidence of full platform/version support. Use Python 3.11 with `venv`/`pip` support, JDK 17, Node.js, and an Internet connection for the pinned packages, JAR, and Hermes compilers. From the repository root: @@ -44,6 +44,7 @@ $resourcePython = Join-Path $resourceExamplesDir "venv\Scripts\python.exe" | Keystone 0.9.2 (with Capstone 5.0.9) | x86-64 `push rbp; mov rbp, rsp; mov eax, dword ptr [rbx + rcx*4 + 8]; xor eax, eax; pop rbp; ret` and ARM64 `mov x0, #1; add x1, x2, x3; ldr x0, [x1, #8]; b #0x1010; ret` at base `0x1000` assemble to bytes encoded by hand from the Intel SDM and Arm ARM (`554889e58b448b0831c05dc3`, `200080d24100038b200440f901000014c0035fd6`); Capstone disassembles them back to the same text, which reassembles to the same bytes; `b #0x1010` at `0x2000` becomes the backward branch `04fcff17` | Two short sequences on two ISAs, Linux x86-64 only; see the limits below | | esptool 5.6.0 | A 128-byte ESP32 application image built by hand from the [5.6.0 documented layout](https://raw.githubusercontent.com/espressif/esptool/e970488de2c8f1906ca9b08de681b3f9dc58b2d5/docs/en/advanced-topics/firmware-image-format.rst): entry `0x40080400`, a 16-byte DRAM segment at `0x3ffb0000` and a 32-byte IRAM segment at `0x40080400`, checksum `0xf3` (`0xEF` XOR the segment data) and an appended SHA-256 `f8d0bbc1…c9cb`; `image-info` reports the header, both segments at file offsets `0x18` and `0x30`, and a valid checksum and hash, with no device connected. A synthetic variant with chip ID 9 is detected as ESP32-S3 (header identification only); flipping one data bit gives checksum `0xf2` and hash `b1f33ee1…4147`, both reported as invalid | Offline `image-info` on one ESP32 application layout; no serial port, flashing, or bootloader images; see the limits below | | Z3 (z3-solver 5.3.1.0) | A synthetic 16-bit serial check written as a decompiler would show it (`((x * 0x9E37) ^ (x >> 5)) + rotl(x, 3)` with unsigned arithmetic) and target `0x002a`; brute-forcing all 65,536 inputs in plain Python finds exactly `0x1bb9`, `0x9cff`, and `0xb62c`, and Z3's bit-vector solver, asked again with each found serial blocked, returns the same three and then `unsat` | Python API, one 16-bit constraint; no SMT-LIB files, tactics, timeouts, or `unknown` results; see the limits below | +| unblob 26.6.4 | A ZIP written by the stdlib, holding `probe.txt` / `UNBLOB-PROBE-1`, placed 40 bytes into a larger blob; `ZIPHandler.calculate_chunk` from that offset returns exactly the ZIP bytes | One stored ZIP; no nested firmware or external extractors; see the limit below | The branch oracle for `Probe.java` is: @@ -87,6 +88,10 @@ The Z3 check also records two limits, both described in the [5.3.1 Python API](h - `>>` on a bit-vector is an arithmetic (signed) shift; C's unsigned `>>` is `LShR`. Written with `>>`, the same check returns only `0x1bb9`, silently missing the two serials whose top bit is set, without an error. The two shifts agree whenever the top bit is clear. - `model.eval(y, model_completion=True)` gives an unconstrained variable the value 0 and adds it to the model, so afterwards `model[y]` is 0 and `model.decls()` lists `y` as if the solver had chosen it. +The unblob check also records one limit: + +- `ZIPHandler.calculate_chunk` rejects the same blob when the start offset is 0, before the local file header, even though the end-of-central-directory record is present. The central-directory offset is relative to the real start of the ZIP. + Without `-dtb`, MemProcFS rejects a raw image that contains no identifiable operating system (`Unable to locate valid DTB`). The Linux `memprocfs` wheel does not include `leechcore.so`; the runner uses the one from `leechcorepyc` by starting the probe with `LD_LIBRARY_PATH` pointing at its directory. The [dated local result](verified.json) records host/tool versions, input hashes, artifact digests, and the tested scope; it was produced in a Linux x86_64 container. CI repeats the examples and uploads current results through the [resource-example workflow](../../.github/workflows/resource-examples.yml). The current job uses Linux x86-64, Python 3.11, Java 17, Node.js 22, and `libusb-1.0`; it makes no Windows, macOS, hardware, or other-version claim. diff --git a/examples/resource-intake/requirements.txt b/examples/resource-intake/requirements.txt index 7c33a88..b537416 100644 --- a/examples/resource-intake/requirements.txt +++ b/examples/resource-intake/requirements.txt @@ -10,3 +10,4 @@ keystone-engine==0.9.2; sys_platform == "linux" and platform_machine == "x86_64" capstone==5.0.9; sys_platform == "linux" and platform_machine == "x86_64" esptool==5.6.0 z3-solver==5.3.1.0 +unblob==26.6.4 diff --git a/examples/resource-intake/verify.py b/examples/resource-intake/verify.py index f5af22f..5b6030d 100644 --- a/examples/resource-intake/verify.py +++ b/examples/resource-intake/verify.py @@ -1,4 +1,4 @@ -"""Reproduce twelve narrow resource examples with independent expected outputs.""" +"""Reproduce thirteen narrow resource examples with independent expected outputs.""" import argparse import ctypes.util from datetime import datetime, timezone @@ -314,7 +314,7 @@ def keystone_host(): def required_packages(): - packages = {"construct": "2.10.70", "scapy": "2.8.0", "yara-x": "1.21.0", "hermes-dec": "0.1.8", "malduck": "4.4.1", "boofuzz": "0.4.2", "esptool": "5.6.0", "z3-solver": "5.3.1.0"} + packages = {"construct": "2.10.70", "scapy": "2.8.0", "yara-x": "1.21.0", "hermes-dec": "0.1.8", "malduck": "4.4.1", "boofuzz": "0.4.2", "esptool": "5.6.0", "z3-solver": "5.3.1.0", "unblob": "26.6.4"} if memprocfs_host(): packages.update(MEMPROCFS_PACKAGES) if keystone_host(): @@ -530,6 +530,48 @@ def verify_z3(): return {"target": hex(SERIAL_TARGET), "serials": [hex(v) for v in serials], "arithmetic_shift_serials": [hex(v) for v in naive]} +def verify_unblob(work): + import io + import zipfile + from pathlib import Path + + from unblob.file_utils import File, InvalidInputFormat + from unblob.handlers.archive.zip import ZIPHandler + + buffer = io.BytesIO() + with zipfile.ZipFile(buffer, "w") as archive: + archive.writestr("probe.txt", "UNBLOB-PROBE-1") + zip_bytes = buffer.getvalue() + blob = b"\x00" * 40 + zip_bytes + b"\xff" * 8 + path = work / "padded.zip.bin" + path.write_bytes(blob) + handler = ZIPHandler() + with File.from_path(Path(path)) as blob_file: + chunk = handler.calculate_chunk(blob_file, 40) + assert chunk.start_offset == 40 + assert blob[chunk.start_offset:chunk.end_offset] == zip_bytes + + empty = work / "no-eocd.bin" + empty.write_bytes(b"\x00" * 64) + try: + with File.from_path(Path(empty)) as blob_file: + handler.calculate_chunk(blob_file, 0) + except InvalidInputFormat: + pass + else: + raise AssertionError("bytes without an EOCD were accepted") + + # EOCD's offset_of_cd is relative to the real start. Starting earlier rejects the same file. + try: + with File.from_path(Path(path)) as blob_file: + handler.calculate_chunk(blob_file, 0) + except InvalidInputFormat: + pass + else: + raise AssertionError("a ZIP was accepted from before its local header") + return {"zip_sha256": hashlib.sha256(zip_bytes).hexdigest(), "start": 40, "end": chunk.end_offset} + + def verify(work, jar, cfr_jar=None): for package, expected in required_packages().items(): try: @@ -617,6 +659,7 @@ def verify(work, jar, cfr_jar=None): boofuzz_summary = verify_boofuzz(work) esp_digest = verify_esptool(work) z3_summary = verify_z3() + unblob_summary = verify_unblob(work) keystone_result = {"name": "Keystone", "version": "0.9.2", "result": "skipped", "scope": "This check runs on Linux x86-64 only"} if keystone_host(): verify_keystone() @@ -643,6 +686,7 @@ def verify(work, jar, cfr_jar=None): keystone_result, {"name": "esptool", "version": "5.6.0", "result": "passed", "scope": "Offline image-info on a synthetic ESP32 image: header, segments, checksum and SHA-256; chip ID 9 is auto-detected as ESP32-S3; checksum/hash mismatches exit 0, a truncated segment exits 2, and --chip overrides the header chip ID without a warning while the checksum and hash stay valid"}, {"name": "Z3", "version": "5.3.1.0", "result": "passed", "scope": "Synthetic 16-bit serial check: blocking-clause enumeration finds exactly the three serials a brute-force search finds; an arithmetic >> in place of LShR finds only the one with the top bit clear; model_completion adds a default value to the model"}, + {"name": "unblob", "version": "26.6.4", "result": "passed", "scope": "ZIPHandler on a stdlib ZIP after 40 bytes of padding: the chunk is exactly the ZIP; no EOCD raises InvalidInputFormat; the same file is rejected when the start offset is before the local header"}, ], "inputs": [{"path": name, "sha256": sha256(SOURCE / name)} for name in ("BranchDemo.java", "Probe.java", "Shapes.java", "SealedProbe.java", "hbc_fixture.js", "malduck_modules/duckcfg/__init__.py", "malduck_modules/duckcfg/duckcfg.yar", "memprocfs_probe.py", "verify.py", "requirements.txt")], "golden_hex": GOLDEN.hex(), @@ -658,6 +702,7 @@ def verify(work, jar, cfr_jar=None): "keystone": {"base": hex(ASM_BASE), "x64": {"source": X64_SOURCE, "bytes": X64_BYTES}, "arm64": {"source": A64_SOURCE, "bytes": A64_BYTES, "backward_branch_at_0x2000": A64_BACKWARD_BRANCH}}, "z3": z3_summary, + "unblob": unblob_summary, "esptool": {"image_sha256": esp_digest, "entry": hex(ESP_ENTRY), "checksum": hex(ESP_CHECKSUM), "validation_hash": ESP_DIGEST, "corrupt_checksum": hex(ESP_CORRUPT_CHECKSUM), "corrupt_validation_hash": ESP_CORRUPT_DIGEST}, } From dc78a43629b3ed42039bd8d6323df7219e7935a5 Mon Sep 17 00:00:00 2001 From: Taksh Date: Wed, 25 Nov 2026 15:02:01 +0530 Subject: [PATCH 05/11] Record the oletools reproduction scope in the candidate snapshot --- docs/priority-candidates.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/priority-candidates.json b/docs/priority-candidates.json index 86e0f61..fa9fb04 100644 --- a/docs/priority-candidates.json +++ b/docs/priority-candidates.json @@ -214,7 +214,7 @@ "task": "Office, OLE, and RTF analysis", "incremental_value": "Fills the document-input gap: macro extraction, embedded objects, and related document artifacts rather than predominantly PE inputs.", "constraints": "Coverage varies by subtool; XLM workflows have optional dependencies. README news mentions 0.60.3 while the latest GitHub release endpoint returns 0.60.2. Own code uses BSD-style terms, with MIT/third-party exceptions.", - "next_check": "Pin the actual distribution version and verify extraction from a self-authored document.", + "next_check": "VBA, XLM, and Office Open XML extraction remain unchecked.", "sources": [ "https://raw.githubusercontent.com/decalage2/oletools/ec10260989dbc48b9109e3d05d22beee19cf2333/README.md", "https://raw.githubusercontent.com/decalage2/oletools/ec10260989dbc48b9109e3d05d22beee19cf2333/LICENSE.md" @@ -233,7 +233,9 @@ "source_browser_urls": [ "https://github.com/decalage2/oletools/blob/ec10260989dbc48b9109e3d05d22beee19cf2333/README.md", "https://github.com/decalage2/oletools/blob/ec10260989dbc48b9109e3d05d22beee19cf2333/LICENSE.md" - ] + ], + "reproduction": "examples/resource-intake/README.md", + "reproduced_scope": "oletools 0.60.2 RtfObjParser on one synthetic RTF OLE1 Package: filename and payload across clean and obfuscated hex; plain RTF yields no objects; non-OLE1 objdata stays is_ole false" }, { "name": "AssetRipper", @@ -246,7 +248,7 @@ "evidence_type": "documented", "task": "Unity assets and dependencies", "incremental_value": "Complements Cpp2IL/Il2CppDumper code and metadata analysis with asset inspection and export.", - "constraints": "The README claims Unity 3.5.0–6000.4.X, with varying support quality. The GPL-3.0 base and paid Premium features must be distinguished.", + "constraints": "The README claims Unity 3.5.0\u20136000.4.X, with varying support quality. The GPL-3.0 base and paid Premium features must be distinguished.", "next_check": "Export a self-built Unity project and compare assets and references against the original.", "sources": [ "https://raw.githubusercontent.com/AssetRipper/AssetRipper/beeb50ee1c223e856c860caa338e5309404956a3/README.md", From db50905473de583cdf060a6d4e1e7b66ad98dfe2 Mon Sep 17 00:00:00 2001 From: Taksh Date: Wed, 25 Nov 2026 15:02:14 +0530 Subject: [PATCH 06/11] Keep the candidate snapshot encoding unchanged outside oletools --- docs/priority-candidates.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/priority-candidates.json b/docs/priority-candidates.json index fa9fb04..461cce5 100644 --- a/docs/priority-candidates.json +++ b/docs/priority-candidates.json @@ -248,7 +248,7 @@ "evidence_type": "documented", "task": "Unity assets and dependencies", "incremental_value": "Complements Cpp2IL/Il2CppDumper code and metadata analysis with asset inspection and export.", - "constraints": "The README claims Unity 3.5.0\u20136000.4.X, with varying support quality. The GPL-3.0 base and paid Premium features must be distinguished.", + "constraints": "The README claims Unity 3.5.0–6000.4.X, with varying support quality. The GPL-3.0 base and paid Premium features must be distinguished.", "next_check": "Export a self-built Unity project and compare assets and references against the original.", "sources": [ "https://raw.githubusercontent.com/AssetRipper/AssetRipper/beeb50ee1c223e856c860caa338e5309404956a3/README.md", From b08d5098e743b89548ae804c9b0bb5db98d23ccb Mon Sep 17 00:00:00 2001 From: Taksh Date: Wed, 25 Nov 2026 15:02:45 +0530 Subject: [PATCH 07/11] Check the installed WhatsABI version and document npm ci --- examples/resource-intake/README.md | 2 ++ examples/resource-intake/verify.py | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/examples/resource-intake/README.md b/examples/resource-intake/README.md index 9cddc63..770bc43 100644 --- a/examples/resource-intake/README.md +++ b/examples/resource-intake/README.md @@ -8,6 +8,7 @@ Use Python 3.11 with `venv`/`pip` support, JDK 17, Node.js, and an Internet conn resource_examples_dir="$(mktemp -d)" python3.11 -m venv "$resource_examples_dir/venv" "$resource_examples_dir/venv/bin/python" -m pip install -r examples/resource-intake/requirements.txt +npm --prefix examples/resource-intake/whatsabi ci --ignore-scripts "$resource_examples_dir/venv/bin/python" examples/resource-intake/verify.py --output "$resource_examples_dir/results" ``` @@ -27,6 +28,7 @@ New-Item -ItemType Directory -Path $resourceExamplesDir | Out-Null py -3.11 -m venv (Join-Path $resourceExamplesDir "venv") $resourcePython = Join-Path $resourceExamplesDir "venv\Scripts\python.exe" & $resourcePython -m pip install -r examples/resource-intake/requirements.txt +npm --prefix examples/resource-intake/whatsabi ci --ignore-scripts & $resourcePython examples/resource-intake/verify.py --output $resourceExamplesDir ``` diff --git a/examples/resource-intake/verify.py b/examples/resource-intake/verify.py index e954f62..84d824e 100644 --- a/examples/resource-intake/verify.py +++ b/examples/resource-intake/verify.py @@ -532,8 +532,13 @@ def verify_z3(): def verify_whatsabi(): root = SOURCE / "whatsabi" - if not (root / "node_modules" / "@shazow" / "whatsabi").is_dir(): - raise SystemExit(f'Missing WhatsABI install. From {root} run `npm ci`.') + installed_path = root / "node_modules" / "@shazow" / "whatsabi" / "package.json" + if not installed_path.is_file(): + raise SystemExit(f'Missing WhatsABI install. From the repository root run `npm --prefix {root} ci --ignore-scripts`.') + installed = json.loads(installed_path.read_text())["version"] + expected = "0.30.0" + if installed != expected: + raise SystemExit(f"Expected @shazow/whatsabi@{expected}, found {installed}. Reinstall from {root / 'package-lock.json'}.") completed = subprocess.run( ["node", "probe.mjs"], cwd=root, text=True, capture_output=True, check=True, ) @@ -541,6 +546,7 @@ def verify_whatsabi(): assert report["selectors"] == ["0xc2985578", "0x0423a132"], report["selectors"] assert report["abi"] == [] assert report["lone_push4"] == [] + report["version"] = installed return report @@ -658,7 +664,7 @@ def verify(work, jar, cfr_jar=None): keystone_result, {"name": "esptool", "version": "5.6.0", "result": "passed", "scope": "Offline image-info on a synthetic ESP32 image: header, segments, checksum and SHA-256; chip ID 9 is auto-detected as ESP32-S3; checksum/hash mismatches exit 0, a truncated segment exits 2, and --chip overrides the header chip ID without a warning while the checksum and hash stay valid"}, {"name": "Z3", "version": "5.3.1.0", "result": "passed", "scope": "Synthetic 16-bit serial check: blocking-clause enumeration finds exactly the three serials a brute-force search finds; an arithmetic >> in place of LShR finds only the one with the top bit clear; model_completion adds a default value to the model"}, - {"name": "WhatsABI", "version": "0.30.0", "result": "passed", "scope": "Hand-built EVM jump table: selectorsFromBytecode returns keccak256 prefixes of foo() and bar(uint256); abiFromBytecode is empty because the targets are not JUMPDESTs; a PUSH4 with no JUMPI is ignored"}, + {"name": "WhatsABI", "version": whatsabi_summary["version"], "result": "passed", "scope": "Hand-built EVM jump table: selectorsFromBytecode returns keccak256 prefixes of foo() and bar(uint256); abiFromBytecode is empty because the targets are not JUMPDESTs; a PUSH4 with no JUMPI is ignored"}, ], "inputs": [{"path": name, "sha256": sha256(SOURCE / name)} for name in ("BranchDemo.java", "Probe.java", "Shapes.java", "SealedProbe.java", "hbc_fixture.js", "malduck_modules/duckcfg/__init__.py", "malduck_modules/duckcfg/duckcfg.yar", "memprocfs_probe.py", "whatsabi/probe.mjs", "whatsabi/package.json", "whatsabi/package-lock.json", "verify.py", "requirements.txt")], "golden_hex": GOLDEN.hex(), From 1bafe24ed1481a10d029da55f1061aa348bde9f3 Mon Sep 17 00:00:00 2001 From: Taksh Date: Wed, 25 Nov 2026 15:03:05 +0530 Subject: [PATCH 08/11] Assert the LIEF fixture segment is PT_LOAD --- examples/resource-intake/verify.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/resource-intake/verify.py b/examples/resource-intake/verify.py index e242800..4f067da 100644 --- a/examples/resource-intake/verify.py +++ b/examples/resource-intake/verify.py @@ -554,6 +554,7 @@ def verify_lief(): assert binary.header.file_type == lief.ELF.Header.FILE_TYPE.EXEC assert binary.entrypoint == 0x401000 and len(binary.sections) == 0 and len(binary.segments) == 1 segment = binary.segments[0] + assert segment.type == lief.ELF.Segment.TYPE.LOAD assert segment.virtual_address == 0x401000 and int(segment.flags) == 5 # PF_X | PF_R assert lief.parse(raw=b"MZ" + blob[2:]) is None From bca3695d38e0ce46b6233c923a5fc33f60350cbd Mon Sep 17 00:00:00 2001 From: Taksh Date: Wed, 25 Nov 2026 15:03:19 +0530 Subject: [PATCH 09/11] Pin the unblob ZIP fixture timestamp --- examples/resource-intake/verify.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/resource-intake/verify.py b/examples/resource-intake/verify.py index 5b6030d..b2373c4 100644 --- a/examples/resource-intake/verify.py +++ b/examples/resource-intake/verify.py @@ -540,7 +540,8 @@ def verify_unblob(work): buffer = io.BytesIO() with zipfile.ZipFile(buffer, "w") as archive: - archive.writestr("probe.txt", "UNBLOB-PROBE-1") + entry = zipfile.ZipInfo("probe.txt", date_time=(2020, 1, 1, 0, 0, 0)) + archive.writestr(entry, "UNBLOB-PROBE-1") zip_bytes = buffer.getvalue() blob = b"\x00" * 40 + zip_bytes + b"\xff" * 8 path = work / "padded.zip.bin" From ca01c87c3e5805cb81dd10cb3502ba23f0b86ba1 Mon Sep 17 00:00:00 2001 From: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com> Date: Tue, 1 Dec 2026 12:35:32 +0000 Subject: [PATCH 10/11] test: integrate four bounded resource verification cases Combine oletools, WhatsABI, LIEF and unblob with a valid dispatcher, corrupt-ZIP control, host/version checks and consistent evidence notes. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) --- .github/workflows/resource-examples.yml | 3 + README.md | 6 +- docs/catalog-expansion-review.json | 20 +- docs/catalog-expansion-review.md | 6 +- docs/priority-candidates.json | 12 +- docs/priority-candidates.md | 4 +- examples/resource-intake/README.md | 34 ++- examples/resource-intake/requirements.txt | 4 +- examples/resource-intake/verify.py | 173 ++++++++++++- examples/resource-intake/whatsabi/.gitignore | 1 + .../whatsabi/package-lock.json | 229 ++++++++++++++++++ .../resource-intake/whatsabi/package.json | 8 + examples/resource-intake/whatsabi/probe.mjs | 32 +++ tests/test_resource_prerequisites.py | 39 ++- 14 files changed, 519 insertions(+), 52 deletions(-) create mode 100644 examples/resource-intake/whatsabi/.gitignore create mode 100644 examples/resource-intake/whatsabi/package-lock.json create mode 100644 examples/resource-intake/whatsabi/package.json create mode 100644 examples/resource-intake/whatsabi/probe.mjs diff --git a/.github/workflows/resource-examples.yml b/.github/workflows/resource-examples.yml index 497a67b..3222d05 100644 --- a/.github/workflows/resource-examples.yml +++ b/.github/workflows/resource-examples.yml @@ -45,6 +45,9 @@ jobs: run: sudo apt-get install -y --no-install-recommends libusb-1.0-0 - name: Install pinned example dependencies run: python -m pip install -r examples/resource-intake/requirements.txt + - name: Install pinned WhatsABI example + run: npm ci --ignore-scripts + working-directory: examples/resource-intake/whatsabi - name: Reproduce the bounded examples run: python examples/resource-intake/verify.py --output "$RUNNER_TEMP/resource-intake" - name: Upload reproduction results diff --git a/README.md b/README.md index d694704..0a49fb5 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Find a tool by the work you need to do. Each entry describes its purpose; commer - [Detect It Easy](https://github.com/horsicq/Detect-It-Easy) - Identifies executable formats, compilers, packers, and other file characteristics. - [FLOSS](https://github.com/mandiant/flare-floss) - Recovers obfuscated strings, including strings constructed on the stack. - [hexvero](https://github.com/maximilianfeix/hexvero) - Statically triages Electron archives and JavaScript bundles for IPC channels, preload bridges, and window settings, plus ELF/Mach-O/PE imports and hardening; its CLI, MCP server, and local web UI require Node.js 22.12+, and pattern-based JavaScript analysis can miss indirect code. -- [LIEF](https://github.com/lief-project/LIEF) - Parses and modifies executable formats such as PE, ELF, and Mach-O from code. +- [LIEF](https://github.com/lief-project/LIEF) - Parses and modifies executable formats such as PE, ELF, and Mach-O from code; the 0.16.6 bounded example shows that a truncated ELF can return a partial binary object. - [Malcat](https://malcat.fr/) - Hex editor and disassembler for triaging unknown files, with 50+ format parsers, embedded-file extraction, YARA scanning, and Python scripting. **Commercial**, with a free Lite edition for non-professional use. - [PE-bear](https://github.com/hasherezade/pe-bear) - Graphical PE viewer and editor for a quick first look at headers, sections, imports, and resources, including malformed files. - [pestudio](https://www.winitor.com/) - Flags suspicious imports, strings, resources, and other indicators in Windows executables for initial assessment. **Commercial**, with a free basic edition for private use. @@ -216,7 +216,7 @@ Run samples only in isolated, disposable environments, and follow your organizat - [r2flutter](https://github.com/radareorg/r2flutter) - radare2 plugin and CLI for recovering Dart AOT snapshot metadata from Flutter binaries; requires radare2 6.2.2+, primarily targets AArch64, and depends on snapshot layout. - [Redress](https://github.com/goretk/redress) - Recovers compiler metadata, packages, types, and symbols from stripped Go executables; target Go-version compatibility depends on the selected release and GoRE parser. - [reFlutter](https://github.com/Impact-I/reFlutter) - Flutter mobile-analysis framework that instruments matching engine builds and produces method or type information; Android/iOS architecture and engine-version support varies. -- [WhatsABI](https://github.com/shazow/whatsabi) - TypeScript library for inferring Ethereum ABI entries and resolving proxy metadata from bytecode; inferred signatures and types are not original-source recovery. +- [WhatsABI](https://github.com/shazow/whatsabi) - TypeScript library for inferring Ethereum ABI entries and resolving proxy metadata from bytecode; selector candidates can be recovered even when jump targets are malformed, and inferred signatures and types are not original-source recovery. ## Web and protocols @@ -259,7 +259,7 @@ Run samples only in isolated, disposable environments, and follow your organizat - [ripcord](https://github.com/DavidClawson/ripcord) - Ghidra-based firmware-analysis pipeline producing queryable Parquet tables for DuckDB; requires Ghidra 11.2+ with PyGhidra and Python 3.11+, with optional simulation tooling. - [sigrok](https://github.com/sigrokproject) - Signal analysis tools and protocol decoders for logic analyzers and related hardware. - [UEFITool](https://github.com/LongSoft/UEFITool) - Parses UEFI firmware structures and extracts or replaces modules. -- [unblob](https://github.com/onekey-sec/unblob) - Extracts nested archives, compressed data, and filesystem images from firmware and other files; a ZIP handler needs the chunk start at the local header, not merely an end-of-central-directory record later in the file. +- [unblob](https://github.com/onekey-sec/unblob) - Extracts nested archives, compressed data, and filesystem images from firmware and other files. - [usb-rea](https://github.com/emirmrkaljevic/usb-rea) - Infers USB protocol fields, counters, checksums, and multi-packet commands from captures of labelled actions, with frame-number evidence, and generates pyusb driver code and Wireshark Lua dissectors; requires Python 3.10+, with usbmon plus dumpcap/tshark on Linux or USBPcap on Windows for capture, and remains alpha without physical-device validation. ## File formats diff --git a/docs/catalog-expansion-review.json b/docs/catalog-expansion-review.json index d75e3cd..d24d2f0 100644 --- a/docs/catalog-expansion-review.json +++ b/docs/catalog-expansion-review.json @@ -2,8 +2,8 @@ "checked_at": "2026-10-25", "next_review": "2026-11-25", "baseline_main": "6d530add7680a5e45fd56f00712f06c689c82681", - "scope": "51 new documented resources; existing MemProcFS, PyLingual, boofuzz and Keystone descriptions and execution evidence are preserved", - "evidence_boundary": "Primary-source/document walkthroughs; no execution verification is claimed for these 51 records. Existing execution examples remain separately scoped.", + "scope": "51 resources from the original documented expansion; existing MemProcFS, PyLingual, boofuzz and Keystone descriptions and execution evidence are preserved", + "evidence_boundary": "Primary-source/document walkthroughs unless a record explicitly states a bounded reproduction. WhatsABI 0.30.0 now has a focused synthetic-bytecode example; this does not verify the complete resource or other catalog records.", "license_boundary": "API values are metadata, not a complete audit of bundled code, samples, codecs or hardware licenses.", "records": [ { @@ -600,13 +600,13 @@ { "name": "WhatsABI", "url": "https://github.com/shazow/whatsabi", - "description": "TypeScript library for inferring Ethereum ABI entries and resolving proxy metadata from bytecode; inferred signatures and types are not original-source recovery.", - "checked_at": "2026-10-25", - "next_review": "2026-11-25", - "evidence_type": "documented", - "execution_verified": false, + "description": "TypeScript library for inferring Ethereum ABI entries and resolving proxy metadata from bytecode; selector candidates can be recovered even when jump targets are malformed, and inferred signatures and types are not original-source recovery.", + "checked_at": "2026-12-01", + "next_review": "2027-01-01", + "evidence_type": "reproduced", + "execution_verified": true, "task_and_output": "TypeScript library for inferring Ethereum ABI entries and resolving proxy metadata from bytecode", - "constraints": " inferred signatures and types are not original-source recovery.", + "constraints": "Inferred signatures and types are not original-source recovery. The resource-intake example pins 0.30.0: a valid hand-built dispatcher yields the keccak prefixes of foo() and bar(uint256) and two function ABI entries without names or input types. Malformed jump targets still yield selectors but no ABI; a lone PUSH4 without JUMPI is ignored. No proxy resolution, provider, or signature lookup is exercised.", "sources": [ "https://raw.githubusercontent.com/shazow/whatsabi/eefa62383640b9056aade49d1d5ed2206ffcdb3b/README.md" ], @@ -619,7 +619,9 @@ "tag": "v0.30.0", "published_at": "2026-10-19T14:05:54Z", "url": "https://github.com/shazow/whatsabi/releases/tag/v0.30.0" - } + }, + "reproduction": "examples/resource-intake/README.md", + "reproduced_scope": "The resource-intake example pins 0.30.0: a valid hand-built dispatcher yields the keccak prefixes of foo() and bar(uint256) and two function ABI entries without names or input types. Malformed jump targets still yield selectors but no ABI; a lone PUSH4 without JUMPI is ignored. No proxy resolution, provider, or signature lookup is exercised." }, { "name": "Netzob", diff --git a/docs/catalog-expansion-review.md b/docs/catalog-expansion-review.md index f8b7c7b..05640f7 100644 --- a/docs/catalog-expansion-review.md +++ b/docs/catalog-expansion-review.md @@ -2,9 +2,9 @@ Checked on **2026-10-25 UTC**; recheck by **2026-11-25**. This review supports 51 new entries and the specialized section map. [The machine-readable snapshot](catalog-expansion-review.json) records canonical repositories, pinned source commits, source/release dates, and evidence notes. -**Evidence: documented.** These are first-party source/document walkthroughs, not claims that every application, device, target format, or operating system was executed. The task column explains what to inspect or obtain; the constraints column narrows that choice. A working URL alone is not compatibility evidence. +**Evidence: documented unless a row records a bounded reproduction.** The original review used first-party source/document walkthroughs; the WhatsABI row now records its separately scoped 0.30.0 example. Neither establishes that every application, device, target format, or operating system was executed. The task column explains what to inspect or obtain; the constraints column narrows that choice. A working URL alone is not compatibility evidence. -MemProcFS, PyLingual, boofuzz and Keystone were admitted through their focused PRs; this change preserves their descriptions and [bounded examples](../examples/resource-intake/README.md). The existing nine CI examples and local PyLingual check are separate from these 51 documentation reviews. The execution and hardware follow-ups in [issue #6](https://github.com/morluto/awesome-reverse-engineering/issues/6) remain open; this table does not mark them complete. +MemProcFS, PyLingual, boofuzz and Keystone were admitted through their focused PRs; this change preserves their descriptions and [bounded examples](../examples/resource-intake/README.md). The sixteen bounded CI examples and local PyLingual check provide separately scoped execution evidence; the WhatsABI row records its focused follow-up. The execution and hardware follow-ups in [issue #6](https://github.com/morluto/awesome-reverse-engineering/issues/6) remain open; this table does not mark them complete. The earlier inventory said 48, but its diff added 55 top-level resources. Four now come from the focused PRs, leaving 51 new entries here. Existing catalog resources are moved without weakening their descriptions. The previous `diffing-and-analysis-frameworks` anchor is retained. @@ -36,7 +36,7 @@ The earlier inventory said 48, but its diff added 55 top-level resources. Four n | [r2flutter](https://github.com/radareorg/r2flutter) · [source 1](https://raw.githubusercontent.com/radareorg/r2flutter/441d614937c8ada56e4d0c1175050667842c0971/README.md) · [source 2](https://raw.githubusercontent.com/radareorg/r2flutter/441d614937c8ada56e4d0c1175050667842c0971/doc/support.md) | radare2 plugin and CLI for recovering Dart AOT snapshot metadata from Flutter binaries | The support document distinguishes source layout profiles and structural guesses from actual regression coverage. It describes Android and iOS containers; do not restrict it to Android solely on an older review comment. | | [Redress](https://github.com/goretk/redress) · [source 1](https://raw.githubusercontent.com/goretk/redress/198e6dc82f17ca6e9edb80b22a85af17f1a3b031/README.md) | Recovers compiler metadata, packages, types, and symbols from stripped Go executables | The default branch and latest release are different evidence channels. Latest release v1.2.98 was published 2026-10-20; no unsupported mothballed classification is used. | | [reFlutter](https://github.com/Impact-I/reFlutter) · [source 1](https://raw.githubusercontent.com/Impact-I/reFlutter/590b1d2f12a274a249fb84a7fc4e2236fbe4639d/README.md) | Flutter mobile-analysis framework that instruments matching engine builds and produces method or type information | The current source documents Android arm64/arm32/x64 and iOS arm64 with engine/version constraints. That is documentation, not execution of each target. | -| [WhatsABI](https://github.com/shazow/whatsabi) · [source 1](https://raw.githubusercontent.com/shazow/whatsabi/eefa62383640b9056aade49d1d5ed2206ffcdb3b/README.md) | TypeScript library for inferring Ethereum ABI entries and resolving proxy metadata from bytecode | inferred signatures and types are not original-source recovery. | +| [WhatsABI](https://github.com/shazow/whatsabi) · [source 1](https://raw.githubusercontent.com/shazow/whatsabi/eefa62383640b9056aade49d1d5ed2206ffcdb3b/README.md) | TypeScript library for inferring Ethereum ABI entries and resolving proxy metadata from bytecode | **Reproduced (0.30.0; 2026-12-01).** Inferred signatures and types are not original-source recovery. The resource-intake example pins 0.30.0: a valid hand-built dispatcher yields the keccak prefixes of foo() and bar(uint256) and two function ABI entries without names or input types. Malformed jump targets still yield selectors but no ABI; a lone PUSH4 without JUMPI is ignored. No proxy resolution, provider, or signature lookup is exercised. | | [Netzob](https://github.com/netzob/netzob) · [source 1](https://raw.githubusercontent.com/netzob/netzob/088fe769e98e0bfbd3ed99e66b3982446bf8d197/README.rst) | Python protocol-inference library for exploring fields, messages, and state models from captures | README documents Python 3.8+ plus native libpcap/libffi/build dependencies. Old packaged examples are not proof of compatibility with every newer Python. | | [avatar2](https://github.com/avatartwo/avatar2) · [source 1](https://raw.githubusercontent.com/avatartwo/avatar2/56a90cfe738886236dcbc3653756bdbdec6aaf92/README.md) | Coordinates debuggers, emulators, and physical targets for embedded analysis | each endpoint needs its own compatible backend and any associated hardware. | | [ChipWhisperer](https://github.com/newaetech/chipwhisperer) · [source 1](https://raw.githubusercontent.com/newaetech/chipwhisperer/febd64ea455fcc69c869f68d834a4b53ead7f022/README.md) | Hardware and Python tooling for side-channel power analysis and fault-injection experiments | Capture board, target board, firmware and trace-analysis software are separate components; software/source availability does not supply hardware. | diff --git a/docs/priority-candidates.json b/docs/priority-candidates.json index 2d33a30..461cce5 100644 --- a/docs/priority-candidates.json +++ b/docs/priority-candidates.json @@ -208,13 +208,13 @@ "section": "Malware analysis", "description": "Python tools for inspecting Office, OLE, and RTF files and extracting macros, embedded objects, and other document artifacts.", "research_priority": "A0", - "checked_at": "2026-10-13", - "next_review": "2026-11-13", - "evidence_type": "documented", + "checked_at": "2026-11-24", + "next_review": "2026-12-24", + "evidence_type": "reproduced", "task": "Office, OLE, and RTF analysis", "incremental_value": "Fills the document-input gap: macro extraction, embedded objects, and related document artifacts rather than predominantly PE inputs.", "constraints": "Coverage varies by subtool; XLM workflows have optional dependencies. README news mentions 0.60.3 while the latest GitHub release endpoint returns 0.60.2. Own code uses BSD-style terms, with MIT/third-party exceptions.", - "next_check": "Pin the actual distribution version and verify extraction from a self-authored document.", + "next_check": "VBA, XLM, and Office Open XML extraction remain unchecked.", "sources": [ "https://raw.githubusercontent.com/decalage2/oletools/ec10260989dbc48b9109e3d05d22beee19cf2333/README.md", "https://raw.githubusercontent.com/decalage2/oletools/ec10260989dbc48b9109e3d05d22beee19cf2333/LICENSE.md" @@ -233,7 +233,9 @@ "source_browser_urls": [ "https://github.com/decalage2/oletools/blob/ec10260989dbc48b9109e3d05d22beee19cf2333/README.md", "https://github.com/decalage2/oletools/blob/ec10260989dbc48b9109e3d05d22beee19cf2333/LICENSE.md" - ] + ], + "reproduction": "examples/resource-intake/README.md", + "reproduced_scope": "oletools 0.60.2 RtfObjParser on one synthetic RTF OLE1 Package: filename and payload across clean and obfuscated hex; plain RTF yields no objects; non-OLE1 objdata stays is_ole false" }, { "name": "AssetRipper", diff --git a/docs/priority-candidates.md b/docs/priority-candidates.md index fe01d26..e28dfe3 100644 --- a/docs/priority-candidates.md +++ b/docs/priority-candidates.md @@ -4,7 +4,7 @@ Reviewed on **2026-10-13 UTC**, following [research issue #6](https://github.com The review used three passes: canonical repositories and pinned source snapshots; task/claim/host/target/license scrutiny; then the final catalog diff, examples, and link checks. All 22 GitHub repositories were rechecked as unarchived and enabled. JEB was reviewed through the vendor product page, manual, and changelog. -**Reproduced** means only the bounded case described in [the examples](../examples/resource-intake/README.md), not the full upstream support matrix. Four resources have this status. The other nineteen are **documented**; hardware, iOS-device, commercial-tool, and browser-agent behavior was not executed. Recent commits, HTTP success, and SPDX metadata alone do not establish quality or compatibility. +**Reproduced** means only the bounded case described in [the examples](../examples/resource-intake/README.md), not the full upstream support matrix. Five resources have this status. The other eighteen are **documented**; hardware, iOS-device, commercial-tool, and browser-agent behavior was not executed. Recent commits, HTTP success, and SPDX metadata alone do not establish quality or compatibility. The [machine-readable snapshot](priority-candidates.json) retains source revisions, activity/release observations, constraints, evidence scope, and a next review date of **2026-11-13**. GitHub license metadata is preserved as an observation, not a complete license audit. The earlier comparison in `list-review.md` remains a historical snapshot. @@ -18,7 +18,7 @@ The [machine-readable snapshot](priority-candidates.json) retains source revisio | [Construct](https://raw.githubusercontent.com/construct/construct/28c6e5779f2b76d55474914607291a3821502000/README.rst) · [source 1](https://raw.githubusercontent.com/construct/construct/28c6e5779f2b76d55474914607291a3821502000/LICENSE) | **File formats:** Bidirectional binary schemas. Complements Kaitai with composable Python parsing and building, useful for checking field hypotheses and reconstructing files. | Schemas must correctly model lengths, context, and validation. GitHub reports NOASSERTION, but the reviewed LICENSE contains MIT terms. **Reproduced.** Golden bytes, parse/build, wrong magic, truncation, trailing-data rejection. | | [Vineflower](https://raw.githubusercontent.com/Vineflower/vineflower/b8273988af850e8cfb234ca08d129058502b032f/README.md) | **Android and managed code:** Modern JVM class decompilation. Adds a standalone JVM decompiler beside the existing Android DEX and managed-code workbenches. | Current releases require Java 17+ to run; host requirements and target class versions are separate. Obfuscation and other Java versions were not tested. Apache-2.0. **Reproduced.** Java 17 record/switch expression, rebuild, main output and five branch vectors. | | [ghidriff](https://raw.githubusercontent.com/clearbluejar/ghidriff/4f5d895fcbb1eacd65efd81145922c15bb7e741d/README.md) | **Diffing and analysis frameworks:** Reviewable patch-diff reports. Adds CLI automation and JSON/Markdown/optional HTML reports to the existing pairwise diffing tools. | Ghidra, PyGhidra/JPype, and the matching JDK must be pinned. The reviewed development target is Ghidra 12.0.4 with PyGhidra 3.x; older examples do not prove broad compatibility. GPL-3.0. **Documented.** | -| [oletools](https://raw.githubusercontent.com/decalage2/oletools/ec10260989dbc48b9109e3d05d22beee19cf2333/README.md) · [source 1](https://raw.githubusercontent.com/decalage2/oletools/ec10260989dbc48b9109e3d05d22beee19cf2333/LICENSE.md) | **Malware analysis:** Office, OLE, and RTF analysis. Fills the document-input gap: macro extraction, embedded objects, and related document artifacts rather than predominantly PE inputs. | Coverage varies by subtool; XLM workflows have optional dependencies. README news mentions 0.60.3 while the latest GitHub release endpoint returns 0.60.2. Own code uses BSD-style terms, with MIT/third-party exceptions. **Documented.** | +| [oletools](https://raw.githubusercontent.com/decalage2/oletools/ec10260989dbc48b9109e3d05d22beee19cf2333/README.md) · [source 1](https://raw.githubusercontent.com/decalage2/oletools/ec10260989dbc48b9109e3d05d22beee19cf2333/LICENSE.md) | **Malware analysis:** Office, OLE, and RTF analysis. Fills the document-input gap: macro extraction, embedded objects, and related document artifacts rather than predominantly PE inputs. | Coverage varies by subtool; XLM workflows have optional dependencies. README news mentions 0.60.3 while the latest GitHub release endpoint returns 0.60.2. Own code uses BSD-style terms, with MIT/third-party exceptions. **Reproduced (CI).** `oletools.rtfobj` 0.60.2 extracts a synthetic OLE1 Package (`probe.txt`) across clean and obfuscated hex; plain RTF yields 0 objects; non-OLE1 `\objdata` yields an object with `is_ole=False` and `is_package=False`. | | [AssetRipper](https://raw.githubusercontent.com/AssetRipper/AssetRipper/beeb50ee1c223e856c860caa338e5309404956a3/README.md) · [source 1](https://assetripper.com/premium/features/) | **Language runtimes and packagers:** Unity assets and dependencies. Complements Cpp2IL/Il2CppDumper code and metadata analysis with asset inspection and export. | The README claims Unity 3.5.0–6000.4.X, with varying support quality. The GPL-3.0 base and paid Premium features must be distinguished. **Documented.** | | [Speakeasy](https://raw.githubusercontent.com/mandiant/speakeasy/aa9f22643f4519e0555141cd16ee25eb971b5518/README.md) · [source 1](https://raw.githubusercontent.com/mandiant/speakeasy/aa9f22643f4519e0555141cd16ee25eb971b5518/doc/limitations.md) | **Malware analysis:** Modeled Windows execution and API reports. A smaller emulation/reporting path beside full sandbox VMs. | API, filesystem, registry, and runtime behavior are modeled. Signature-only stubs can report success without real side effects; unknown APIs may stop execution. MIT. **Documented.** | | [strace](https://raw.githubusercontent.com/strace/strace/6cba874722375675e97f68367674c1cde3cce77c/README.md) · [source 1](https://raw.githubusercontent.com/strace/strace/6cba874722375675e97f68367674c1cde3cce77c/COPYING) | **Dynamic instrumentation and tracing:** Linux syscall and signal observation. A practical first step for mapping process I/O before using a debugger or instrumentation framework. | Linux ptrace permissions and container policy affect attachment. It is syscall-level tracing. COPYING specifies LGPL-2.1-or-later for the main program, with separate test/UAPI terms. **Documented.** | diff --git a/examples/resource-intake/README.md b/examples/resource-intake/README.md index d473946..2f9e6fe 100644 --- a/examples/resource-intake/README.md +++ b/examples/resource-intake/README.md @@ -1,24 +1,27 @@ # Bounded resource examples -These self-authored fixtures demonstrate Construct, Scapy, YARA-X, Vineflower, CFR, Malduck, hermes-dec, MemProcFS, boofuzz, Keystone, esptool, Z3, and unblob in CI, plus a local PyLingual check. They are small selection examples, not upstream test suites or evidence of full platform/version support. +These self-authored fixtures demonstrate Construct, Scapy, YARA-X, Vineflower, CFR, Malduck, hermes-dec, MemProcFS, boofuzz, Keystone, esptool, Z3, oletools, WhatsABI, LIEF, and unblob in sixteen bounded CI cases, plus a local PyLingual check. They are small selection examples, not upstream test suites or evidence of full platform/version support. -Use Python 3.11 with `venv`/`pip` support, JDK 17, Node.js, and an Internet connection for the pinned packages, JAR, and Hermes compilers. From the repository root: +Use Python 3.11 with `venv`/`pip` support, JDK 17, Node.js 20.19.0 or newer with npm, and an Internet connection for the pinned packages, JAR, and Hermes compilers. From the repository root: ```bash resource_examples_dir="$(mktemp -d)" python3.11 -m venv "$resource_examples_dir/venv" "$resource_examples_dir/venv/bin/python" -m pip install -r examples/resource-intake/requirements.txt +npm --prefix examples/resource-intake/whatsabi ci --ignore-scripts "$resource_examples_dir/venv/bin/python" examples/resource-intake/verify.py --output "$resource_examples_dir/results" ``` The runner downloads [Vineflower 1.12.0](https://github.com/Vineflower/vineflower/releases/tag/1.12.0), [CFR 0.152](https://github.com/leibnitz27/cfr/releases/tag/0.152), and two `hermes-compiler` npm tarballs, and checks each SHA-256 before executing anything from them. An existing JAR can be supplied with `--vineflower-jar /path/to/vineflower-1.12.0.jar`; the same digest check still applies, and `--cfr-jar /path/to/cfr-0.152.jar` does the same for CFR. Failed assertions or commands fail the run; a successful run writes `results.json` and retains generated artifacts in a unique directory under the selected output path. -The Hermes fixture additionally needs Node.js (CI uses Node.js 22). Its pinned compilers provide Linux x86-64, universal macOS, and Windows x86-64 binaries; native Windows/macOS execution is not part of this repository's verification. +The Hermes fixture and WhatsABI probe need Node.js; WhatsABI 0.30.0 and its lockfile require at least 20.19.0 (CI uses Node.js 22). The verifier checks this minimum before running fixtures. Install WhatsABI with the lockfile using `npm ci --ignore-scripts` as shown above. The pinned Hermes compilers provide Linux x86-64, universal macOS, and Windows x86-64 binaries; native Windows/macOS execution is not part of this repository's verification. MemProcFS runs only on Linux x86-64, where it also needs the system `libusb-1.0` library (`sudo apt-get install libusb-1.0-0` on Debian/Ubuntu). Its pinned wheels are installed only on that host, and on other hosts the runner records MemProcFS as `skipped`. The Keystone check and its explicit Keystone/Capstone pins are exercised only on Linux x86-64; Capstone may also be installed elsewhere as another package's dependency. Keystone 0.9.2 has no wheel for ARM hosts, where pip would build it from source with CMake and a C++ compiler; on other hosts the runner records Keystone as `skipped`. +The unblob ZIP-handler example and its pin are exercised only on Linux x86-64. On other hosts the runner records unblob as `skipped`; this is the tested example scope, not an upstream platform-support claim. + On Windows, use this PowerShell block with Python 3.11 and JDK 17 or newer (`java` and `javac` on `PATH`). The verifier checks both Java versions before running the fixtures. Use `python` in place of `py -3.11` if that is your Python 3.11 launcher. ```powershell @@ -27,6 +30,7 @@ New-Item -ItemType Directory -Path $resourceExamplesDir | Out-Null py -3.11 -m venv (Join-Path $resourceExamplesDir "venv") $resourcePython = Join-Path $resourceExamplesDir "venv\Scripts\python.exe" & $resourcePython -m pip install -r examples/resource-intake/requirements.txt +npm --prefix examples/resource-intake/whatsabi ci --ignore-scripts & $resourcePython examples/resource-intake/verify.py --output $resourceExamplesDir ``` @@ -44,7 +48,10 @@ $resourcePython = Join-Path $resourceExamplesDir "venv\Scripts\python.exe" | Keystone 0.9.2 (with Capstone 5.0.9) | x86-64 `push rbp; mov rbp, rsp; mov eax, dword ptr [rbx + rcx*4 + 8]; xor eax, eax; pop rbp; ret` and ARM64 `mov x0, #1; add x1, x2, x3; ldr x0, [x1, #8]; b #0x1010; ret` at base `0x1000` assemble to bytes encoded by hand from the Intel SDM and Arm ARM (`554889e58b448b0831c05dc3`, `200080d24100038b200440f901000014c0035fd6`); Capstone disassembles them back to the same text, which reassembles to the same bytes; `b #0x1010` at `0x2000` becomes the backward branch `04fcff17` | Two short sequences on two ISAs, Linux x86-64 only; see the limits below | | esptool 5.6.0 | A 128-byte ESP32 application image built by hand from the [5.6.0 documented layout](https://raw.githubusercontent.com/espressif/esptool/e970488de2c8f1906ca9b08de681b3f9dc58b2d5/docs/en/advanced-topics/firmware-image-format.rst): entry `0x40080400`, a 16-byte DRAM segment at `0x3ffb0000` and a 32-byte IRAM segment at `0x40080400`, checksum `0xf3` (`0xEF` XOR the segment data) and an appended SHA-256 `f8d0bbc1…c9cb`; `image-info` reports the header, both segments at file offsets `0x18` and `0x30`, and a valid checksum and hash, with no device connected. A synthetic variant with chip ID 9 is detected as ESP32-S3 (header identification only); flipping one data bit gives checksum `0xf2` and hash `b1f33ee1…4147`, both reported as invalid | Offline `image-info` on one ESP32 application layout; no serial port, flashing, or bootloader images; see the limits below | | Z3 (z3-solver 5.3.1.0) | A synthetic 16-bit serial check written as a decompiler would show it (`((x * 0x9E37) ^ (x >> 5)) + rotl(x, 3)` with unsigned arithmetic) and target `0x002a`; brute-forcing all 65,536 inputs in plain Python finds exactly `0x1bb9`, `0x9cff`, and `0xb62c`, and Z3's bit-vector solver, asked again with each found serial blocked, returns the same three and then `unsat` | Python API, one 16-bit constraint; no SMT-LIB files, tactics, timeouts, or `unknown` results; see the limits below | -| unblob 26.6.4 | A ZIP written by the stdlib, holding `probe.txt` / `UNBLOB-PROBE-1`, placed 40 bytes into a larger blob; `ZIPHandler.calculate_chunk` from that offset returns exactly the ZIP bytes | One stored ZIP; no nested firmware or external extractors; see the limit below | +| oletools 0.60.2 | A synthetic RTF document containing an OLE1 `Package` stream (`probe.txt`, payload `OLE-RTF-PROBE-PAYLOAD-1`); `RtfObjParser` recovers the class name, filename, and exact payload bytes from both clean hex and hex interrupted by whitespace and `{\bin0}`; a plain RTF yields zero objects | `oletools.rtfobj` Python API on one synthetic OLE1 Package; no VBA/XLM macros or Office Open XML; see the limit below | +| WhatsABI 0.30.0 | A hand-built EVM dispatcher contains the first four bytes of keccak256(`foo()`) and keccak256(`bar(uint256)`), `c2985578` and `0423a132`, and valid JUMPDESTs at offsets `0x1e` and `0x20`; selector recovery yields both, and ABI inference yields two function entries without names or input types | One valid dispatcher plus malformed-target and lone-PUSH4 controls; no proxy resolution, provider, signature database, or chain lookup; see the limit below | +| LIEF 0.16.6 | A 120-byte ELF64 executable built with `struct`: machine `EM_X86_64`, type `EXEC`, entry `0x401000`, one `PT_LOAD` at that page with flags read and execute, and no section headers | One ELF64 image; no relocation, symbols, or other formats; see the limit below | +| unblob 26.6.4 | A ZIP written by the stdlib, holding `probe.txt` / `UNBLOB-PROBE-1`, placed 40 bytes into a larger blob; `ZIPHandler.calculate_chunk` from that offset returns exactly the ZIP bytes | One stored ZIP on Linux x86-64 only; no full scanner, nested firmware, or external extractors; see the limits below | The branch oracle for `Probe.java` is: @@ -88,9 +95,22 @@ The Z3 check also records two limits, both described in the [5.3.1 Python API](h - `>>` on a bit-vector is an arithmetic (signed) shift; C's unsigned `>>` is `LShR`. Written with `>>`, the same check returns only `0x1bb9`, silently missing the two serials whose top bit is set, without an error. The two shifts agree whenever the top bit is clear. - `model.eval(y, model_completion=True)` gives an unconstrained variable the value 0 and adds it to the model, so afterwards `model[y]` is 0 and `model.decls()` lists `y` as if the solver had chosen it. -The unblob check also records one limit: +The oletools check also records one limit: -- `ZIPHandler.calculate_chunk` rejects the same blob when the start offset is 0, before the local file header, even though the end-of-central-directory record is present. The central-directory offset is relative to the real start of the ZIP. +- Non-OLE1 bytes inside `\objdata` are still returned as an extracted object with `is_ole=False`, `is_package=False`, and `olepkgdata=None`, so callers must inspect these fields before treating an object as an OLE package. VBA, XLM, and Office Open XML are not exercised. + +The WhatsABI check also records one limit: + +- Selector candidates remain present when the comparison/JUMPI pattern has invalid targets: the malformed dispatcher yields both selectors but no inferred ABI. A PUSH4 with no JUMPI yields no selector. The valid dispatcher yields function entries, but their names and parameter types remain unknown. + +The LIEF check also records one limit: + +- In 0.16.6 a 20-byte prefix of the same ELF returns a partial binary object with entry point 0 and no segments. The wrong-magic (`MZ`) control instead returns `None`; a non-`None` parse result alone does not establish completeness. + +The unblob check also records two limits: + +- `ZIPHandler.calculate_chunk` rejects this padded ZIP when passed offset 0 instead of 40. The end-of-central-directory record's central-directory offset is relative to the archive origin; this rejection does not show that the method validates local-header magic. +- Replacing the four local-header magic bytes with `AAAA` still returns the same chunk bounds, while the independent stdlib `ZipFile.read("probe.txt")` raises `BadZipFile`. Carving bounds do not establish ZIP validity. The example calls the handler directly; it does not claim that unblob's signature scanner or extractors accept this corrupt archive. Without `-dtb`, MemProcFS rejects a raw image that contains no identifiable operating system (`Unable to locate valid DTB`). The Linux `memprocfs` wheel does not include `leechcore.so`; the runner uses the one from `leechcorepyc` by starting the probe with `LD_LIBRARY_PATH` pointing at its directory. @@ -108,4 +128,4 @@ python3 examples/resource-intake/pylingual/run.py --pylingual pylingual/.venv/bi The runner records the resolved compiler versions, disables the optional shared Redis translation cache, and saves per-target stdout/stderr logs for model-download or decompilation failures. PyLingual itself needs Python 3.12 or newer. Hosts using a SOCKS proxy may also need the optional `socksio` transport in the PyLingual environment; this is a transport requirement, not a model or decompiler result. On all three target versions, `classify`, `checksum`, `squares`, and `label` behave like the original. `parse_port` (a `try`/`except` followed by a chained comparison) fails on every version, and PyLingual flags it in both its report and the output file: on 3.11 it does not compile (`Compilation Error`), so the decompiled file as a whole cannot be imported; on 3.12 and 3.13 the file imports, but `parse_port` returns `-2` for `"8080"` instead of `8080` (`Different control flow`). The same results were produced at commit `509ea92` on 2026-10-19, and repeated runs produced identical output. -See the [candidate review](../../docs/priority-candidates.md) for primary sources, documented requirements, and the nineteen entries without execution verification. +See the [candidate review](../../docs/priority-candidates.md) for primary sources, documented requirements, and the eighteen entries without execution verification. diff --git a/examples/resource-intake/requirements.txt b/examples/resource-intake/requirements.txt index b537416..fb01dac 100644 --- a/examples/resource-intake/requirements.txt +++ b/examples/resource-intake/requirements.txt @@ -10,4 +10,6 @@ keystone-engine==0.9.2; sys_platform == "linux" and platform_machine == "x86_64" capstone==5.0.9; sys_platform == "linux" and platform_machine == "x86_64" esptool==5.6.0 z3-solver==5.3.1.0 -unblob==26.6.4 +unblob==26.6.4; sys_platform == "linux" and platform_machine == "x86_64" +oletools==0.60.2 +lief==0.16.6 diff --git a/examples/resource-intake/verify.py b/examples/resource-intake/verify.py index b2373c4..c1b0a69 100644 --- a/examples/resource-intake/verify.py +++ b/examples/resource-intake/verify.py @@ -1,4 +1,4 @@ -"""Reproduce thirteen narrow resource examples with independent expected outputs.""" +"""Reproduce sixteen narrow resource examples with independent expected outputs.""" import argparse import ctypes.util from datetime import datetime, timezone @@ -159,6 +159,20 @@ def require_java(executable): if major < 17: raise SystemExit(f"{executable} requires JDK 17 or newer; found {output.strip() or 'an unknown version'}.") +def require_node(): + """WhatsABI 0.30.0 and its lockfile require Node.js >=20.19.0.""" + try: + completed = subprocess.run(["node", "--version"], text=True, capture_output=True, check=True) + except FileNotFoundError as exc: + raise SystemExit("Node.js was not found. Install Node.js 20.19.0 or newer (CI uses 22) and retry.") from exc + except subprocess.CalledProcessError as exc: + raise SystemExit("Cannot query Node.js version. Install Node.js 20.19.0 or newer (CI uses 22) and retry.") from exc + output = completed.stdout + completed.stderr + match = re.fullmatch(r"v?(\d+)\.(\d+)\.(\d+)\s*", output.strip()) + if match is None or tuple(map(int, match.groups())) < (20, 19, 0): + raise SystemExit(f"WhatsABI requires Node.js 20.19.0 or newer; found {output.strip() or 'an unknown version'}.") + + def rc4(key, data): """Independent RC4 used only to build the Malduck fixture.""" state, j = list(range(256)), 0 @@ -313,12 +327,19 @@ def keystone_host(): return platform.system() == "Linux" and platform.machine() == "x86_64" +def unblob_host(): + """Only this bounded example's Linux x86-64 host is exercised here.""" + return platform.system() == "Linux" and platform.machine() == "x86_64" + + def required_packages(): - packages = {"construct": "2.10.70", "scapy": "2.8.0", "yara-x": "1.21.0", "hermes-dec": "0.1.8", "malduck": "4.4.1", "boofuzz": "0.4.2", "esptool": "5.6.0", "z3-solver": "5.3.1.0", "unblob": "26.6.4"} + packages = {"construct": "2.10.70", "scapy": "2.8.0", "yara-x": "1.21.0", "hermes-dec": "0.1.8", "malduck": "4.4.1", "boofuzz": "0.4.2", "esptool": "5.6.0", "z3-solver": "5.3.1.0", "oletools": "0.60.2", "lief": "0.16.6"} if memprocfs_host(): packages.update(MEMPROCFS_PACKAGES) if keystone_host(): packages.update(KEYSTONE_PACKAGES) + if unblob_host(): + packages["unblob"] = "26.6.4" return packages @@ -530,6 +551,108 @@ def verify_z3(): return {"target": hex(SERIAL_TARGET), "serials": [hex(v) for v in serials], "arithmetic_shift_serials": [hex(v) for v in naive]} +def verify_oletools(): + import oletools.rtfobj + + payload = b"OLE-RTF-PROBE-PAYLOAD-1" + filename, src_path, tmp_path = b"probe.txt", b"C:\\work\\probe.txt", b"C:\\temp\\probe.txt" + pkg = ( + struct.pack("> in place of LShR finds only the one with the top bit clear; model_completion adds a default value to the model"}, - {"name": "unblob", "version": "26.6.4", "result": "passed", "scope": "ZIPHandler on a stdlib ZIP after 40 bytes of padding: the chunk is exactly the ZIP; no EOCD raises InvalidInputFormat; the same file is rejected when the start offset is before the local header"}, + {"name": "oletools", "version": "0.60.2", "result": "passed", "scope": "Synthetic RTF with an embedded OLE1 Package: RtfObjParser recovers filename and payload across clean and obfuscated (whitespace + \\bin0) hex; plain RTF yields 0 objects; non-OLE1 \\objdata still yields an object with is_ole=False and is_package=False"}, + {"name": "WhatsABI", "version": whatsabi_summary["version"], "result": "passed", "scope": "Hand-built valid EVM dispatcher: expected keccak256 selector prefixes and two function ABI entries without names/types; malformed targets still yield selectors but no ABI; a PUSH4 with no JUMPI is ignored; no provider or signature lookup"}, + {"name": "LIEF", "version": "0.16.6", "result": "passed", "scope": "Hand-built ELF64 EXEC with one LOAD segment and no section headers; wrong magic returns None; a 20-byte prefix still returns a binary with entry 0 and no segments"}, + unblob_result, ], - "inputs": [{"path": name, "sha256": sha256(SOURCE / name)} for name in ("BranchDemo.java", "Probe.java", "Shapes.java", "SealedProbe.java", "hbc_fixture.js", "malduck_modules/duckcfg/__init__.py", "malduck_modules/duckcfg/duckcfg.yar", "memprocfs_probe.py", "verify.py", "requirements.txt")], + "inputs": [{"path": name, "sha256": sha256(SOURCE / name)} for name in ("BranchDemo.java", "Probe.java", "Shapes.java", "SealedProbe.java", "hbc_fixture.js", "malduck_modules/duckcfg/__init__.py", "malduck_modules/duckcfg/duckcfg.yar", "memprocfs_probe.py", "whatsabi/probe.mjs", "whatsabi/package.json", "whatsabi/package-lock.json", "verify.py", "requirements.txt")], "golden_hex": GOLDEN.hex(), "vineflower_artifact": {"url": JAR_URL, "sha256": JAR_SHA256}, "cfr": cfr_summary, @@ -703,6 +851,9 @@ def verify(work, jar, cfr_jar=None): "keystone": {"base": hex(ASM_BASE), "x64": {"source": X64_SOURCE, "bytes": X64_BYTES}, "arm64": {"source": A64_SOURCE, "bytes": A64_BYTES, "backward_branch_at_0x2000": A64_BACKWARD_BRANCH}}, "z3": z3_summary, + "oletools": oletools_summary, + "whatsabi": whatsabi_summary, + "lief": lief_summary, "unblob": unblob_summary, "esptool": {"image_sha256": esp_digest, "entry": hex(ESP_ENTRY), "checksum": hex(ESP_CHECKSUM), "validation_hash": ESP_DIGEST, "corrupt_checksum": hex(ESP_CORRUPT_CHECKSUM), "corrupt_validation_hash": ESP_CORRUPT_DIGEST}, diff --git a/examples/resource-intake/whatsabi/.gitignore b/examples/resource-intake/whatsabi/.gitignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/examples/resource-intake/whatsabi/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/examples/resource-intake/whatsabi/package-lock.json b/examples/resource-intake/whatsabi/package-lock.json new file mode 100644 index 0000000..0732111 --- /dev/null +++ b/examples/resource-intake/whatsabi/package-lock.json @@ -0,0 +1,229 @@ +{ + "name": "whatsabi-example", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "whatsabi-example", + "dependencies": { + "@shazow/whatsabi": "0.30.0" + } + }, + "node_modules/@adraffy/ens-normalize.ts": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize.ts/-/ens-normalize.ts-1.0.1.tgz", + "integrity": "sha512-7wvZTCkt4A/beL2KqvUVBftZvyugvqANY74YFkTOLwX4JtsgIBOMGogItvGrd+yOg2ctDkvrZ6+HV0WtsZ6Q9g==", + "license": "MIT" + }, + "node_modules/@noble/ciphers": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-2.4.0.tgz", + "integrity": "sha512-AnjFn0Jv92laAkvMrghlFZq4qQCIN/4DxFV/eooqtC2YTjB7kBeLMS2T9KJX4Dn+ZVXLOwK0lSgqDtx9gvxtiw==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/curves": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-2.4.0.tgz", + "integrity": "sha512-P4/62zrgfH33CneE3Dn4WhJVA22YUU0eR51wKIan4NVRvwsA0YnPTwWGpNbpuacSujmSFLvyzpyuR30+fbq2Ew==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "2.4.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.4.0.tgz", + "integrity": "sha512-X5XaVWZIBCT7HHZGm5I7ZQXDwLG+bGXuSrMQAW+7Zvl87h1kmc1ZB1VSRJcpUfoUrGQp4Fkoxm5kZ+Ms+aW+eA==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/post-quantum": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@noble/post-quantum/-/post-quantum-0.6.1.tgz", + "integrity": "sha512-+pormrDZwjRw05U8ADK4JpHejo87+gBd+muRBB/ozztH5yhDLMDF4jHQWN3NQQAsu1zBNPWTG0ZwVI0CR29H0A==", + "license": "MIT", + "dependencies": { + "@noble/ciphers": "~2.2.0", + "@noble/curves": "~2.2.0", + "@noble/hashes": "~2.2.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/post-quantum/node_modules/@noble/ciphers": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-2.2.0.tgz", + "integrity": "sha512-Z6pjIZ/8IJcCGzb2S/0Px5J81yij85xASuk1teLNeg75bfT07MV3a/O2Mtn1I2se43k3lkVEcFaR10N4cgQcZA==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/post-quantum/node_modules/@noble/curves": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-2.2.0.tgz", + "integrity": "sha512-T/BoHgFXirb0ENSPBquzX0rcjXeM6Lo892a2jlYJkqk83LqZx0l1Of7DzlKJ6jkpvMrkHSnAcgb5JegL8SeIkQ==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "2.2.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/post-quantum/node_modules/@noble/hashes": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.2.0.tgz", + "integrity": "sha512-IYqDGiTXab6FniAgnSdZwgWbomxpy9FtYvLKs7wCUs2a8RkITG+DFGO1DM9cr+E3/RgADRpFjrKVaJ1z6sjtEg==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/base": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-2.4.0.tgz", + "integrity": "sha512-thZ1TuJwFwBblOhgsjDKvvGirBxNp+wSvY/DR6tJBJOTDhdAAcHJ8Vbr2eFnqaxeca4+t0i9KBf+uHYGWwZORg==", + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-2.4.0.tgz", + "integrity": "sha512-i3DS0CptAocyvqE4n3SUkpzeQK4vJMFwWLofTwRiiKo2aWojBOfyMCgfKw9HVpO6fSY5AK86sHS/Uzn8kK9Few==", + "license": "MIT", + "dependencies": { + "@noble/curves": "2.4.0", + "@noble/hashes": "2.4.0", + "@scure/base": "2.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip39": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-2.4.0.tgz", + "integrity": "sha512-82dxFbZUYboyOf0AXiydsQrFQ5Q4h9mX+O2UkE91ROYmsc0BKMGZLwDmy96Jpa2+vrtoxomjUhy1RPIgH/r2nA==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "2.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@shazow/whatsabi": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/@shazow/whatsabi/-/whatsabi-0.30.0.tgz", + "integrity": "sha512-2V6s8TZucnEjs2SHAhtsB/Fpji3GNctCC6hIyhyDJfPFZ/tQJ/rIWd1AfhN6LxYNx9uzRUQSwFW4cp4kkNK8Mg==", + "license": "MIT", + "dependencies": { + "ox": "^1.8.8" + }, + "engines": { + "node": ">=20.19.0" + } + }, + "node_modules/abitype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.3.0.tgz", + "integrity": "sha512-fk6Te+bojIFrMvMZrnOO+SxCB+RUksTGOzq/60ZRvs1L+BVzvi2bqt9L3W/17ZLdZsyM1FuYf65P5nlmoiH1Bg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/wevm" + }, + "peerDependencies": { + "typescript": ">=5.0.4", + "zod": "^3.22.0 || ^4.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + }, + "zod": { + "optional": true + } + } + }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" + }, + "node_modules/ox": { + "version": "1.8.21", + "resolved": "https://registry.npmjs.org/ox/-/ox-1.8.21.tgz", + "integrity": "sha512-mPbCARuTYfNHPMynzFMekICzp5AJUnz6j8Db1qpv90Pi/Prt02FRvFR2sOlMzG7v4qWB12KqI750gRoyZnWG6g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "license": "MIT", + "dependencies": { + "@adraffy/ens-normalize.ts": "^1.0.0", + "@noble/ciphers": "^2.2.0", + "@noble/curves": "^2.2.0", + "@noble/hashes": "^2.2.0", + "@noble/post-quantum": "^0.6.1", + "@scure/bip32": "^2.0.0", + "@scure/bip39": "^2.0.0", + "abitype": "^1.3.0", + "eventemitter3": "5.0.1", + "zod": "^4.4.3" + }, + "peerDependencies": { + "typescript": ">=5.4.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/zod": { + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/examples/resource-intake/whatsabi/package.json b/examples/resource-intake/whatsabi/package.json new file mode 100644 index 0000000..042b796 --- /dev/null +++ b/examples/resource-intake/whatsabi/package.json @@ -0,0 +1,8 @@ +{ + "name": "whatsabi-example", + "private": true, + "type": "module", + "dependencies": { + "@shazow/whatsabi": "0.30.0" + } +} diff --git a/examples/resource-intake/whatsabi/probe.mjs b/examples/resource-intake/whatsabi/probe.mjs new file mode 100644 index 0000000..839c13a --- /dev/null +++ b/examples/resource-intake/whatsabi/probe.mjs @@ -0,0 +1,32 @@ +import assert from "node:assert/strict"; +import { whatsabi } from "@shazow/whatsabi"; + +// Constants independently checked with Keccak-256, not SHA3-256. +const expected = ["0xc2985578", "0x0423a132"]; // foo(), bar(uint256) +// CALLDATALOAD, SHR 224, two comparisons, fallback REVERT, then two JUMPDEST/STOP bodies. +const dispatcher = "0x60003560e01c8063c298557814601e5780630423a13214602057600080fd5b005b00"; +const bytes = Buffer.from(dispatcher.slice(2), "hex"); +assert.equal(bytes[0x1e], 0x5b); +assert.equal(bytes[0x20], 0x5b); +const selectors = whatsabi.selectorsFromBytecode(dispatcher); +const abi = whatsabi.abiFromBytecode(dispatcher); +assert.deepEqual(selectors, expected); +assert.deepEqual(abi.map(({type, selector}) => [type, selector]), expected.map(selector => ["function", selector])); +// Entry recovery does not supply original names or parameter types. +assert.ok(abi.every(entry => entry.name === undefined && entry.inputs === undefined)); + +// Original malformed table: selector-pattern matches survive invalid jump targets. +const malformed = "0x63c29855788114600e57630423a1328114601657600080fd5b5b"; +const malformedSelectors = whatsabi.selectorsFromBytecode(malformed); +const malformedAbi = whatsabi.abiFromBytecode(malformed); +assert.deepEqual(malformedSelectors, expected); +assert.deepEqual(malformedAbi, []); +const loneSelectors = whatsabi.selectorsFromBytecode("0x63deadbeef00"); +assert.deepEqual(loneSelectors, []); + +process.stdout.write(JSON.stringify({ + selectors, + abi, + malformed: {selectors: malformedSelectors, abi: malformedAbi}, + lone_push4: loneSelectors, +}) + "\n"); diff --git a/tests/test_resource_prerequisites.py b/tests/test_resource_prerequisites.py index 42b3560..7ed79f8 100644 --- a/tests/test_resource_prerequisites.py +++ b/tests/test_resource_prerequisites.py @@ -21,9 +21,9 @@ spec.loader.exec_module(verifier) # Independent of the verifier: (sys_platform, platform_machine) -> packages pip should install beyond the -# always-required pins. MemProcFS and Keystone are exercised only on Linux x86-64. +# always-required pins. MemProcFS, Keystone, and unblob are exercised only on Linux x86-64. HOST_MATRIX = { - ("linux", "x86_64"): {"memprocfs", "leechcorepyc", "keystone-engine", "capstone"}, + ("linux", "x86_64"): {"memprocfs", "leechcorepyc", "keystone-engine", "capstone", "unblob"}, ("linux", "aarch64"): set(), ("darwin", "arm64"): set(), ("darwin", "x86_64"): set(), @@ -98,16 +98,18 @@ class Prerequisites(unittest.TestCase): with patch.dict(verifier.os.environ, clear=True): self.assertEqual(verifier.memprocfs_env(Path("/wheel/leechcorepyc"))["LD_LIBRARY_PATH"], "/wheel/leechcorepyc") - def test_memprocfs_pins_are_required_only_on_its_host(self): + def test_platform_pins_are_required_only_on_their_host(self): installed = {name: pinned for name, pinned, _ in requirements()} - for host, expected in [(("Darwin", "arm64"), "javac"), (("Linux", "x86_64"), "Missing Python dependency: memprocfs")]: - def version(name): - if name == "memprocfs": - raise PackageNotFoundError(name) - return installed[name] - with self.subTest(host=host), patch.object(verifier.platform, "system", return_value=host[0]), patch.object(verifier.platform, "machine", return_value=host[1]), patch.object(verifier, "version", side_effect=version), patch.object(verifier, "require_java", side_effect=SystemExit("javac")): - with self.assertRaisesRegex(SystemExit, expected): - verifier.verify(Path("unused"), None) + for missing in ("memprocfs", "unblob"): + for host in (("Darwin", "arm64"), ("Linux", "x86_64")): + expected = "javac" if host[0] == "Darwin" else f"Missing Python dependency: {missing}" + def version(name): + if name == missing: + raise PackageNotFoundError(name) + return installed[name] + with self.subTest(missing=missing, host=host), patch.object(verifier.platform, "system", return_value=host[0]), patch.object(verifier.platform, "machine", return_value=host[1]), patch.object(verifier, "version", side_effect=version), patch.object(verifier, "require_java", side_effect=SystemExit("javac")): + with self.assertRaisesRegex(SystemExit, expected): + verifier.verify(Path("unused"), None) def test_missing_libusb_is_actionable(self): with patch.object(verifier.ctypes.util, "find_library", return_value=None), self.assertRaisesRegex(SystemExit, "libusb-1.0"): @@ -134,6 +136,21 @@ class Prerequisites(unittest.TestCase): with self.assertRaisesRegex(SystemExit, "Install JDK 17"): verifier.require_java("java") + def test_node_minimum_version_boundary(self): + for output, accepted in [("v20.18.9", False), ("v20.19.0", True), ("v22.0.0", True), ("unknown", False), ("v20.19.0-rc.1", False)]: + with self.subTest(output=output), patch.object(verifier.subprocess, "run", return_value=subprocess.CompletedProcess([], 0, output + "\n", "")): + if accepted: + verifier.require_node() + else: + with self.assertRaisesRegex(SystemExit, "requires Node.js 20.19.0"): + verifier.require_node() + + def test_missing_or_broken_node_has_no_raw_exception(self): + for failure in [FileNotFoundError(), subprocess.CalledProcessError(1, ["node", "--version"])]: + with self.subTest(failure=type(failure).__name__), patch.object(verifier.subprocess, "run", side_effect=failure): + with self.assertRaisesRegex(SystemExit, "Install Node.js 20.19.0"): + verifier.require_node() + def test_windows_hermes_compiler_keeps_required_runtime_dlls(self): archive = io.BytesIO() with tarfile.open(fileobj=archive, mode="w:gz") as tar: From 3359268c16564290f5705f7ceeae23bc870c34bb Mon Sep 17 00:00:00 2001 From: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com> Date: Tue, 1 Dec 2026 12:36:48 +0000 Subject: [PATCH 11/11] test: record the full sixteen-case reproduction Generated by the integrated verifier on Linux x86_64 with all cases passing and thirteen checked source inputs. No compatibility matrix is inferred. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) --- examples/resource-intake/verified.json | 98 +++++++++++++++++++++++--- 1 file changed, 90 insertions(+), 8 deletions(-) diff --git a/examples/resource-intake/verified.json b/examples/resource-intake/verified.json index 452c22b..195a7bb 100644 --- a/examples/resource-intake/verified.json +++ b/examples/resource-intake/verified.json @@ -1,9 +1,9 @@ { - "checked_at": "2026-11-09T05:11:41.941025+00:00", + "checked_at": "2026-12-01T12:36:22.634153+00:00", "host": { - "platform": "Linux-6.1.0-54-cloud-amd64-x86_64-with-glibc2.36", - "python": "3.11.15", - "javac": "javac 17.0.21", + "platform": "Linux-6.1.0-56-cloud-amd64-x86_64-with-glibc2.36", + "python": "3.11.2", + "javac": "javac 17.0.21.1", "node": "v20.20.2" }, "results": [ @@ -78,6 +78,30 @@ "version": "5.3.1.0", "result": "passed", "scope": "Synthetic 16-bit serial check: blocking-clause enumeration finds exactly the three serials a brute-force search finds; an arithmetic >> in place of LShR finds only the one with the top bit clear; model_completion adds a default value to the model" + }, + { + "name": "oletools", + "version": "0.60.2", + "result": "passed", + "scope": "Synthetic RTF with an embedded OLE1 Package: RtfObjParser recovers filename and payload across clean and obfuscated (whitespace + \\bin0) hex; plain RTF yields 0 objects; non-OLE1 \\objdata still yields an object with is_ole=False and is_package=False" + }, + { + "name": "WhatsABI", + "version": "0.30.0", + "result": "passed", + "scope": "Hand-built valid EVM dispatcher: expected keccak256 selector prefixes and two function ABI entries without names/types; malformed targets still yield selectors but no ABI; a PUSH4 with no JUMPI is ignored; no provider or signature lookup" + }, + { + "name": "LIEF", + "version": "0.16.6", + "result": "passed", + "scope": "Hand-built ELF64 EXEC with one LOAD segment and no section headers; wrong magic returns None; a 20-byte prefix still returns a binary with entry 0 and no segments" + }, + { + "name": "unblob", + "version": "26.6.4", + "result": "passed", + "scope": "ZIPHandler on a stdlib ZIP after 40 bytes of padding: exact chunk bounds; missing EOCD and incorrect archive-relative origin raise InvalidInputFormat; a corrupt local-header magic still carves but stdlib ZipFile.read rejects it; no extraction or full scanner" } ], "inputs": [ @@ -113,13 +137,25 @@ "path": "memprocfs_probe.py", "sha256": "28371a05c81ddf4af7515350adf3868b40e6584880abc490bc7b0f393f7804fb" }, + { + "path": "whatsabi/probe.mjs", + "sha256": "90e07ed8e3e58e32f447f7f96f3e8f6140d9dae52bc9133936cd250b43e2d63a" + }, + { + "path": "whatsabi/package.json", + "sha256": "eda1db6fa59021633831c208bacec2d2fe7104643c84c50103a6a33a891d164e" + }, + { + "path": "whatsabi/package-lock.json", + "sha256": "e89e352de285a87eb7387ece37fd269f0b0e5f0e336c4a907449f8513452b886" + }, { "path": "verify.py", - "sha256": "17256dc1097a69370defd3d542203c4f1824a26669099ec8e4e29f43cf0b4f1a" + "sha256": "38ea58de16a74f4fa72020619d8c5c3012e7b3ff4be1a04dfd9650710c3add59" }, { "path": "requirements.txt", - "sha256": "5728a49e5174963eb193e92d03c2259134bfbcbd7f87454b0db486120c7becab" + "sha256": "f47666d605deb12626d6eeb0fcd5e8a54bb262071fe13fe0efea8d737e354167" } ], "golden_hex": "534d4b310500017472616365", @@ -172,11 +208,11 @@ "hbc_sha256": { "98": { "g0": "d1ceacc1f40097b798abf4eeaf8f2f0a663afa9ed8d8fdd5f2b2d99ee2e422a8", - "g1": "43afa6eb92edc690171b57fa404575e07a709e3aaec419fac50a3cb92817914a" + "g1": "2741667d18283ec9ea283516311f97ca135de45ee4732ec72713ab41c7b65275" }, "99": { "g0": "f51e55203c85ab6fd016ab83862f81aa61cc2f441087c10ef712c2148bf7b57d", - "g1": "e1264ff83d8824fdff43601f64162dcd27f1622c18bff277ef13b7be3977ddd0" + "g1": "4612cc6276e6471bb7efb0b4ace02de52d2f3c9c8577b948a1decc24b4ad45d6" } }, "original_output": "even:negative:25", @@ -216,6 +252,52 @@ "0x1bb9" ] }, + "oletools": { + "rtf_sha256": "85897e051092c427a0895200b62acf606c98da66d06c1dab50af51cd119bd193", + "payload_sha256": "2497af633904cd0fb296cc14bbf445ed225b05d589a1e5abbec43d737670b980", + "filename": "probe.txt" + }, + "whatsabi": { + "selectors": [ + "0xc2985578", + "0x0423a132" + ], + "abi": [ + { + "type": "function", + "selector": "0xc2985578", + "payable": true, + "stateMutability": "payable" + }, + { + "type": "function", + "selector": "0x0423a132", + "payable": true, + "stateMutability": "payable" + } + ], + "malformed": { + "selectors": [ + "0xc2985578", + "0x0423a132" + ], + "abi": [] + }, + "lone_push4": [], + "version": "0.30.0" + }, + "lief": { + "sha256": "9d2f259f67b79797d14cec9f5f4664b4bffaa4cab41b34a490b9133dd22f46cc", + "entry": "0x401000" + }, + "unblob": { + "zip_sha256": "78b778cea188a369c8635b6744349505d0f45efaaf1f579b100dcf113d6dd24d", + "start": 40, + "end": 170, + "corrupt_local_header_sha256": "0ab848397517fe6f983d82961c9d9568be440cefba5da1e1b57bf031372ca782", + "corrupt_local_header_carved": true, + "corrupt_local_header_read_rejected": true + }, "esptool": { "image_sha256": "57c7723bbb04b780c42ca98e756f1706a1bf6bf874f6f748f4897475645a9079", "entry": "0x40080400",