mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:45:22 +00:00
[GH-ISSUE #3767] [Bug] DOS MZ: table-dispatched handlers are invisible to procedure tools (352 of 540 functions) #1466
Open
opened 2026-10-16 21:05:43 +00:00 by bsakaguchi
·
2 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#1466
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?
Originally created by @max-freddyfire on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/3767
Before submitting
Area
Native analysis or decompilation
Observed behavior
On a 16-bit DOS MZ executable, Ghidra-backed analysis exposes 352 procedures, but the program has at least 540 executed functions. The 188 missing functions (about 15.5 KB of 47.3 KB of code, 33 %) are handlers reached only through runtime-filled tables. For those addresses every
procedure_*tool returnsnot_found("No procedure exists at the requested address"), andresolve_containing_procedurereturnsfound: false, reason: not_in_procedure. Nothing in REA can disassemble or decompile these handlers.Reproduction
open_binaryon an unpacked 16-bit DOS MZ program that dispatches throughCALL/JMP word ptr [reg+table], where the tables are filled at runtime withMOV word ptr [..], imm16.list_proceduresreturns 352 entries.procedure_assembly 0x14b0c(a handler written into a dispatch table by an immediate store) returnsnot_found. The same happens withread_function_instructionsandprocedure_info.resolve_containing_procedure 0x14b0creturnsnot_in_procedure.Ran it on the MCP interface.
rea analyzeon the CLI reports the same procedure count.Expected behavior
There is a supported way to analyze code that is reached only through indirect dispatch. For example, the caller declares function entry points, or REA follows immediate code pointers stored into known dispatch tables. Then
procedure_*tools work on those handlers. Until then, the gap stays an explicit limitation rather than a plainnot_found.Impact and scope
High for this target. Most of the game logic (combat, monster AI, hit handlers, script opcodes) sits in table-dispatched handlers that REA cannot see. We used an independent function inventory from a separate Ghidra headless run plus a custom emulator trace instead. Likely affects other real-mode programs that use runtime-filled jump tables. Not tested on other targets.
REA version
6.5.0
Runtime and platform
Linux (WSL2, kernel 6.18), Node.js 24.13.0, OpenJDK 21.0.12.1, Ghidra 12.1.4
Target and artifact context
Commercial 1991 DOS game executable, unpacked (PKLITE and EXEPACK removed) before analysis. Profile:
dos-mz,x86:LE:16:Real Mode, load segment 0x1000, linear addresses (1000:4B0C=0x14b0c). The binary cannot be shared.Interface
MCP
Earliest failure stage
Native analysis or reconstruction
Relevant output or evidence
list_procedures: 352 procedures (ev_74914008556906d9e95d7b522bfb2650438e66af56e1955ff24831296e6726d8).rea analyzegives the same count (ev_146659192996d094822a1f0b969371040ad26b5087dd4bbb3b5aa5a5d9d2df5b).resolve_containing_procedure 0x14b0creturnsnot_in_procedure(ev_1507e2fbd65089ce89cdf6cadb5f97e8a735c37bd59d35632c8fd0159ef052f7).resolve_containing_procedure 0x12fadreturnsnot_in_procedure(ev_4ad293cedbd7c1ba78ffbee8f3be2aec71b45391ce84b426dc4fe8e469e9d598).procedure_assembly,read_function_instructionsandprocedure_infoon0x14b0cand0x12debreturnnot_foundwith "No procedure exists at the requested address".Typed outcome or recovery expected
A typed limitation saying that the address holds no analyzed code, possibly reachable through indirect dispatch, plus a supported recovery path (declared entry points or table-following). This would replace a plain
not_foundthat hides that the bytes are unanalyzed code.Analysis or suspected cause
Source-derived, not verified inside REA. Ghidra's default auto-analysis does not treat 16-bit immediates stored into memory as code pointers. The handler bytes are therefore never disassembled, and no function is created. The table-filling stores are plain
MOV word ptr [..], imm16instructions at a handful of sites.Additional context
A related observation, not verified further:
procedure_pseudo_codeon one of these addresses falls back to treating the number as a file offset ("File offset 0x14b0c maps to analysis address 0x2360c, but no procedure ..."). That message is easy to misread as a different function.@max-freddyfire commented on GitHub (Oct 15, 2026):
Workaround that works on 6.5.0, measured on the same target. It is not a fix, and it has caveats that point at what a real fix needs.
Seeded
dos-comimage. Take the MZ code segment from1000:0100up to its end (1000:D7F0) and write it as a COM image. REA loads it at1000:0100(linear0x10100), so every address matches the original MZ analysis. Then patch 3 bytes:1000:0100becomes aJMPto a stub appended past the segment end. The stub has oneJNZ +3; CALL <entry>per known function entry and ends withRET. TheJNZmakes Ghidra follow both edges, so a no-return callee cannot cut the seeding short. The entry list came from an independent inventory: an earlier Ghidra headless run plus handlers derived from the dispatch tables.Result. 540 procedures (
ev_fb895bc731a0d4d40c2402773021074a173231b91365eb347014172f9676cc16), up from 352. 536 of 537 seeded entries became functions.procedure_assembly 0x12fad(ev_7125625bf492d368c3e5ae3045cee35779af65e913baa77458cbc9fb9d2629ca),procedure_pseudo_code 0x14b85(ev_43b46709551a1f416d76bd2259e6b4d43aee3fb23ca2127afcf0e101aa10f461) andprocedure_info 0x14298(ev_60b137c9afb40e21802ee022e64a6d505359939c380cb2b8df68941bcbe9ee97) now return the handlers.Caveats. These are why a supported path is still needed:
DS = CS = 0x1000. Memory operands keep the correct offsets, butDAT_1000_xxxxreally means the program's own data segment. The decompiler then constant-folds code bytes it believes are data and removes branches ("Removing unreachable block": 21 in one handler, 22 in another). Assembly is reliable, but pseudocode is not, for handlers that test data-segment flags.Tested, does not help:
annotate_native_function 0x12fadreturnsnot_found, because it requires an existing function.set_address_namecreates only a label.raw-binarywithentry_pointmaps file offset 0 to the entry, so addresses no longer match unless the image is sliced per handler.A caller-declared list of entry points on
open_binaryfor the original MZ, keeping the real data segment and the shipped-artifact subject, would remove all three caveats.@XinwangTao commented on GitHub (Oct 15, 2026):
Solid repro with hard numbers: 188 of 540 executed handlers are invisible purely because they are reached through runtime-filled dispatch tables, which makes 33% of code silent dead-zone for every procedure_* tool. The root cause is clear — table destinations are data until something tracks the immediate stores that fill them. Agree the most practical fix is a declared-entry-point mechanism (caller marks handler addresses, or rea follows immediate pointers written into known tables); that is exactly how REA already treats other indirect control flow, so it fits the model. Worth also reporting the count of unresolved indirect-dispatch targets in the analysis summary, so analysts know the gap exists instead of discovering it per-address.