SL2 Analyzer
Read a FromSoftware .sl2 save and report what is in it
Loading...
Searching...
No Matches
sl2.detect Namespace Reference

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.
 

Detailed Description

Which game a save belongs to, from its header signature and entry count.

Function Documentation

◆ detect_game()

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.

Parameters
dataThe full file bytes.
entriesThe parsed entry table.
Returns
One of "ds2vanilla", "ds2sotfs", "dsr", "ptde", "ds3", "er", "sdt", "nr".

Definition at line 39 of file detect.py.

Variable Documentation

◆ DS2_SIGNATURE

str sl2.detect.DS2_SIGNATURE = b"14e503cb"

The BND4 signature DS2 stamps into its header.

Definition at line 10 of file detect.py.

◆ SDT_SLOT_ENTRY_SIZE

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).

Definition at line 17 of file detect.py.

◆ NR_SLOT_ENTRY_SIZE

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.

Definition at line 26 of file detect.py.

◆ NR_ENTRY_COUNT

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.

Definition at line 26 of file detect.py.