diff options
| author | kett1m <benho0@proton.me> | 2026-11-25 02:35:47 +0100 |
|---|---|---|
| committer | kett1m <benho0@proton.me> | 2026-11-25 02:35:47 +0100 |
| commit | 2f44dc4861d8adb093918c0ad692cd68f60b883a (patch) | |
| tree | 1b2006c522b67d1cace5a8f6199d23a379e77496 /runtime/src/xma2_decoder.cpp | |
| parent | b4b7756e8c64e7ae8b310288d543db0e428c0796 (diff) | |
x64_recomp: in/out immediate ports need their imm8 byte (X64-RECOMP-IN-IMM8)
The primary table gives `E4`, `E5`, `E6` and `E7` the operand shape `sys`, so the decoder
consumed only the opcode and reported one byte. These are the immediate-port forms of `in`
and `out` (`E4 ib` = in al,imm8, `E5 ib` = in eax,imm8, `E6 ib` = out imm8,al, `E7 ib` =
out imm8,eax): each takes one immediate byte, so the instruction is two bytes and the walk
was one byte short, reading the port number as the next opcode. The `EC`-`EF` DX-port forms
do take no immediate and are left alone.
A per-instruction differential against objdump over the retail image's `.text`
(`game_scarlett_master.exe`, SHA-256
`e95020b2fa4a721db3df59fdecf75621730ac559d8835252f6c3b658d5a08993`, 26,674,180
instructions) finds the form used twice, at RVAs `0x55f2ed4` and `0x564652c`; both were one
byte short of objdump's two. The fix takes the mismatch count from 52,638 to 52,636 and adds
no signature. `docs/mobile.md` records the measurement, the two offsets and the REA
`gnu.objdump` section-header evidence.
Test: tests/test_x64_recomp.py::DecodeTests::test_in_out_immediate_port_consumes_imm8 fails
before the fix (the first case decodes to size 1) and passes after, covering `E4`-`E7` and
the one-byte `EC`-`EF` forms.
Diffstat (limited to 'runtime/src/xma2_decoder.cpp')
0 files changed, 0 insertions, 0 deletions