mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:45:22 +00:00
[PR #3092] [CLOSED] fix(hopper): prepare verified thin FAT32 slices for arm64 analysis #5610
Closed
opened 2026-10-31 01:07:57 +00:00 by bsakaguchi
·
0 comments
No Branch/Tag specified
main
codex/procedure-reference-stacked
release-please--branches--main--components--rea-agents
release-please--branches--main--components--rea-agents--release-notes
codex/kuna-independent-retry
codex/byte-search-overlay-coverage
codex/open-failure-target-receipt
codex/kuna-xref-evidence
codex/ghidra-ambiguous-procedure-recovery
codex/function-source-bundle
codex/trace-function-integration-prototype
codex/snapshot-source-closure
codex/recorded-evidence-array-pages
codex/evidence-recovery-redesign
codex/trace-feature-address-scope
codex/call-discovery-scope
codex/ghidra-literal-candidate-evidence
codex/decompile-directory-independent-retry
codex/retry-provenance-base
codex/value-flow-capability-experiment
codex/ghidra-containing-instruction
cursor/readme-discord-button-ef9f
dependabot/github_actions/actions/setup-node-7.1.0
dependabot/github_actions/actions/upload-artifact-7.0.2
dependabot/npm_and_yarn/npm-minor-and-patch-d8d97ce6df
codex/kuna-1989
fix/8559-native-ui-fixture-ownership
fix/8555-go-verifier-mcp-ownership
codex/provider-capability-recovery
fix/8642-rizin-target-stdin
codex/ghidra-memory-effect-scope
codex/ghidra-annotation-entry-selector
codex/ghidra-readonly-recovery
codex/ghidra-regex-verifier-recovery
codex/evidence-discovery-view-guidance
fix/8545-bulk-append-overflow
fix/8428-navigation-refusal-alternatives
codex/address-context-recovery
codex/matching-member-limitations
codex/unknown-scope-contract
codex/evidence-view-guidance
feat/8373-native-trace-views
codex/ghidra-snapshot-verifier-binding
codex/elf-export-visibility
codex/evidence-view-recovery
codex/native-reference-cli-help
codex/provider-candidate-observation-scope
codex/kuna-session-verification
codex/ghidra-switch-lifetime-guidance
codex/pseudocode-paging-discovery
codex/clarify-evidence-view-support
codex/kuna-xrefs-selector-recovery
codex/context-capacity-recovery
codex/evidence-closure-large-links
codex/same-function-evidence-identity
codex/ghidra-verifier-inspected-jdk
codex/audit-guided-workflows
codex/crash-prompt-retained-dossiers
codex/analysis-view-error-recovery
codex/kuna-verifier-target-selection
codex/ghidra-selected-project-call-coverage
codex/docs-native-analysis-scope
codex/ghidra-java-socket-boundary
codex/ghidra-retained-snapshot-verifier
codex/ghidra-search-inventory-facts
fix/8284-zero-argument-parameter-bindings
fix/8198-ui-action-handler-offset
fix/8257-elf-entry-label-identity
fix/8304-deferred-output-schema-projection
fix/8277-call-path-computed-target-uncertainty
fix/pr-8089-conflicts
fix/ci-static-duplicate-export
dependabot/npm_and_yarn/lint-staged-17.6.0
dependabot/github_actions/actions/download-artifact-8.0.2
dependabot/npm_and_yarn/write-file-atomic-8.0.0
dependabot/npm_and_yarn/canonicalize-5.1.0
dependabot/github_actions/actions/cache/restore-6.1.0
dependabot/npm_and_yarn/toon-format/toon-4.4.0
dependabot/github_actions/actions/deploy-pages-5.0.1
codex/review-fixes-pr-2403
codex/review-fixes-pr-2400
codex/process-terminal-width
codex/test-brittleness-cleanup
verify/7167-browser-connect-macos
fix/7167-browser-connect
feat/native-matching-allowance-setting
feat/browser-scenario-dry-run
test/managed-caller-parameters-20261024
codex/parser-fortythird-boundaries
fix/6926-pinvoke-platform-decorations-20261023
fix/6889-har-body-encoding-20261023
fix/6888-sqlite-schema-budget-20261023
fix/dependency-security-gates-6708
cursor/evidence-overwrite-rebase-b4ac
feat/4057-verify-native-exports
fix/windows-acl-observer-overhead-20261022
cursor/erlang-beam-restack-4476
cursor/pe-certificate-review-bf32
fix/6116-javascript-application-fs-errors
fix/6061-unmapped-runtime-script-unknown
feat/browser-scenario-summary
fix/pe-certificates
codex/verify-3407
cursor/rebase-5699
cursor/rebase-5352
cursor/rebase-5600
cursor/fix-cli-schema-omission-10a8
codex/audit-hopper-shutdown-reasons-20261021
fix/demangle-swift-omitted-record
fix/nib-boolean-value-types
cursor/cancellation-partial-observation-a5ac
fix/ib-object-limit-reasons
fix/electron-fuse-limit-advice
fix/kuna-doctor-dangling-cache
fix/fixed-budget-refusal-advice
fix/js-ipc-listener-dedup
fix/js-return-member-provenance
fix/dmg-integrity-retry-advice
fix/ida-doctor-readiness
fix/kuna-version-probe-output-drain
fix/legacy-swift-runtime-name-matching
fix/dylib-lazy-load-commands
fix/browser-scenario-startup-cancel
fix/swift-nested-punycode-classification
fix/compare-unselected-scopes
fix/objc-method-budget-coverage
fix/dmg-mounted-root-observations
audit/ci-tests-20261019-round2
release/6.7.0
fix/wabt-cleanup-retry-resolution
fix/electron-fuse-elf-pe-architecture
fix/native-plist-descriptor-ownership
fix/kuna-caller-cleanup-ownership
experiment/atomic-codemode-20261016
review/first-contributor-3776
fix/call-resolution-full-read-cycles
fix/member-mutation-selection-repeat
experiment/atomic-re-tools-20261015
perf/member-mutation-lazy-origins
perf/static-network-mutation-index
fix/hopper-startup-lifecycle
audit/3050-windows-proof-20261015
feat/windows-window-capture-2183
audit/3049-windows-proof-20261015
audit/3735-macos-fixtures-20261015
fix/batch-decompile-null-pseudocode
fix/kuna-inventory-honors-jobs
experiment/browser-codemode-tool-design-20261015
fix/hopper-clean-runtime-argv
codex/review-2049-27f1b367
review-fixes/pr-2787-routing
fix/3360-scoped-this-emitters
fix/3367-replaced-global-effects
fix/3838-compact-any-value-items
test/hopper-download-probe-20261015
codex/windows-runtime-creation-red-green-20261015
codex/windows-readonly-root-red-green-20261015
codex/windows-root-share-red-green-20261015
codex/exp-1685-win-mcp-startup
codex/bug-sweep-20261015
investigate/2190-windows-package-phases
investigate/3543-macos-cli-deadline
perf/3281-reverse-tools-feedback-quality
fix/3406-hopper-doctor-fixture
fix/3341-wrapper-require-test-context
fix/3301-owned-uninstall-fixtures
fix/3164-compiler-input-ownership
fix/pcap-cleanup-stdout-newline-20261014
perf/interface-builder-summary
codex/review-fixes-pr-1977
fix/ghidra-effective-jvm-platform
fix/docs-turkish-rust-link-20261013
fix/main-maintenance-ci-20261010
fix/recover-binary-session-process-effects
codex/review-fixes-pr-2457
codex/ci-required-cancellation-gate
fix/main-format-baseline-20261013
fix/setup-preserve-entry-fields
cursor/restore-main-checks-1ffc
fix/ghidra-bridge-hashmap-import
codex/shared-ci-jadx-json-default-20261013
codex/shared-ci-ghidra-test-groups-20261013
codex/shared-ci-java-fixture-format-20261013
codex/fix-intrinsic-invocation-boundaries
test/release-preflight-reusable-jobs
test/js-parameter-provenance-expectation
fix/linux-hopper-verification-current
test/2419-ghidra-elf-probe-size
followup/pr-1544-native-ida
codex/fold-pr-2230-contribution
docs/readme-responsible-use
fix/issue-2064
fix/issue-2050
fix/issue-2053
fix/issue-1968
fix/issue-1945
experiment/codemode-bridge-20261011
fix/tool-effects-negative-wording-1904-20261012
fix/1842-electron-interop-provenance
feat/recover-javascript-multi-input
refactor/website-i18n-prep
fix/nativeaot-pe-virtual-extent
fix/browser-verifier-ci-hang
fix/pe-resources-input-selection
docs/beginner-friendly-guides
docs/beginner-setup-guide
fix/javascript-analysis-worker-1563
fix/1649-ghidra-duplicate-names
fix/javascript-export-keys-integration-1369
test/maintenance-boundary-contracts-20261011
review/javascript-export-keys-1369
review/process-live-progress-1483
test/javascript-1495-growth-ratio
fix/ci-escape-timing
docs/normalized-terminal-geometry-1450
release/6.3.0
archive/release-6.3.0-pr1381
release/6.2.0
fix/electron-preload-dynamic-override
fix/javascript-self-referential-bundler-edges
release/6.1.0
cursor/grok-client-cherry-pick-0b56
feat/signature-posture
feat/dyld-shared-cache
feat/artifact-integrity-policy
feat/pkg-inventory
release/6.0.0
chore/sync-release-5.0.0
release/5.0.0
cursor/cloud-agent-node-787e
fix/javascript-xhr-open-endpoints
review/pr-711-realpath-fallback-wording
cleanup/replay-confinement
codex/test-suite-performance
codex/issue-foundations
codex/address-open-issues-2026-07-20
agent/javascript-vite-rollup-esbuild-adapters
agent/process-cleanup
agent/triage-integration
agent/unknown-commands-registry
feat/mcp-identity-metadata
morlvps/issue_cleanup
codex/installer-redesign
morl/roadmap-investigation-core
morl/roadmap-investigation-docs
release-please--branches--main--components--rea
rea-agents-6.8.0
rea-agents-6.7.0
rea-agents-6.6.0
experiment/atomic-codemode-wait-runtime-20261016
rea-agents-6.5.0
rea-agents-6.4.0
rea-agents-6.3.0
rea-agents-6.2.0
rea-agents-6.1.0
rea-agents-6.0.0
rea-agents-5.0.0
rea-agents-4.1.0
rea-agents-4.0.1
rea-agents-4.0.0
rea-agents-3.2.1
rea-agents-3.2.0
rea-agents-3.1.0
rea-agents-3.0.0
rea-agents-2.7.0
rea-agents-2.6.0
rea-agents-2.5.1
rea-agents-2.5.0
rea-agents-2.4.0
rea-agents-2.3.0
rea-agents-2.2.0
rea-agents-2.1.0
rea-agents-2.0.0
rea-agents-1.7.0
rea-agents-1.6.0
rea-agents-1.5.0
rea-agents-1.4.0
rea-agents-1.3.0
rea-agents-1.2.0
rea-agents-1.1.0
rea-agents-1.0.0
rea-agents-0.5.0
rea-agents-0.4.0
rea-agents-0.3.0
rea-0.2.1
rea-0.2.0
Labels
Clear labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
Mirrored from GitHub Pull Request
question
roadmap
triage
No labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
question
roadmap
triage
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
morluto/rea#5610
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/morluto/rea/pull/3092
Author: @akushonkamen
Created: 10/14/2026
Status: ❌ Closed
Base:
main← Head:fix/hopper-fat32-arm64e-slice📝 Commits (2)
e963c0bfix(hopper): prepare verified thin FAT32 slices for arm64 analysis75ee283merge: restore JavaScript analysis regression checks from main📊 Changes
6 files changed (+435 additions, -43 deletions)
View changed files
📝
docs/installation.md(+11 -6)📝
src/hopper/HopperAnalysisProfile.test.ts(+71 -1)📝
src/hopper/HopperAnalysisProfile.ts(+1 -1)📝
src/hopper/HopperMachOImage.test.ts(+286 -4)📝
src/hopper/HopperMachOImage.ts(+65 -30)📝
src/hopper/HopperProvider.ts(+1 -1)📄 Description
Summary
On Apple-silicon macOS, system binaries (
/bin/*,/usr/bin/*) are FAT32 Mach-O containers whose arm64-family slices include Apple'sarm64e.x1variant (cpusubtype 12). REA loaded such containers through Hopper's implicit-l FATslice choice, which selectsarm64e.x1for an--aarch64target. That slice's function entries encodepacibsppc(0xdac1a7fe), which plain arm64 cannot decode, so Hopper's recursive descent aborts at every function entry and system binaries produce almost no code procedures —/bin/echoyields 5 import stubs instead of its 3 real functions,/bin/pwdyields a mis-alignedsub_10000058cat entry +4.Fixes #3072
Problem and expected behavior
Smallest trigger: open a stripped Apple-system FAT Mach-O (
lipo -archs /bin/echo→x86_64 arm64e arm64e.x1) with the Hopper provider on arm64 macOS and request a function.Violated invariant: an arm64 target must be analyzed from a slice whose entry encodings decode under Hopper's
--aarch64. Thearm64eslice (cpusubtype 2) holdspacibsp(0xd503237f, a decodable HINT-class NOP) at the same offsets wherearm64e.x1holdspacibsppc; REA'sread_bytesconfirmed the loaded bytes matched the.x1slice exactly. The session then failed closed withNo procedure exists at the requested address— correct REA behavior on top of an unusable slice choice.Expected behavior: for arm64 targets on FAT containers, REA prepares a verified thin image of a decodable slice (preferring cpusubtype 0, then 2;
arm64e.x1only when it is the arm64 family's only candidate) and loads it through the already-working thin Mach-O route, the same one the issue reporter validated with thelipo -thin arm64eworkaround against Hopper 6.6.0-demo (/bin/echo: 5 stubs → 11 procedures,analyze_function 0x1000004f0→EntryPointwith pseudocode;/bin/pwdboundary corrected to0x588).Change and scope
src/hopper/HopperMachOImage.ts:resolveHopperMachOImagenow accepts all four FAT magic values (FAT32 big/little-endian, FAT64 big/little-endian), sizes architecture-table entries at 20 bytes for FAT32 and 32 for FAT64, and applies the existing per-slice validation (range, alignment, embedded Mach-O identity, overlap; the reserved field check stays FAT64-only) to both container widths. NewselectHopperSlicereplaces "single match only": forarm64targets it prefers cpusubtype 0 then 2 within the matched family (each preference applies only when exactly one slice carries it; more than one stays fail-closed), andarm64e.x1is selected only when it is the family's sole candidate. Every non-arm64 ambiguity, and the no-match case, keep the previous fail-closed error. Committed method recordsfat32_thin_sliceorfat64_thin_slice.prepareHopperMachOImage: the table-identity hash window is sized by container width (20- vs 32-byte entries) so the copy-time verification covers the same table it validated; streaming copy, whole-source SHA-256, and identity checks are unchanged.src/hopper/HopperAnalysisProfile.ts: the prepared-image path triggers formachoContainer === "fat32" || "fat64"(previously FAT64 only) when no loader-arguments override is configured. The profile keepsmacho_containerand now surfaces the selected slice'scpu_type/cpu_subtypeviaprepared_image, making the hidden slice choice from the issue visible (issue suggestion 3).-l Mach-O --aarch64) instead of[-l, FAT, --aarch64, -l, Mach-O];HopperFileOffsetneeds no change because it already re-maps offsets by matching Hopper's loaded header on cpu type/subtype, andHopperProvider/BridgeLauncherconsume the chain method-agnostically.HopperProvider.tswording updates "FAT64" to "FAT" in the prepared-image notice.docs/installation.md: documents FAT32+FAT64 preparation, the arm64 cpusubtype preference order, and that other ambiguous subtypes still require an explicitly extracted thin image.Existing pattern harvested: this fix deliberately reuses the repo's established FAT64 thin-slice preparation pattern (validate table + selected header → commit source coordinates → stream a private thin copy with whole-source SHA-256 verification), introduced in #2201, and only generalizes it to FAT32 containers plus the cpusubtype preference the issue requests; no new mechanism is introduced.
Follow the contribution scope:
Contract and boundary impact
src/hopper/HopperMachOImage.ts(FAT image resolution/preparation) consumed bysrc/hopper/HopperAnalysisProfile.tsprofile construction before Hopper launch.prepared_image.methodwidens from the literal"fat64_thin_slice"to"fat32_thin_slice" | "fat64_thin_slice";binary_overview/inspectprofiles for FAT32 targets now carryprepared_imagewith the selected slice'scpu_type/cpu_subtypewhere none appeared before.docs/public/product-catalog.json), package, or installation impact: none (no tool catalog or package changes;docs/installation.mdis authored documentation).Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
(Prepared images write a private temp copy of the target slice — file creation only, within the existing prepared-image lifecycle.)
Evidence and regression coverage
src/hopper/HopperMachOImage.test.ts: 10 new FAT32 regression tests — table parsing in both byte orders, per-slice range/alignment/embedded-Mach-O validation,fat32_thin_slicemethod stamping, arm64 cpusubtype preference (0 > 2 > x1-only), fail-closed on ambiguity/missing slices, andprepareHopperMachOImagesizing the table-identity hash by container width.src/hopper/HopperAnalysisProfile.test.ts: 1 new FAT32 profile regression — a FAT32 executable target now resolvesprepared_imagewithcpu_type/cpu_subtypeand thin loader arguments instead of[-l, FAT, --aarch64, -l, Mach-O]with noprepared_image.[-l, FAT, --aarch64, -l, Mach-O]with noprepared_imagefor a fat32 target (assertion diff atHopperAnalysisProfile.test.ts:79). Restoring the fix turns the same command green. The real-provider failure mode itself (implicit-l FATselectingarm64e.x1,pacibsppcentries, 0/mis-aligned procedures) is established by the issue reporter's byte-level evidence and the verifiedlipo -thin arm64eworkaround on Hopper 6.6.0-demo.prepared_image(methodfat32_thin_slice, source coordinates,cpu_type/cpu_subtype) and the prepared-image provenance notice replaces the implicit FAT-load path;analyze_functionon Apple system binaries returns real procedures instead ofNo procedure exists at the requested address.verify:hopper:fatwith an installed Hopper.For evidence-bearing changes:
Validation performed
npm run test:local -- src/hopper/HopperMachOImage.test.ts src/hopper/HopperAnalysisProfile.test.ts— on pre-fix sources (checked out from the parent commit on the rebased branch): 2 files failed, 12 failed | 2 passed (14), all 11 new FAT32 regressions red; with the fix: 14 passed (14). Both runs on the rebased base.npm run test:local -- src/hopper/HopperAnalysisProfile.test.ts src/hopper/HopperCleanup.test.ts src/hopper/HopperMachOImage.test.ts src/hopper/HopperProcessDiagnostic.test.ts src/hopper/HopperProvider.test.ts src/hopper/HopperProviderDiscovery.test.ts src/hopper/HopperRequestQueue.test.ts src/hopper/HopperTargetLease.test.ts src/domain/binaryTarget.test.ts src/native/AppleDispatchMetadata.test.ts— 10 files passed, 143 passed (143), after the rebase.npm run check:fast— 2 successful, 2 total (turbo typecheck + lint), after the rebase. First attempt failed in theprecheck:fastdependency check (saxes: missing from the installed dependency lockfile) because the branch moved onto a base that addssaxes; resolved by runningnpm cias instructed, then re-running green.npm run docs:check— exit 0 (includes check-doc-facts and the readmeConsistency suite, 5 passed), after the rebase.npx oxfmt --checkon the six changed files (docs/installation.md,src/hopper/HopperAnalysisProfile.ts,src/hopper/HopperAnalysisProfile.test.ts,src/hopper/HopperMachOImage.ts,src/hopper/HopperMachOImage.test.ts,src/hopper/HopperProvider.ts) — all matched files use the correct format.npm run check:pr: the full local gate is optional for changes of this width perAGENTS.md("optional for broad changes or CI diagnosis"); CI owns the full deterministic suite.verify:hopper:fat: no Hopper installation on this machine (nothing matching Hopper in/Applications,~/Applications, or onPATH). Real-provider FAT32 behavior is anchored to the issue reporter's verifiedlipo -thin arm64eworkaround against Hopper 6.6.0-demo; a maintainer or the reporter should run the real lane before merge.scripts/check_comment_history.pyandscripts/check_brand_name.py, do not exist in this repository (no matches in the tree); the repository's own gates above were run instead.Compatibility, safety, and release
Before merge
type(scope): outcome.(One follow-up for review: the real-Hopper FAT32 lane
verify:hopper:fatstill needs to run where Hopper is installed — flagged above rather than claimed as done.)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.