|
SL2 Analyzer
Read a FromSoftware .sl2 save and report what is in it
|
Functions | |
| detect_game (data, entries) | |
| Identify which game wrote this save, from the bytes alone. | |
Variables | |
| str | DS2_SIGNATURE = b"14e503cb" |
| The BND4 signature DS2 stamps into its header. | |
| int | SDT_SLOT_ENTRY_SIZE = 0x100010 |
| Size of one Sekiro character slot's BND4 entry: 0x100000 of payload behind the 16-byte MD5. | |
| NR_SLOT_ENTRY_SIZE | |
| Size of one Elden Ring Nightreign character slot's BND4 entry, and the number of entries the file carries. | |
| NR_ENTRY_COUNT | |
| Size of one Elden Ring Nightreign character slot's BND4 entry, and the number of entries the file carries. | |
Which game a save belongs to, from its header signature and entry count.
| sl2.detect.detect_game | ( | data, | |
| entries | |||
| ) |
Identify which game wrote this save, from the bytes alone.
The header signature and entry count narrow it down; the remaining ambiguities are settled by content — SOTFS is the DS2 variant whose key produces a sane length prefix, Sekiro is the one whose slots are 0x100010, and ER's entries are far larger than DS3's. Nightreign is the only one with fourteen entries.
| data | The full file bytes. |
| entries | The parsed entry table. |
"ds2vanilla", "ds2sotfs", "dsr", "ptde", "ds3", "er", "sdt", "nr". | str sl2.detect.DS2_SIGNATURE = b"14e503cb" |
| int sl2.detect.SDT_SLOT_ENTRY_SIZE = 0x100010 |
Size of one Sekiro character slot's BND4 entry: 0x100000 of payload behind the 16-byte MD5.
This is what identifies the game, because its entry COUNT does not: 11 on the published layout (DS1's count) and 12 on the current patch, which adds a reserved, all-zero twelfth entry (DS3's and Elden Ring's count).
| sl2.detect.NR_SLOT_ENTRY_SIZE |
Size of one Elden Ring Nightreign character slot's BND4 entry, and the number of entries the file carries.
Nightreign is the only save here with fourteen entries, so the count alone would do; the slot size is checked as well because it sits 0x20 away from Sekiro's (0x100030 against 0x100010), and a size test that close is worth stating rather than leaving to a reader to notice.
| sl2.detect.NR_ENTRY_COUNT |
Size of one Elden Ring Nightreign character slot's BND4 entry, and the number of entries the file carries.
Nightreign is the only save here with fourteen entries, so the count alone would do; the slot size is checked as well because it sits 0x20 away from Sekiro's (0x100030 against 0x100010), and a size test that close is worth stating rather than leaving to a reader to notice.