mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 00:22:57 -05:00
DecodeInstruction returned before reading the ModRM of FF /3 and FF /5, so a far CALL or JMP through a RIP-relative pointer had no RIP-relative displacement. A stub that moved such a JMP copied the displacement without relocating it. The decoder was compared with iced-x86 (AMD decoding) over 3.99 million encodings: every opcode of the legacy, 0F, 0F38 and 0F3A maps under 34 prefix combinations and the VEX 0F, 0F38 and 0F3A maps, each with 48 ModRM forms. Apart from this, it agrees on length, RIP-relative offset, control flow kind and branch target for every valid Zen 2 instruction except near branches with a 66 prefix, recorded as technical debt, and kernel-only returns, which it treats as sequential. Add the comparison's metadata as cases: one RIP-relative encoding per opcode, map and immediate size, every FF /r form, and the branch forms with their flow kind and target. The existing cases check lengths only; a loop or jrcxz decoded as an unconditional jump passed the whole suite.