mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-28 12:05:06 +00:00
The framer's tests check its sites, stub bytes and moved displacements, but nothing yet showed that framed code survives a write below rsp. red_zone_framer_execution frames synthetic leaves with FrameRedZoneFunctions in a writable and executable buffer, writes the moved displacements and the stubs as Conversion.cpp and the trampoline builders do, and calls each leaf with the trap flag set. A SIGTRAP handler fills [rsp-0x80, rsp) of the interrupted context at every instruction, as Windows exception dispatch may. Five leaves each loop over slots they spilled, so a clobbered slot changes the result: #5640's frameless shape, a leaf reaching 0x28 below rsp, a leaf that also reads its saved rbx at +0x10 (moved in place), a leaf that takes the address of a slot below rsp (shifted by the whole red zone), and the inflate_fast-shaped leaf that allocates with sub after six pushes. Each must return the right value unframed without the clobber and a wrong one with it, and the right value framed with it. The test is built and registered on Linux x86-64 only; elsewhere its main returns 77.