39def detect_game(data, entries):
42 if sig == DS2_SIGNATURE:
46 blob = data[entries[1].offset : entries[1].offset + entries[1].size]
47 for key, game
in ((DS2_KEY,
"ds2sotfs"), (DS2_VANILLA_KEY,
"ds2vanilla")):
48 pt = _aes_cbc(key, blob[16:32], blob[32:])
50 if dlen
is not None and 0 < dlen <= len(pt) - 4:
53 "Dark Souls II save found, but neither the Scholar nor the vanilla "
59 if n >= 11
and entries[0].size == SDT_SLOT_ENTRY_SIZE:
62 return "dsr" if sig == b
"\x00" * 8
else "ptde"
64 return "er" if entries[0].size > 2_000_000
else "ds3"
65 if n == NR_ENTRY_COUNT
and entries[0].size == NR_SLOT_ENTRY_SIZE:
67 sys.exit(
"Unrecognised .sl2 — not a supported Souls save.")