fix(relinker): exclude trailing PS4 relative jump tables #6595

Merged
MarcZX10 merged 1 commit from upstream-pr/6595 into main 2026-10-19 07:01:04 +00:00
MarcZX10 commented 2026-10-15 21:54:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:54:38Z.


What

Carry the relative jump-table proposal attached to #3093, preserving the original author as co-author. On PS4 SCE executables, a trailing signed-relative jump table in or immediately after an unwind function can be decoded as instructions by the syscall scan, call-site scan, or code collector. This change detects the table from an RIP-relative LEA followed by an indirect jump, requires at least two entries targeting decoded instruction starts, and requires only padding after the table.

The pipeline scans a copy with detected table bytes replaced by NOPs. The code collector trims the unwind function at the table, excludes table addresses from roots, and stops CFG traversal at table ranges. This is limited to SCE dynamic executables/modules.

The implementation follows the proposal from @SuperCatElvis in #3093; that contributor requested carrying it with a co-author credit. Their issue report says the affected eboot passed the syscall and call-site scans with the patch applied and advanced to the next conversion stop. I did not run that eboot locally. This PR adds synthetic detector coverage because the original patch had no tests.

Related: #3093. This is separate from #6354, which finds the PLT before unwind code and changes code extent calculation.

Tested

  • Relinker-only Release build, Debian 12, GCC 12.2.
  • Full relinker-only CTest suite: 182/182 passed.
  • Windows 11 Pro / WinLibs GCC 15.2.0 relinker-only run reported by @DealPotato: current head f25f22630 converts the inFAMOUS Second Son (CUSA00004) eboot; main with #6618 and #6977 stop on an unsupported guest TLS instruction.
  • New control_flow_graph coverage checks a detected table and rejects a single-entry table, invalid instruction targets, and non-padding trailing bytes.
  • python3 tools/check_conventions.py --base upstream/main --head HEAD: passed.
  • git diff --check: passed.
  • The affected PS4 eboot was not run locally; see the reporter's test evidence in #3093.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PS4 executable conversion, #3093
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4880359823 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6595). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:54:38Z. --- ### What Carry the relative jump-table proposal attached to #3093, preserving the original author as co-author. On PS4 SCE executables, a trailing signed-relative jump table in or immediately after an unwind function can be decoded as instructions by the syscall scan, call-site scan, or code collector. This change detects the table from an RIP-relative LEA followed by an indirect jump, requires at least two entries targeting decoded instruction starts, and requires only padding after the table. The pipeline scans a copy with detected table bytes replaced by NOPs. The code collector trims the unwind function at the table, excludes table addresses from roots, and stops CFG traversal at table ranges. This is limited to SCE dynamic executables/modules. The implementation follows the proposal from @SuperCatElvis in #3093; that contributor requested carrying it with a co-author credit. Their issue report says the affected eboot passed the syscall and call-site scans with the patch applied and advanced to the next conversion stop. I did not run that eboot locally. This PR adds synthetic detector coverage because the original patch had no tests. Related: #3093. This is separate from #6354, which finds the PLT before unwind code and changes code extent calculation. ### Tested - Relinker-only Release build, Debian 12, GCC 12.2. - Full relinker-only CTest suite: 182/182 passed. - Windows 11 Pro / WinLibs GCC 15.2.0 relinker-only run reported by @DealPotato: current head `f25f22630` converts the inFAMOUS Second Son (CUSA00004) eboot; `main` with #6618 and #6977 stop on an unsupported guest TLS instruction. - New `control_flow_graph` coverage checks a detected table and rejects a single-entry table, invalid instruction targets, and non-padding trailing bytes. - `python3 tools/check_conventions.py --base upstream/main --head HEAD`: passed. - `git diff --check`: passed. - The affected PS4 eboot was not run locally; see the reporter's test evidence in #3093. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PS4 executable conversion, #3093 - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-15 22:02:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T22:02:47Z.


CI follow-up: the relinker CTest suite now passes on Ubuntu (2m29s), Windows and macOS (2m57s). Eligibility, conventions and intake also pass. The AGC build jobs were skipped by the changed-path filter and do not cover this relinker-only change.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6203203702 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6595#issuecomment-6203203702). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T22:02:47Z. --- CI follow-up: the relinker CTest suite now passes on Ubuntu (2m29s), Windows and macOS (2m57s). Eligibility, conventions and intake also pass. The AGC build jobs were skipped by the changed-path filter and do not cover this relinker-only change.
github-actions[bot] commented 2026-10-15 22:07:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T22:07:20Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6618 core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp L4, L116-117
core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp L5
PR 7453 core/relinker/relinker/src/analysis/UnusedNidFilter/ControlFlowGraph.cpp L71
PR 7660 core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp L374, L376-377, L385-386, L548-549, L551

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.

Pull request Shared files not compared
PR 2780 core/relinker/CMakeLists.txt
PR 5021 core/relinker/CMakeLists.txt
PR 6044 core/relinker/CMakeLists.txt
PR 6802 core/relinker/CMakeLists.txt
PR 6879 core/relinker/CMakeLists.txt
PR 6974 core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp
PR 6977 core/relinker/CMakeLists.txt
core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp
core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp
PR 7332 core/relinker/CMakeLists.txt
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6203273699 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6595#issuecomment-6203273699). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T22:07:20Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6618](https://www.github.com/boykopovar/AnyPS5/pull/6618) | `core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp` [L4](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp#L4), [L116-117](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp#L116-L117)<br>`core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp` [L5](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp#L5) | | | | [PR 7453](https://www.github.com/boykopovar/AnyPS5/pull/7453) | `core/relinker/relinker/src/analysis/UnusedNidFilter/ControlFlowGraph.cpp` [L71](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/relinker/relinker/src/analysis/UnusedNidFilter/ControlFlowGraph.cpp#L71) | | | | [PR 7660](https://www.github.com/boykopovar/AnyPS5/pull/7660) | `core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp` [L374](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp#L374), [L376-377](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp#L376-L377), [L385-386](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp#L385-L386), [L548-549](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp#L548-L549), [L551](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp#L551) | | | 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. | Pull request | Shared files not compared | |---|---| | [PR 2780](https://www.github.com/boykopovar/AnyPS5/pull/2780) | `core/relinker/CMakeLists.txt` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/relinker/CMakeLists.txt` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/relinker/CMakeLists.txt` | | [PR 6802](https://www.github.com/boykopovar/AnyPS5/pull/6802) | `core/relinker/CMakeLists.txt` | | [PR 6879](https://www.github.com/boykopovar/AnyPS5/pull/6879) | `core/relinker/CMakeLists.txt` | | [PR 6974](https://www.github.com/boykopovar/AnyPS5/pull/6974) | `core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/relinker/CMakeLists.txt`<br>`core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp`<br>`core/relinker/relinker/src/pipeline/RelinkerPipeline.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/relinker/CMakeLists.txt` |
MarcZX10 commented 2026-10-15 22:08:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T22:08:01Z.


Manual check of the overlap warning for #6447: its CodeInstructionCollector.cpp change adds overflow validation to the existing fileOffset lambda. This PR adds the trailing jump-table scan/filter in Collect and the CFG data predicate. The edits are in separate logic, neither depends on the other, and I found no semantic overlap or merge dependency.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6203283837 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6595#issuecomment-6203283837). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T22:08:01Z. --- Manual check of the overlap warning for #6447: its `CodeInstructionCollector.cpp` change adds overflow validation to the existing `fileOffset` lambda. This PR adds the trailing jump-table scan/filter in `Collect` and the CFG data predicate. The edits are in separate logic, neither depends on the other, and I found no semantic overlap or merge dependency.
jotitadev commented 2026-10-15 22:31:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T22:31:23Z.

Review: COMMENTED


Tested on Apple M2 Max, macOS 27.2, Xcode 27 clang, CMake 4.4.4 + Ninja, relinker-only Release.

Head f25f22630, merged onto main 5d9dcc42d (clean merge, no warnings).

Build main this PR
arm64 173/173 173/173
x86_64 under Rosetta, /usr/bin/python3 3.9 170/173 170/173

The 3 x86_64 failures are the same on main (pr_overlap_tools, release_package, linux_fixed_base) and are unrelated. control_flow_graph passes on both architectures.

Coverage note: the new test only reaches the detector (FindTrailingRelativeJumpTable / FindRelativeJumpTables). I disabled each integration point on top of the PR, one at a time, and the full suite still passed 173/173 every time:

  1. RelinkerPipeline.cpp: no table ranges filled with NOPs in the scan copy (the syscall and call-site scans see the original table bytes again).
  2. CodeInstructionCollector.cpp: no table ranges recorded and the unwind function not trimmed.
  3. ControlFlowGraph.cpp: the isData checks in enqueue and the decode loop removed.

So a regression in the part that fixes #3093 (the scans decoding the table) would not be caught. A small synthetic SCE input whose trailing table bytes contain a 0F 05 or a call-like pattern, run through the syscall scan path, would cover case 1.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5540719812 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6595#pullrequestreview-5540719812). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-15T22:31:23Z. **Review:** COMMENTED --- Tested on Apple M2 Max, macOS 27.2, Xcode 27 clang, CMake 4.4.4 + Ninja, relinker-only Release. Head `f25f22630`, merged onto `main` `5d9dcc42d` (clean merge, no warnings). | Build | `main` | this PR | |---|---|---| | arm64 | 173/173 | 173/173 | | x86_64 under Rosetta, `/usr/bin/python3` 3.9 | 170/173 | 170/173 | The 3 x86_64 failures are the same on `main` (`pr_overlap_tools`, `release_package`, `linux_fixed_base`) and are unrelated. `control_flow_graph` passes on both architectures. Coverage note: the new test only reaches the detector (`FindTrailingRelativeJumpTable` / `FindRelativeJumpTables`). I disabled each integration point on top of the PR, one at a time, and the full suite still passed 173/173 every time: 1. `RelinkerPipeline.cpp`: no table ranges filled with NOPs in the scan copy (the syscall and call-site scans see the original table bytes again). 2. `CodeInstructionCollector.cpp`: no table ranges recorded and the unwind function not trimmed. 3. `ControlFlowGraph.cpp`: the `isData` checks in `enqueue` and the decode loop removed. So a regression in the part that fixes #3093 (the scans decoding the table) would not be caught. A small synthetic SCE input whose trailing table bytes contain a `0F 05` or a call-like pattern, run through the syscall scan path, would cover case 1. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
MarcZX10 commented 2026-10-15 22:34:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T22:34:46Z.


Good catch. The current test exercises detector output and CFG exclusion, but it does not verify the pipeline scan copy or code-collector trimming; disabling those integration points still leaves the suite green. A synthetic SCE fixture that puts a syscall/call-like pattern in the table would cover the path you describe. I will track that as a separate follow-up test PR, consistent with the repository rule to keep follow-up work on a new branch.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6203674268 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6595#issuecomment-6203674268). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T22:34:46Z. --- Good catch. The current test exercises detector output and CFG exclusion, but it does not verify the pipeline scan copy or code-collector trimming; disabling those integration points still leaves the suite green. A synthetic SCE fixture that puts a syscall/call-like pattern in the table would cover the path you describe. I will track that as a separate follow-up test PR, consistent with the repository rule to keep follow-up work on a new branch.
MarcZX10 commented 2026-10-15 23:15:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T23:15:45Z.


The new #6618/#6619 results on #3093 are useful. I compared #6595 with #6618: #6618 detects a table within an FDE range from its LEA/MOVSXD pattern, while #6595 searches the end of an FDE and a bounded range after it, requiring decoded targets and padding. They cover related table layouts, but both change CodeInstructionCollector.cpp and RelinkerPipeline.cpp; git merge-tree reports content conflicts in both. Could we coordinate a combined detector and integration so we keep the distinct range coverage and tests without carrying two competing scans? #6619 zero-length-FDE handling appears separate.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6204255907 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6595#issuecomment-6204255907). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T23:15:45Z. --- The new #6618/#6619 results on #3093 are useful. I compared #6595 with #6618: #6618 detects a table within an FDE range from its LEA/MOVSXD pattern, while #6595 searches the end of an FDE and a bounded range after it, requiring decoded targets and padding. They cover related table layouts, but both change `CodeInstructionCollector.cpp` and `RelinkerPipeline.cpp`; `git merge-tree` reports content conflicts in both. Could we coordinate a combined detector and integration so we keep the distinct range coverage and tests without carrying two competing scans? #6619 zero-length-FDE handling appears separate.
Get-fix commented 2026-10-15 23:30:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-15T23:30:30Z.


Thanks for comparing them, @MarcZX100, and for the offer to combine. I ran #6595 (f25f22630, relinker-only Release build, Windows, --skip-sce-module) on the two retail titles from #6618, using dumps of my own copies:

relinker Limbo (CUSA01664) Bloodborne (CUSA00900)
#6595 stops at the zero-length FDE (#6619) Unsupported Windows guest TLS instruction (bytes: 64 fb), file offset 0x11e26fc
#6595 + #6619 Unsupported Windows guest TLS instruction (bytes: 65 fd), file offset 0x1c829c same as above
#6618 (+ #6619 for Limbo) converts converts

Both stops are in trailing tables that #6595 leaves in the code:

  • Limbo: the stop is in the table at 0x1c427c of the function [0x1c3da0, 0x1c42c8).
    • Dispatch at 0x1c3de1: lea rcx, movsxd rax, [rcx+rax*4], add, jmp rax, behind cmp eax, 0x12; ja.
    • The table has 19 entries and ends at the FDE end. Before it are a ret at 0x1c4279 and a 2-byte nop. After it come an 8-byte nopl and the next function at 0x1c42d0.
  • Bloodborne: the stop is in the second of two consecutive tables at the end of the function [0x11ddcc0, 0x11de994).
    • The tables start at 0x11de674 and 0x11de804, with 100 entries each, and run to the FDE end.
    • Before them are a ret at 0x11de66c, a call at 0x11de66d and two nops.

I haven't pinned down where #6595 rejects them. In a debug build its TableEntries does count all 19 entries of the Limbo table in one pass, so a reduced copy of these two layouts may be the quickest way to find it. #6595 passes every case of the sce_inline_jump_tables test in #6618 (I ran that script against its relinker), so the synthetic fixtures don't separate the two; the titles do.

In the other direction, #6618 only looks inside the FDE range, so it does not handle tables in the gap after it, as in the Until Dawn report.

A proposal for one change:

  • Base: #6618's in-range detection. It needs no flow end or padding before the table, and checks every dword from the first table to the end of the range.
  • Second case: #6595's bounded gap after the FDE, sharing that one table check, the same CodeInstructionCollector and RelinkerPipeline integration, and both sets of tests.

I'm happy to do the combining on #6618 with you and @SuperCatElvis as co-authors. Or I can bring the in-range detection, its fixture and the title results to #6595, whichever you prefer.

AI-assisted: yes (Claude Code). The conversions above ran on my machine; no game files leave it.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6204446671 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6595#issuecomment-6204446671). Originally posted by [Get-fix](https://github.com/Get-fix) on 2026-10-15T23:30:30Z. --- Thanks for comparing them, @MarcZX100, and for the offer to combine. I ran #6595 (`f25f22630`, relinker-only Release build, Windows, `--skip-sce-module`) on the two retail titles from #6618, using dumps of my own copies: | relinker | Limbo (CUSA01664) | Bloodborne (CUSA00900) | |---|---|---| | #6595 | stops at the zero-length FDE (#6619) | `Unsupported Windows guest TLS instruction (bytes: 64 fb)`, file offset 0x11e26fc | | #6595 + #6619 | `Unsupported Windows guest TLS instruction (bytes: 65 fd)`, file offset 0x1c829c | same as above | | #6618 (+ #6619 for Limbo) | converts | converts | Both stops are in trailing tables that #6595 leaves in the code: - **Limbo:** the stop is in the table at 0x1c427c of the function [0x1c3da0, 0x1c42c8). - Dispatch at 0x1c3de1: `lea rcx`, `movsxd rax, [rcx+rax*4]`, `add`, `jmp rax`, behind `cmp eax, 0x12; ja`. - The table has 19 entries and ends at the FDE end. Before it are a `ret` at 0x1c4279 and a 2-byte `nop`. After it come an 8-byte `nopl` and the next function at 0x1c42d0. - **Bloodborne:** the stop is in the second of two consecutive tables at the end of the function [0x11ddcc0, 0x11de994). - The tables start at 0x11de674 and 0x11de804, with 100 entries each, and run to the FDE end. - Before them are a `ret` at 0x11de66c, a `call` at 0x11de66d and two `nop`s. I haven't pinned down where #6595 rejects them. In a debug build its `TableEntries` does count all 19 entries of the Limbo table in one pass, so a reduced copy of these two layouts may be the quickest way to find it. #6595 passes every case of the `sce_inline_jump_tables` test in #6618 (I ran that script against its relinker), so the synthetic fixtures don't separate the two; the titles do. In the other direction, #6618 only looks inside the FDE range, so it does not handle tables in the gap after it, as in the Until Dawn report. A proposal for one change: - **Base:** #6618's in-range detection. It needs no flow end or padding before the table, and checks every dword from the first table to the end of the range. - **Second case:** #6595's bounded gap after the FDE, sharing that one table check, the same `CodeInstructionCollector` and `RelinkerPipeline` integration, and both sets of tests. I'm happy to do the combining on #6618 with you and @SuperCatElvis as co-authors. Or I can bring the in-range detection, its fixture and the title results to #6595, whichever you prefer. AI-assisted: yes (Claude Code). The conversions above ran on my machine; no game files leave it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-15 23:43:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T23:43:39Z.


Thanks for testing both detectors on the two titles and for sharing the layouts. This confirms #6618 covers the in-FDE trailing tables, while #6595 is aimed at the distinct bounded gap after an FDE (including the Until Dawn report). I suggest keeping the detector cases distinct for now; if #6618 lands first, I can rebase #6595 on it and resolve the shared integration points while preserving each change’s attribution. I will add the reduced in-FDE fixtures as a separate follow-up only if the current review needs that coverage.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6204614928 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6595#issuecomment-6204614928). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T23:43:39Z. --- Thanks for testing both detectors on the two titles and for sharing the layouts. This confirms #6618 covers the in-FDE trailing tables, while #6595 is aimed at the distinct bounded gap after an FDE (including the Until Dawn report). I suggest keeping the detector cases distinct for now; if #6618 lands first, I can rebase #6595 on it and resolve the shared integration points while preserving each change’s attribution. I will add the reduced in-FDE fixtures as a separate follow-up only if the current review needs that coverage.
DealPotato commented 2026-10-18 18:06:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by DealPotato on 2026-10-18T18:06:35Z.


Tested this branch (head f25f22630) on a real PS4 eboot: inFAMOUS Second Son (CUSA00004, my own dump). Windows 11 Pro, WinLibs GCC 15.2.0, relinker-only build, relinker --windows --skip-sce-module eboot.elf app.exe.

The eboot has the case this PR describes:

  • The function at 0x64c870 has an FDE ending at 0x64d0c3, after a call to a noreturn function and a nop.
  • Its switch table sits right after the FDE, at 0x64d0c4–0x64d104. It is loaded by lea rcx, [rip+0x6dd] at 0x64c9e0 and movslq (%rcx,%rax,4),%rax.
  • Multi-byte NOP padding follows the table up to the next function at 0x64d110.

Results:

  • main with #6618: stops with Unsupported Windows guest TLS instruction (bytes: 65 ff ff) (offset 0x6510cc).
  • #6977's branch: stops the same way.
  • This branch: converts the eboot.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6253310795 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6595#issuecomment-6253310795). Originally posted by [DealPotato](https://github.com/DealPotato) on 2026-10-18T18:06:35Z. --- Tested this branch (head `f25f22630`) on a real PS4 eboot: inFAMOUS Second Son (CUSA00004, my own dump). Windows 11 Pro, WinLibs GCC 15.2.0, relinker-only build, `relinker --windows --skip-sce-module eboot.elf app.exe`. The eboot has the case this PR describes: - The function at `0x64c870` has an FDE ending at `0x64d0c3`, after a call to a noreturn function and a `nop`. - Its switch table sits right after the FDE, at `0x64d0c4–0x64d104`. It is loaded by `lea rcx, [rip+0x6dd]` at `0x64c9e0` and `movslq (%rcx,%rax,4),%rax`. - Multi-byte NOP padding follows the table up to the next function at `0x64d110`. Results: - **`main` with #6618:** stops with `Unsupported Windows guest TLS instruction (bytes: 65 ff ff) (offset 0x6510cc)`. - **#6977's branch:** stops the same way. - **This branch:** converts the eboot. AI-assisted: yes (Claude Code).
MarcZX10 commented 2026-10-18 21:21:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T21:21:13Z.


Thanks for testing the current head on inFAMOUS Second Son. This directly confirms the post-FDE, NOP-padded table case converts under Windows, and the comparison with #6618 helps distinguish it from the in-FDE detector. I added your reported setup and result to the PR’s Tested section with credit.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255293372 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6595#issuecomment-6255293372). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T21:21:13Z. --- Thanks for testing the current head on inFAMOUS Second Son. This directly confirms the post-FDE, NOP-padded table case converts under Windows, and the comparison with #6618 helps distinguish it from the in-FDE detector. I added your reported setup and result to the PR’s Tested section with credit.
Sign in to join this conversation.
No reviewers
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!6595
No description provided.