Commit Graph

10 Commits

Author SHA1 Message Date
0148a635c1 int3_cause: fix load widths, high-byte regs, global writers, returns dedup, and int 29h flow (INT3-CAUSE-DECODE-AND-TRACE-FIXES) 2026-11-25 03:27:52 +01:00
2c5dfe4e42 Merge own/main: cl.exe fallback list, per-program translator errors, merge leftovers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:19:02 +00:00
cbc9ef4dbd Fix merge leftovers the Python suite found on own/main
Four tests failed on own/main but not on upstream main, or failed with more items:

- docs/runtime_imports.md had four copies of the owns_dll sentence, one per merged
  shim PR; one sentence now names every DLL (test_docs_repeated_lines).
- docs/README.md had two directstorage.md and two gameinput.md rows; keep the
  directstorage row that has zlib and upstream's gameinput row (test_docs_design_rows).
- test_ctest_registration only saw add_test(... COMMAND foo_test); the pipeline cache
  seed test is driven by a CMake script as $<TARGET_FILE:pipeline_cache_seed_test>,
  which ctest runs too.
- tools/int3_cause.py sets errors='replace' on stdout like the other tools
  (test_tool_stdout_encoding).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:16:27 +00:00
32d6a23043 int3_cause: say the return sources come from the paths the bounded search recovers
The search stops at a step and source limit, so "every path" overstated what it reads (review on #8408).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 21:35:20 +00:00
745062c3e9 int3_cause: index call, jump and store sources once per image
rel32_sources and global_writers scanned every code byte on each call,
and explain calls them at every level it follows (up to six scans per
level). On a 100 MB .text that is about 2 s a scan, so a stop with many
incoming jumps took minutes. Build two sorted indexes on first use
(target, rva, kind packed in one integer) and bisect them instead.
Results are the same matches in the same address order; a new test
checks every target against a full scan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 19:52:55 +00:00
b689ee5aad int3_cause: --returns, what a function returns over every path
For each ret, list every value that can reach it (constant, call
result, argument, global, stack slot) together with the branches that
set it, so a bool-returning setup function reads as "0 when X fails,
1 when Y succeeds". Path walking is shared with trace() through step().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:58:29 +00:00
bed6d34a26 int3_cause: --any for any instruction (a return-0 path, a fallback); constants keep their value
With --any the address may be any instruction: the guards are the branches
that decide whether it runs, and callers are not followed. A traced constant
now carries its value (mov r, imm in every width, xor r, r, mov r/m, imm).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:53:33 +00:00
86c335a50c int3_cause: follow a loaded pointer, and read a tested global at its stores
A load's pointer register is traced too (two levels). When the guard's value
comes from a global, or a field of an object a global points to, each
mov [rip+x], r / mov [rip+x], imm storing to that global is read for what it
stores (a call's result, a constant). Most title asserts test such a global
rather than a call's result directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:49:50 +00:00
8630afd1e5 int3_cause: follow a tested argument to the check's call sites; bt; block entry by its one jump
When the register a guard tests is one of the function's arguments (nothing
wrote it since the start, through copies, lea r,[r2+disp] and added
constants), each direct call site is read for what it passes, as a tally.
A block after a return or jump is entered through the one jump reaching it.
explain() now caps links after filtering them, so the not-followed count
is right.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:44:08 +00:00
8a314eed51 int3_cause: name the call whose result sends the executable to an int3, statically
tools/int3_cause.py <image> <address>... finds every branch that reaches the
int3 (also from other functions), reads its condition and follows the tested
register back to the import, vtable slot or function whose result it holds.
An int3 that ends a never-returning function is read at its call sites.
Synthetic PE tests; docs/boot.md points to it from LEONIDA_SKIP_INT3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:39:24 +00:00