mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-29 12:15:39 +00:00
Windows output replaced each guest GS memory instruction with UD2 and NOP fill without checking the decoded direct branch targets, so a branch past the first byte of such an instruction was converted and landed in the second UD2 byte or the NOP fill. A branch target strictly inside a trapped GS instruction is now refused with "Branch enters a guest GS instruction", the rule macOS applies since #7706 and this builder already applies to its FS rewrites. The branch targets are sorted before the trap loop, which runs before the PT_TLS early returns, so images without PT_TLS are covered; guest modules go through the same builder. A branch to the first byte still converts and reaches the UD2.