Repository navigation
Conversation
…e's own serial (AI-assisted)
"Get patches and cheats" asks each source for the disc's own <serial>_<crc>. A fan translation changes the
executable, so its CRC differs and nothing is found; a rebuilt disc that boots NORG_RUS.00 instead of
SLUS_205.00 has no real serial at all. When nothing comes for the disc's own file, the downloader now
tries the disc's serial, then the serials the executable names its memory card folder after
("BASLUS-20500"). Each source's file list (GitHub's tree API, once a run) gives the files of that serial;
when there is exactly one, it is kept under the disc's own name (<disc serial>_<disc crc>_<serial>.pnach),
so PCSX2 loads it, with every group renamed "(from <serial>_<crc>)" and off. The first serial anything is
found for wins; two files for one serial (two releases) are left alone.
fe_ps5.cpp: the online patches' client takes up to 8 MB from api.github.com (PCSX2's list is 1.4 MB).
Tested on a PC (ps5/frontend/host/test-patchdl.sh, all passed, with the real executables of two discs and
the live file lists); not built for or tried on a console.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dann1k
force-pushed
the
serial-from-elf
branch
from
October 19, 2026 19:06
061feae to
7da8f61
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
"Get patches and cheats" now also finds patches for fan translations and rebuilt discs. When no source has a file for the disc's own
<serial>_<crc>, the downloader:BASLUS-20500→SLUS-20500);<disc serial>_<disc crc>_<serial>.pnach, so PCSX2 loads it for this disc.Every group is renamed
<name> (from <serial>_<crc>)and stays off. The file starts with a comment that it was made for another executable. The first serial anything is found for wins. Two files for one serial (two releases) are left alone, because there is no way to know which one the disc was made from.Discs that already have their own file behave as before: no extra requests.
fe_ps5.cpp: the online patches' HTTP client accepts up to 8 MB fromapi.github.com(PCSX2's list is 1.4 MB today and growing). Everything else stays at 2 MB.Rationale behind Changes
Patches are matched by serial and CRC, so they never show up for:
SLUS-21423, CRC3AF039F8; PCSX2 hasSLUS-21423_7EA439F5.NORG_RUS.00. The serial becomesNORG-RUS00, so there are no patches and no GameDB entry. Example: Red Dead Revolver, Russian NORG disc. Its executable containsBASLUS-20500(andBESLES-52478), and its code is the US v1.03 one.For both discs I checked by hand that the bytes at the patch addresses match the original release, renamed the files, and they work. This PR makes the app do the finding part. It does not check the code, which is why everything stays off and is labelled with where it came from.
Known limit: discs whose boot executable is only a language menu (e.g. the NORG Simpsons: Hit & Run,
NORG_000.00→NORG_RUS.00) have no serial in the file that is read, so they are still not found.Why the file list (and not just the right serial)
Correcting the serial alone is not enough: the sources are fetched by the exact file name, CRC included, and the disc's CRC is not the original's.
SLUS-20500_87844524.pnachSLUS-20500_E169BAF8.pnachSLUS-21423_3AF039F8.pnachSLUS-21423_7EA439F5.pnachBoth would be 404s. The original release's CRC isn't anywhere on the disc, so the only way to learn it is the list of files the source has for that serial.
raw.githubusercontent.comserves files by name but can't list a folder, hence the tree API (one request per source, only when the disc's own file wasn't found).So the PR fixes two separate things: a wrong serial (rebuilt discs, from the executable) and a different CRC (any edited executable, from the file list).
I also considered a few alternatives:
patches.zipwould still need the same serial-to-files lookup.Suggested Testing Steps
PC:
ps5/frontend/host/test-patchdl.sh. All tests pass (existing + new ones). The new tests cover:I also ran the lookup functions on the real executables of both discs above against the live lists: they found
SLUS-21423_7EA439F5.pnachandSLUS-20500_E169BAF8.pnach.Console: not tested. I can't build the eboot (the modified SDK and driver aren't public). Worth checking:
Did you use AI to help find, test, or implement this issue or feature?
Yes. Claude (Claude Code) wrote the code and tests and checked the two discs' executables against the patches. I'm sending it because of my own discs.
AI-PR-NOTICE.mdis added asAGENTS.mdasks; feel free to drop it.