mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:50:52 +01:00
[PR #1503] int3_cause: fix load widths, high-byte regs, global writers, returns dedup, and int 29h flow (INT3-CAUSE-DECODE-AND-TRACE-FIXES) #1531
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1531
Loading…
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/ubiquitarianism/leonida/pull/1503
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/int3-cause-decode-and-trace📝 Commits (1)
0148a63int3_cause: fix load widths, high-byte regs, global writers, returns dedup, and int 29h flow (INT3-CAUSE-DECODE-AND-TRACE-FIXES)📊 Changes
2 files changed (+238 additions, -31 deletions)
View changed files
📝
tests/test_int3_cause.py(+150 -0)📝
tools/int3_cause.py(+88 -31)📄 Description
Claimed in the coordination issue as: INT3-CAUSE-DECODE-AND-TRACE-FIXES (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7150689690)
What and why
Fixes seven decoding, register-tracing, and global-writer bugs in
tools/int3_cause.py:LOAD_OPS(load_bitsinstep):step()previously passed64 if insn.wide else 32tomemory_name(), reportingbyte(0x8A,0x1B6,0x1BE),word(0x1B7,0x1BF,66 8B), andmovsxd(0x63, always a 32-bitdwordload) asdword/qword.ah/ch/dh/bh) without REX: addsinsn_writes()and usesgpr(..., 8, insn.rex)instep()(0x88,0x8A,0x1B6,0x1BE),global_writers()(0x88), andcall_name()so encodings4..7without a REX prefix map torax..rbxrather thanrsp..rdi(while preservingspl..dilwhen a REX prefix is present).stores_to()andglobal_writers()validation + 16-bit immediate stores:stores_to()now indexes66 C7 05 <disp32> <imm16>(mov word [rip+x], imm16) in addition to 32-bitC7 05, and checks full immediate bounds within the section.global_writers()now verifies that the decoded instruction atat - backis actually a RIP-relative store targetingtarget(op in (0x88, 0x89, 0xC6, 0xC7),base == RIP,insn.target == target, and/0forC6/C7) instead of accepting unrelated instructions whose payload bytes match89 05 <disp32>, and deduplicates RVAs.trace_paths()andreturns()distinct argument deduplication: includesr.get("argument")in_source_key()so a function returning e.g.rcx(arg 1) on one path andrdx(arg 2) on another no longer collapses both to(None, "argument")and silently drops the second argument.falls_into()matchesdoomed_code()onint 29h(0xCD): treats0xCD(__fastfail) as non-falling-through infalls_into()sotrace()/trace_paths()follow the jump entering a block afterint 29hinstead of falling back across it.flags_setter()andread_test()gaps: skips flag-neutralpush imm(0x68/0x6A),push r/m(0xFF /6),xchg eax, r(0x91..0x97),mov moffs(0xA0..0xA3), andbswap(0x1C8..0x1CF) inflags_setter(); accepts0xF6/0xF7 /1(matchinggdk_runtime_calls.decode) and reads unsignedraw[-1]forbt r/m, imm8(0x1BA /4) inread_test().0Xaddresses and large-image index packing: accepts0Xinparse_address()and avoidsarray("Q")overflow when2 * _shift - 2 > 64(size_of_image >= 2^31).Tested
python3 -I tests/test_int3_cause.py: 22/22 OK (7 new regression tests inInt3CauseEdgeFixesTest).main(3ff2a2adc): all 7/7 new tests inInt3CauseEdgeFixesTestfail (failures=11, errors=3).python3 -I tests/test_gdk_runtime_calls.py: 23/23 OK.python3 -I tests/test_text_write_line_endings.py: 3/3 OK.python3 -I scripts/check_no_game_data.py tools/int3_cause.py tests/test_int3_cause.py: clean.python3 -m compileall -q tools/int3_cause.py tests/test_int3_cause.py: clean.GPUs tested: n/a (CPU/PE static analysis tool only)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — no translator rule changed)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.