I just edited my previous post, compare it with this screenshot of the SBI file from redump
http://redump.org/disc/592/
![]()
As you can see the official format (of the config extracted from ps1_netemu.self) includes all the sector numbers of the SBI file in redump... divided in 2 groups of 8 sectors each
Anyway... some of the "garbage data" inside the official "PSOne classics" could be usign this same format... or a format derivated from it
Is long, i wrote it at bottom of this page, MediEvil (SCES-00311), Vagrant Story (SLES-02754), and Crash Team Racing (SCES-02105)That is an interesting discovery actually. Could you look into the CTR and Vagrant Story data?
Im wondering if the emulator have some function intended to add a hook to that sectors... so everytime that sectors are accessed the functions returns an "is ok, everything is good" so the libcrypt protection is not triggeredI don't know. In a way, it is not surprising that the binary will contain these sector numbers. At the end of the day, the binary, the libcrypt code, will need to know "these are the sectors I need to read to check if the disk is genuine".
EDIT: what is surprising to me is that it only contains the 8 sectors that have corrupted crc and not the full list of 16 sectors (excluding the duplicates up at lba >44000)
Is (this version of) libcrypt only checking the sectors that have "known bad crc"?
Very interesting, i dont understand your explanation to the point to say that is a full confirmation that data is related with the libcrypt protected sectors, but it looks likeI did some more digging and might have found something in the EBOOT's. I followed your hint and looked at the EBOOT's of the 3 games you mentioned. In Vagrant Story I found an encrypted PGD file just before the STARTDAT, so I decrypted it (with PSNPKGD&E) and found out it was the "JUNK" data that psxtract also would decrypt...but much more complete. So I started looking for comparable data in the .SUB/.SBI/.LSD files and it seems that the EBOOTS do contain some subchannel data:
View attachment 35602
A couple of things:
- It doesn't only contain the LibCrypted sectors but much more compared to .SBI/.LSD files, however it isn't as extensive as a .SUB file. I only displayed the first 4 and first Libcrypted entries here, but the file contains much more entries.
- 8 bytes match the .SUB format, doesn't use the 00 byte as seperator, last 2 bytes do not match.
- CTR and MediEvil do not contain this embedded file. They were released in 2007 as one of the early ps1 titles on PSN, Vagrant Story in 2009 so somewhere in between or around that time they changed their work method.
It seems that Soul Reaver also contains a similar file like this, will take a look tomorrow if I can find some more.
The 410101 (used at the start of every line of the SBI files) doesnt matters much, as far i saw in redump in most of the games this values are always 410101, also maybe sony did something different with them// UCHAR ControlAndADR; (eg 0x41)
// UCHAR TrackNumber; (eg 0x01)
// UCHAR IndexNumber; (eg 0x01)
// UCHAR TrackRelativeAddress[3]; (bcd)
// UCHAR Filler; (always 0)
// UCHAR AbsoluteAddress[3]; (bcd)
There are 3 or 4 experiments that "should" workIf that config does contain a sector list indeed, I do not understand why there are so many of them. The pool of modified sectors is the same for all the games. Not to mention only these around the third second are checked.
Assuming it is a sector list indeed, altering one pair of the LC sectors in that config would make the game fail to get a correct key.
If the method is working as it seems, then the emulator could be patched on the fly to get the LC sectors data from the external file. In theory.
000038F3 --- to decimal ---> 14579 (mentioned in the redump SBI file)
000038F8 --- to decimal ---> 14584 (mentioned in the redump SBI file)
00003939 --- to decimal ---> 14649 (mentioned in the redump SBI file)
0000393E --- to decimal ---> 14654 (mentioned in the redump SBI file)
00003A33 --- to decimal ---> 14899 (mentioned in the redump SBI file)
00003A38 --- to decimal ---> 14904 (mentioned in the redump SBI file)
00003AD0 --- to decimal ---> 15056 (mentioned in the redump SBI file)
00003AD5 --- to decimal ---> 15061 (mentioned in the redump SBI file)
00003B1A --- to decimal ---> 15130 (mentioned in the redump SBI file)
00003B1F --- to decimal ---> 15135 (mentioned in the redump SBI file)
00003B8A --- to decimal ---> 15242 (mentioned in the redump SBI file)
00003B8F --- to decimal ---> 15247 (mentioned in the redump SBI file)
00003BD0 --- to decimal ---> 15312 (mentioned in the redump SBI file)
00003BD5 --- to decimal ---> 15317 (mentioned in the redump SBI file)
00003F27 --- to decimal ---> 16167 (mentioned in the redump SBI file)
00003F2C --- to decimal ---> 16172 (mentioned in the redump SBI file)
000014B5
00003FAA
00009084
0000BDD6
0000BEB1
0000BFAC
0000C9BC
0000E511
00010706
00010C80
000118E0
00011E36
00014146
000155E7
000171BF
0001D2F5
0001D8B5
0001E45A
0001E629
0001F1FD
0001FEB9
0002405D
0002599A
000259ED
00025A2F
00028BF6
00028CA0
00028CC2
0002A062
0002DD59
0002FDF1
00030BFC
00030C26
00039AB1
0003A9E1
0003BC7F
0003E1B9
0003E208
0003F88F
00040172
00040591
0004138F
00043ED8
000440DC
00044894
000467FB
0004782C
00048ACE
0004B4A0
0004B960
0004BE93
0004C30C
0004CB0E
0004CBC9
0004D5C8
Very interesting, i dont understand your explanation to the point to say that is a full confirmation that data is related with the libcrypt protected sectors, but it looks like
Try to compare with the full list i just posted in wiki for vagrant story, we dont really know why they was adding so much sectors to the list for vagrant story (are sectors that doesnt seems to be related with librypt, or at least redump.org is not considering that are related), but there must be a reason for it, and probably they kept doing the same later for vagrant story
Btw, when looking at SBI files remember what i mentioned here:
https://www.psx-place.com/threads/p...mus-research-thread.35836/page-10#post-317262
The 410101 (used at the start of every line of the SBI files) doesnt matters much, as far i saw in redump in most of the games this values are always 410101, also maybe sony did something different with them
I mean... maybe they decided to not include this info about "ControlAndADR", "TrackNumber", "IndexNumber", or they included it but in a different format, dunno
But the others named "TrackRelativeAddress" and "AbsoluteAddress" (3 bytes each in the SBI file) are the most important
I can't say that it is related to libcrypt for sure, but can certainly say now it is subchannel data. Made a quick python script and extracted all the sector entries for Vagrant Story and Soul Reaver from the encrypted PGD files:
View attachment 35617
It seems that they don't use Control/ADR (41) and Zero (the filler byte between the Relative and Absolute addresses), but Track Number, Index, Pmin, Psec, Pframe, Amin, Asec, Aframe for sure. However I really don't understand yet how they calculate the CRC value here, normally it is calculated with "G(x) = x^{16}+x^{12}+x^5+1" (see here). So one might say that it should match the sector CRC values found in a .SUB file since the image data (in case of Soul Reaver) is identical as the one found in the EBOOT...but they don't match.
Some other findings:
- The file header is FF FF FF FF 00 00 00 00 FF FF FF FF
- The file footer is FF FF FF FF FF FF FF FF FF FF FF FF
- After the header the first 2 bytes seem to contain a CRC value
- The last sector entry has no CRC value
You can see the data for yourself, it's in the attachment. I'm looking the Final Fantasy VIII EBOOT atm, it seems there are 4 of these files in the EBOOT (matching the amount of discs).
There are two steps to test that config without reverse engineering the emulator. We have to operate with the data we know what they are for, at least hypothetically. We are assuming all the data present there, are the sectors themselves in ascending order.
1. Intentionally corrupt known sectors as little as possible. Let's take Vagrant Story config:
Code:000038F3 --- to decimal ---> 14579 (mentioned in the redump SBI file) 000038F8 --- to decimal ---> 14584 (mentioned in the redump SBI file) 00003939 --- to decimal ---> 14649 (mentioned in the redump SBI file) 0000393E --- to decimal ---> 14654 (mentioned in the redump SBI file) 00003A33 --- to decimal ---> 14899 (mentioned in the redump SBI file) 00003A38 --- to decimal ---> 14904 (mentioned in the redump SBI file) 00003AD0 --- to decimal ---> 15056 (mentioned in the redump SBI file) 00003AD5 --- to decimal ---> 15061 (mentioned in the redump SBI file) 00003B1A --- to decimal ---> 15130 (mentioned in the redump SBI file) 00003B1F --- to decimal ---> 15135 (mentioned in the redump SBI file) 00003B8A --- to decimal ---> 15242 (mentioned in the redump SBI file) 00003B8F --- to decimal ---> 15247 (mentioned in the redump SBI file) 00003BD0 --- to decimal ---> 15312 (mentioned in the redump SBI file) 00003BD5 --- to decimal ---> 15317 (mentioned in the redump SBI file) 00003F27 --- to decimal ---> 16167 (mentioned in the redump SBI file) 00003F2C --- to decimal ---> 16172 (mentioned in the redump SBI file)
We have to corrupt the first pair of sectors for example. So instead of 0x38F3 and 0x38F8, they need to be changed to 0x3903 and 0x3908. Expected result: hang on the now loading screen.
2. Intentionally corrupt the data not related to the LC at first sight. We have to corrupt the sectors not mentioned in the redump database:
Code:000014B5 00003FAA 00009084 0000BDD6 0000BEB1 0000BFAC 0000C9BC 0000E511 00010706 00010C80 000118E0 00011E36 00014146 000155E7 000171BF 0001D2F5 0001D8B5 0001E45A 0001E629 0001F1FD 0001FEB9 0002405D 0002599A 000259ED 00025A2F 00028BF6 00028CA0 00028CC2 0002A062 0002DD59 0002FDF1 00030BFC 00030C26 00039AB1 0003A9E1 0003BC7F 0003E1B9 0003E208 0003F88F 00040172 00040591 0004138F 00043ED8 000440DC 00044894 000467FB 0004782C 00048ACE 0004B4A0 0004B960 0004BE93 0004C30C 0004CB0E 0004CBC9 0004D5C8
Expected result: game should work without problems as with an uncorrupted config.
Ok. I performed these two simple tests. The results matched my predictions. It seems that only the LC sectors are critical for the emulator to pass the verification. Modifying them caused the Vagrant Story to crash at the loading screen after starting the new game. Modifying the rest of them does not change anything at all. I suspect the way of working is similar to what @Ronnie Sahlberg suggested somewhere in this thread - emulator is presenting these sectors to the GetlocP as corrupted ones. And it is enough for the game to obtain the key.
Now the question is how the emulator is calculating the game hash in order to replace the stored data with our sectors (or just the Magic Word using the different command).
In theory, I suppose it could be implemented in Cobra stage2 using a hook on the kernel sub that loads user application (self) data into memory (after the signature check, decompression/decryption routines).is there any way to patch the emulator on the fly in order to replace the values with ours? It could be implemented in the Cobra, am I right?
