Relinker: ubiservices.prx conversion fails on 0F 78 while preparing The Rogue Prince of Persia (PPSA28155) #7547

Closed
opened 2026-10-18 13:05:57 +00:00 by THEMANnt · 6 comments
THEMANnt commented 2026-10-18 13:05:57 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-18T13:05:57Z.


Summary

The Rogue Prince of Persia cannot be prepared on unmodified main because instruction scanning stops in Media/Plugins/ubiservices.prx:

FAIL: Cannot decode instruction: Unsupported 0F 78 opcode without SSE4A prefix (offset 0xf72b9b)

The same command failed at the same module and offset on both attempts, returning exit code 2. The game has not been launched.

Tested setup

  • Title: The Rogue Prince of Persia, PPSA28155, content version 01.006.000.
  • AnyPS5: main 9caecfd2d5a822be9daf84c69c7c33c7fafe52b9, no tracked source changes or extra patches.
  • Host: Windows 11 Pro x64, build 26200; Ryzen 7 7800X3D.
  • Build: Release, WinLibs GCC 15.2.0 r7.
  • Inputs: existing plain ELF executable and twelve bundled PRX modules. All thirteen passed ELF program-segment range and alignment checks. This structural check does not establish whether the bytes at the failing offset are executable instructions.
  • Original game metadata retained; no module, instruction, import or syscall was skipped.

Reproduction

With the title's ELF modules in their original relative directories:

relinker.exe --windows --windows-diagnostics --registry --module-dir Media/Modules --module-dir Media/Plugins <source>/eboot.bin <runtime>/rogue-prince.exe

The executable and earlier modules are processed, then the conversion stops while scanning ubiservices.prx.

Relevant log excerpt:

PRX conversion         | libresonanceaudio.prx    |  83% (10/12)
Instruction scan       | libresonanceaudio.prx    | 100%
Syscall scan           | libresonanceaudio.prx    | 100%

PRX conversion         | libresonanceaudio.prx    |  91% (11/12)
PRX conversion         | ubiservices.prx          |  91% (11/12)
Instruction scan       | ubiservices.prx          |   0%
FAIL: Cannot decode instruction: Unsupported 0F 78 opcode without SSE4A prefix (offset 0xf72b9b)

Expected / actual

Expected: complete conversion of the title and its bundled modules so runtime testing can begin.

Actual: deterministic conversion failure before launch. The error originates from core/relinker/codegen/src/x86/X64InstructionDecoder.cpp. Whether this is an unsupported instruction, instruction-boundary problem, or scanning non-code bytes has not yet been established. No title-specific workaround is proposed.

Input identification for ubiservices.prx:

  • Size: 23,454,948 bytes
  • SHA-256: 6b1869b26fc872ad244ab9e8514906619ccf2c6b2c9509a5fb880ec36d376e4a

Searched existing issues and PRs for the exact error, ubiservices, and PPSA28155; no matching report was returned. No game binaries or assets are attached.

AI-assisted preparation/testing/report: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5909824915 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7547). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-18T13:05:57Z. --- ## Summary The Rogue Prince of Persia cannot be prepared on unmodified main because instruction scanning stops in `Media/Plugins/ubiservices.prx`: ```text FAIL: Cannot decode instruction: Unsupported 0F 78 opcode without SSE4A prefix (offset 0xf72b9b) ``` The same command failed at the same module and offset on both attempts, returning exit code 2. The game has not been launched. ## Tested setup - Title: **The Rogue Prince of Persia**, **PPSA28155**, content version **01.006.000**. - AnyPS5: main `9caecfd2d5a822be9daf84c69c7c33c7fafe52b9`, no tracked source changes or extra patches. - Host: Windows 11 Pro x64, build 26200; Ryzen 7 7800X3D. - Build: Release, WinLibs GCC 15.2.0 r7. - Inputs: existing plain ELF executable and twelve bundled PRX modules. All thirteen passed ELF program-segment range and alignment checks. This structural check does not establish whether the bytes at the failing offset are executable instructions. - Original game metadata retained; no module, instruction, import or syscall was skipped. ## Reproduction With the title's ELF modules in their original relative directories: ```text relinker.exe --windows --windows-diagnostics --registry --module-dir Media/Modules --module-dir Media/Plugins <source>/eboot.bin <runtime>/rogue-prince.exe ``` The executable and earlier modules are processed, then the conversion stops while scanning `ubiservices.prx`. Relevant log excerpt: ```text PRX conversion | libresonanceaudio.prx | 83% (10/12) Instruction scan | libresonanceaudio.prx | 100% Syscall scan | libresonanceaudio.prx | 100% PRX conversion | libresonanceaudio.prx | 91% (11/12) PRX conversion | ubiservices.prx | 91% (11/12) Instruction scan | ubiservices.prx | 0% FAIL: Cannot decode instruction: Unsupported 0F 78 opcode without SSE4A prefix (offset 0xf72b9b) ``` ## Expected / actual Expected: complete conversion of the title and its bundled modules so runtime testing can begin. Actual: deterministic conversion failure before launch. The error originates from `core/relinker/codegen/src/x86/X64InstructionDecoder.cpp`. Whether this is an unsupported instruction, instruction-boundary problem, or scanning non-code bytes has not yet been established. No title-specific workaround is proposed. Input identification for `ubiservices.prx`: - Size: **23,454,948 bytes** - SHA-256: `6b1869b26fc872ad244ab9e8514906619ccf2c6b2c9509a5fb880ec36d376e4a` Searched existing issues and PRs for the exact error, `ubiservices`, and `PPSA28155`; no matching report was returned. No game binaries or assets are attached. AI-assisted preparation/testing/report: **yes**.
MarcZX10 commented 2026-10-18 13:07:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T13:07:10Z.


I checked the scanner and decoder path. The current scanner treats the ELF executable section as a linear instruction stream and aborts on an unsupported opcode; it cannot distinguish function bytes from embedded data at that point. The report itself notes that the failing offset may be non-code or an instruction-boundary error, so changing opcode handling now could mask malformed code or incorrectly interpret data. Could you share the section/program-header mapping for file offset 0xf72b9b and a short disassembly (including bytes before the reported offset), ideally from a second decoder such as Capstone/objdump? That would tell us whether this is a missing VMX instruction decode or a scan-boundary problem before anyone makes a general fix.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6250281337 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7547#issuecomment-6250281337). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T13:07:10Z. --- I checked the scanner and decoder path. The current scanner treats the ELF executable section as a linear instruction stream and aborts on an unsupported opcode; it cannot distinguish function bytes from embedded data at that point. The report itself notes that the failing offset may be non-code or an instruction-boundary error, so changing opcode handling now could mask malformed code or incorrectly interpret data. Could you share the section/program-header mapping for file offset `0xf72b9b` and a short disassembly (including bytes before the reported offset), ideally from a second decoder such as Capstone/objdump? That would tell us whether this is a missing VMX instruction decode or a scan-boundary problem before anyone makes a general fix.
THEMANnt commented 2026-10-18 15:51:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-18T15:51:03Z.


Thanks, @MarcZX10 — I checked this using GNU readelf/objdump 2.46.0.20260210 on the same module and main 9caecfd2d.

Address and program-header mapping

There is an important correction: in this guest-module syscall-scan path, GuestModuleBuilder passes header.MappedAddress to ScanCodeSectionForSyscalls. The reported 0xf72b9b is a mapped/segment-relative address here, not the corresponding raw file offset.

PT_LOAD[0]: p_offset=0x4000, p_vaddr=0,
            p_filesz=p_memsz=0xffcdde, p_flags=PF_X, p_align=0x4000
reported VA 0xf72b9b -> raw file offset 0xf76b9b

e_shoff=0x1cfd618, e_shnum=36, e_shentsize=64, but the file is only 0x165e4e4 bytes. Readelf reports that the section-header table extends past EOF, so I cannot reliably supply a section name. The earlier input checks covered program-segment ranges/alignment, not a valid section table.

Bytes and independent disassembly

Raw file offsets, including bytes before the failure:

0xf76b90: 0f 0f 3c 0f 78 33 1e 77
0xf76b98: 0f 0f 3c 0f 78 33 1e 77
                     ^^ failure starts at raw file offset 0xf76b9b

Objdump was run on an extracted range with -D -b binary -m i386:x86-64 -M intel, adjusting its displayed address using PT_LOAD[0]. Its synthetic .data label is not an ELF section classification. The following is the forced instruction interpretation of those bytes, not evidence that this stream executes:

f72b8f: f2 0f       repnz (bad)
f72b91: 0f 3c       (bad)
f72b93: 0f 78 33    vmread QWORD PTR [rbx],rsi
f72b96: 1e          (bad)
f72b97: 77 0f       ja 0xf72ba8
f72b99: 0f 3c       (bad)
f72b9b: 0f 78 33    vmread QWORD PTR [rbx],rsi
f72b9e: 1e          (bad)

More decisive: all 4096 bytes at raw file [0xf76580, 0xf77580), mapped VA [0xf72580, 0xf73580), match the OpenSSL Whirlpool lookup table byte-for-byte with each eight-byte entry duplicated (N=2 layout). The failure lies in zero-based entry 97, byte 11 of its duplicated 16-byte representation. The entry is 0f 0f 3c 0f 78 33 1e 77, so the 0f 78 is inside a table constant.

Treating the reported value literally as a raw file offset instead points to an unrelated valid AVX vmovd; that is why the address distinction matters.

Why I have not proposed an opcode or unwind-only fix

A separate diagnostic using the repository's existing EH-frame reader and decoder found 63,490 unwind-listed functions, decoding 3,998,282 instructions with zero function-decoding errors. The surrounding function ranges are [0xf71c80,0xf72560) and [0xf735e0,0xf73665); the lookup table is in their gap.

However, those functions contain direct branches to 749 distinct executable addresses outside all unwind-listed function ranges. Objdump at one, VA 0xf98120 (file 0xf9c120), shows a coherent routine ending in repz ret. Thus the unwind list is useful evidence, but scanning only listed functions would also miss real unannotated code. The unchanged decoder still rejects bare 0f 78 33 as executable input.

This strongly supports embedded data being linearly scanned as instructions, rather than a demonstrated need for VMREAD support. I have not changed the decoder, skipped bytes, established a complete code inventory, or produced a production fix/PR. The title remains blocked before launch. No game binaries or extracted binary slices are attached.

AI-assisted investigation/report: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6251914036 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7547#issuecomment-6251914036). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-18T15:51:03Z. --- Thanks, @MarcZX10 — I checked this using GNU readelf/objdump 2.46.0.20260210 on the same module and main `9caecfd2d`. ### Address and program-header mapping There is an important correction: in this guest-module syscall-scan path, `GuestModuleBuilder` passes `header.MappedAddress` to `ScanCodeSectionForSyscalls`. The reported `0xf72b9b` is a mapped/segment-relative address here, not the corresponding raw file offset. ```text PT_LOAD[0]: p_offset=0x4000, p_vaddr=0, p_filesz=p_memsz=0xffcdde, p_flags=PF_X, p_align=0x4000 reported VA 0xf72b9b -> raw file offset 0xf76b9b ``` `e_shoff=0x1cfd618`, `e_shnum=36`, `e_shentsize=64`, but the file is only `0x165e4e4` bytes. Readelf reports that the section-header table extends past EOF, so I cannot reliably supply a section name. The earlier input checks covered program-segment ranges/alignment, not a valid section table. ### Bytes and independent disassembly Raw file offsets, including bytes before the failure: ```text 0xf76b90: 0f 0f 3c 0f 78 33 1e 77 0xf76b98: 0f 0f 3c 0f 78 33 1e 77 ^^ failure starts at raw file offset 0xf76b9b ``` Objdump was run on an extracted range with `-D -b binary -m i386:x86-64 -M intel`, adjusting its displayed address using PT_LOAD[0]. Its synthetic `.data` label is not an ELF section classification. The following is the forced instruction interpretation of those bytes, not evidence that this stream executes: ```text f72b8f: f2 0f repnz (bad) f72b91: 0f 3c (bad) f72b93: 0f 78 33 vmread QWORD PTR [rbx],rsi f72b96: 1e (bad) f72b97: 77 0f ja 0xf72ba8 f72b99: 0f 3c (bad) f72b9b: 0f 78 33 vmread QWORD PTR [rbx],rsi f72b9e: 1e (bad) ``` More decisive: **all 4096 bytes** at raw file `[0xf76580, 0xf77580)`, mapped VA `[0xf72580, 0xf73580)`, match the [OpenSSL Whirlpool lookup table](https://github.com/openssl/openssl/blob/master/crypto/whrlpool/wp_block.c) byte-for-byte with each eight-byte entry duplicated (`N=2` layout). The failure lies in zero-based entry 97, byte 11 of its duplicated 16-byte representation. The entry is `0f 0f 3c 0f 78 33 1e 77`, so the `0f 78` is inside a table constant. Treating the reported value literally as a raw file offset instead points to an unrelated valid AVX `vmovd`; that is why the address distinction matters. ### Why I have not proposed an opcode or unwind-only fix A separate diagnostic using the repository's existing EH-frame reader and decoder found **63,490 unwind-listed functions**, decoding **3,998,282 instructions with zero function-decoding errors**. The surrounding function ranges are `[0xf71c80,0xf72560)` and `[0xf735e0,0xf73665)`; the lookup table is in their gap. However, those functions contain direct branches to **749 distinct executable addresses outside all unwind-listed function ranges**. Objdump at one, VA `0xf98120` (file `0xf9c120`), shows a coherent routine ending in `repz ret`. Thus the unwind list is useful evidence, but scanning only listed functions would also miss real unannotated code. The unchanged decoder still rejects bare `0f 78 33` as executable input. This strongly supports **embedded data being linearly scanned as instructions**, rather than a demonstrated need for VMREAD support. I have not changed the decoder, skipped bytes, established a complete code inventory, or produced a production fix/PR. The title remains blocked before launch. No game binaries or extracted binary slices are attached. AI-assisted investigation/report: yes.
MarcZX10 commented 2026-10-18 16:07:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T16:07:17Z.


Thanks for tracing the mapped address back to the file and comparing the full page against the Whirlpool table. That establishes this specific 0F 78 failure is data encountered by the linear scan, not evidence that the converter needs to accept VMREAD. The direct branches outside unwind-listed functions also rule out using only unwind ranges as a safe scan boundary. I do not see a sound general fix from this report alone; we would need a code/data boundary source that covers unannotated executable routines before changing scanner behavior.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252078633 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7547#issuecomment-6252078633). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T16:07:17Z. --- Thanks for tracing the mapped address back to the file and comparing the full page against the Whirlpool table. That establishes this specific `0F 78` failure is data encountered by the linear scan, not evidence that the converter needs to accept `VMREAD`. The direct branches outside unwind-listed functions also rule out using only unwind ranges as a safe scan boundary. I do not see a sound general fix from this report alone; we would need a code/data boundary source that covers unannotated executable routines before changing scanner behavior.
muteburrito commented 2026-10-19 08:51:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by muteburrito on 2026-10-19T08:51:29Z.


I’d like to help investigate this issue. Is anyone currently working on a general fix? My proposed first step is a synthetic regression fixture for embedded data between executable routines, while preserving coverage of code outside unwind ranges. I’ve also noted related scanner PRs #6618 and #7651.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6263404383 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7547#issuecomment-6263404383). Originally posted by [muteburrito](https://github.com/muteburrito) on 2026-10-19T08:51:29Z. --- I’d like to help investigate this issue. Is anyone currently working on a general fix? My proposed first step is a synthetic regression fixture for embedded data between executable routines, while preserving coverage of code outside unwind ranges. I’ve also noted related scanner PRs #[6618](https://github.com/boykopovar/AnyPS5/pull/6618) and #[7651](https://github.com/boykopovar/AnyPS5/pull/7651).
MarcZX10 commented 2026-10-19 14:31:49 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T14:31:49Z.


The reported 0F 78 at this offset was subsequently identified as embedded Whirlpool lookup-table data in ubiservices.prx, not executable code. PR #7776, which treated bare 0F 78 as VMREAD, was closed after that analysis because decoding it broke code-extent and TLS test invariants: https://github.com/boykopovar/AnyPS5/pull/7776#issuecomment-6262444982. This means the original conversion failure is not evidence of a missing VMREAD decoder; the remaining question is why the scanner reaches that data range.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6269712217 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7547#issuecomment-6269712217). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T14:31:49Z. --- The reported `0F 78` at this offset was subsequently identified as embedded Whirlpool lookup-table data in `ubiservices.prx`, not executable code. PR #7776, which treated bare `0F 78` as VMREAD, was closed after that analysis because decoding it broke code-extent and TLS test invariants: https://github.com/boykopovar/AnyPS5/pull/7776#issuecomment-6262444982. This means the original conversion failure is not evidence of a missing VMREAD decoder; the remaining question is why the scanner reaches that data range.
MarcZX10 commented 2026-10-19 17:41:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T17:41:28Z.


I checked the current scanner paths and the related merged/open work. #6595 and #6618 handle relative jump tables associated with unwind function ranges, but the Whirlpool table in this report is ordinary constant data in a gap between code regions. GuestModuleBuilder still gives the full executable PT_LOAD to the linear ScanCodeSectionForSyscalls pass, which is where this kind of byte stream can be decoded as instructions.

A regression fixture for data embedded between executable routines would help. To prevent a fix from treating every gap between FDEs as data, it should also include a direct branch from an unwind-covered routine to real code outside unwind ranges, like the 749 external branch targets reported here. I do not yet see a sound general boundary rule from the current evidence; unwind ranges alone would miss that reachable code.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6273431232 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7547#issuecomment-6273431232). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T17:41:28Z. --- I checked the current scanner paths and the related merged/open work. #6595 and #6618 handle relative jump tables associated with unwind function ranges, but the Whirlpool table in this report is ordinary constant data in a gap between code regions. `GuestModuleBuilder` still gives the full executable `PT_LOAD` to the linear `ScanCodeSectionForSyscalls` pass, which is where this kind of byte stream can be decoded as instructions. A regression fixture for data embedded between executable routines would help. To prevent a fix from treating every gap between FDEs as data, it should also include a direct branch from an unwind-covered routine to real code outside unwind ranges, like the 749 external branch targets reported here. I do not yet see a sound general boundary rule from the current evidence; unwind ranges alone would miss that reachable code.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#7547
No description provided.