Repository navigation
Conversation
The syscall scan walks each executable segment linearly and any single undecodable byte failed the whole conversion with "Cannot decode instruction". Real PRXs carry data inside executable segments — jump tables, constants, handler tables — so ubiservices.prx of The Rogue Prince of Persia (PPSA28155) stops dead at bare 0F 78 (0xF72B9B), which is data, not an instruction: bare 0F 78 has no SSE4A meaning (EXTRQ needs 66, INSERTQ needs F2) and AMD64 has no VMREAD. CodeInstructionCollector's padded scan already treats such regions as data; the discovery walk now does the same behind an explicit opt-in: MakeInstructionScanner(progress, resyncUndecodable). Resync prefers the next 16-byte boundary preceded by two 0xCC bytes (a genuine instruction boundary after function padding) and advances one byte when none remains. SyscallScanner opts in — it only discovers and refuses, never rewrites. The default stays STRICT: Amd64OnlyConverter's rewrite walk must keep failing loudly on an undecodable byte, because silently leaving one unconverted would corrupt the output binary. converterFailureOffsets still passes unchanged. amd64_only_converter_tests gains scannerEmbeddedDataResync: embedded data no longer fails the resyncing scan, the instructions around it are still reported, a truncated non-zero tail resyncs instead of failing, and the strict default still refuses both. Unblocks PPSA28155 conversion. Fixes boykopovar#7547
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
I reproduced the Linux CI test failure on this head: the relinker-only build succeeds, but The conventions check also fails because the Validation here: Ubuntu Linux, GCC 12.2, Release; |
|
Verdict: defect. With resync on, a forbidden syscall that follows undecodable bytes is skipped and the conversion succeeds.
Both results are the same for the Linux default and Also reproduced on Windows:
On the four homebrew titles I have (PPSA99005, PPSA47402, PPSA99581, and PPSA99995 with its Wine modules), relinked for Windows, macOS/Rosetta and Linux, the outputs are byte-identical to AI-assisted: yes (Claude Code); results above were run on this machine. |
|
I reproduced the Linux CI test failure on this head: the relinker-only build succeeds, but The conventions check also fails because the Validation here: Ubuntu Linux, GCC 12.2, Release; |
|
@plokmklo This PR now conflicts with main in |
|
Thanks @oneandonlydean — I'll rebase onto current main and reconcile the
undecodable-data resync with the new unwind-range scanning in
IInstructionScanner / InstructionScanner / SyscallScanner so the two don't
conflict. Will push an update soon.
…On Sat, Oct 24, 2026 at 5:22 PM Dean ***@***.***> wrote:
oneandonlydean left a comment (boykopovar/AnyPS5#8042)
@plokmklo This PR now conflicts with main in
`core/relinker/codegen/include/codegen/IInstructionScanner.hpp`,
`core/relinker/codegen/src/InstructionScanner.cpp`,
`core/relinker/relinker/src/analysis/SyscallScanner.cpp`. Main’s
instruction scanner now takes unwind ranges and merges code ranges, while
this PR adds a resync flag in the same interface. Could you reconcile
undecodable-data resynchronization with the current unwind-range scanning
behavior?
--
Reply to this email directly or view it on GitHub:
#8042 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
What
The syscall scan walks each executable segment linearly and any single undecodable byte failed the whole conversion with
Cannot decode instruction. Real PRXs carry data inside executable segments — jump tables, constants, handler tables — soubiservices.prxof The Rogue Prince of Persia (PPSA28155) stops dead at bare0F 78(offset 0xF72B9B), which is data, not an instruction: bare0F 78has no SSE4A meaning (EXTRQ needs 66, INSERTQ needs F2) and AMD64 has no VMREAD.CodeInstructionCollector's padded scan already treats such regions as data; the discovery walk now does the same behind an explicit opt-in:MakeInstructionScanner(progress, resyncUndecodable). Resync prefers the next 16-byte boundary preceded by two0xCCbytes (a genuine instruction boundary after function padding) and advances one byte when none remains.SyscallScanneropts in — it only discovers and refuses, it never rewrites.The default stays STRICT:
Amd64OnlyConverter's rewrite walk must keep failing loudly on an undecodable byte, because silently leaving one unconverted would corrupt the output binary.converterFailureOffsetspasses unchanged.Tested
Ubuntu 24.04:
amd64_only_converter(newscannerEmbeddedDataResynccase: embedded data no longer fails the resyncing scan, surrounding instructions still reported, truncated non-zero tail resyncs, strict default still refuses both),relinker_conversion,sdk_mman_syscall,call_site_resolver,conversion_diagnosticsall pass. Cannot reproduce the PPSA28155 module itself (binary not available); the failing pattern is covered byte-for-byte in the new test.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)