loader: emulate the register forms of SSE4a EXTRQ and INSERTQ #467
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!467
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/467/head"
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?
@brandostrong on GitHub · 2026-09-02 21:50 UTC · original
brandostrong:fix/sse4a-register-forms→main· +42 −12 · 1 files · 1 commits · closed without mergingProblem. Astro Bot's asset unpacker executes register-form
extrq xmm2, xmm5(66 0f 79 d5) andinsertq. The emulator handled only the immediate forms, so the instruction trapped. A first attempt with swapped operands corrupted a register and crashed about a thousand flips later in libc.Change. Emulate the register forms per the AMD64 SSE4a specification: destination is ModRM.reg, the length/index descriptor is ModRM.rm, and the destination's upper qword is left untouched as the hardware does.
Effect. Astro Bot's unpack stage runs through with no register corruption (six further runs).
Verification. Verified against the game's own unpacker disassembly; loader tests pass.
References
EXTRQ(66 0F 78 /0 ib ib,66 0F 79 /r) andINSERTQ(F2 0F 78 /r ib ib,F2 0F 79 /r); destination is ModRM.reg, upper qword unchanged.@Nmzik on GitHub · 2026-09-17 07:17 UTC · original
Credited
Pull request closed