-
Notifications
You must be signed in to change notification settings - Fork 1
Save File
Giovanni Frank Crisanti edited this page Sep 1, 2019
·
8 revisions
Dark Souls Remaster uses AES-encrypted save files. Basic unpacker is at Dark-Souls-Remastered-SL2-Unpacker
Structure is
struct SaveSlotHeader {
const uint32_t const32b_0 = 0x00000050;
const uint32_t const32b_1 = 0xFFFFFFFF;
const uint32_t slot_size = 0x060030; // Size of save slot (not including 12 trailing 0 bytes)
const uint32_t const32b_2 = 0x00000000;
uint32_t offset = 0; // Offset (from start of file) of save slot struct. The header's size (0x2C0)
uint32_t title_offset = 0; // Offset of title string (not the same as character name)
const uint32_t padding_size = 0x00000000; // Length of trailing padding between the current slot and the following slot
const uint32_t const32b_3 = 0x00000000;
}
struct SaveSlotTitle {
wchar_t prefix[9] = { L'U', L'S', L'E', L'R', L'_', L'D', L'A', L'T', L'A' };
wchar_t index[3] = { L'0', L'0', L'0' };
wchar_t terminator = 0;
}
struct SaveEntry {
SaveSlotHeader entry_header;
SaveSlotTitle entry_title;
uint8_t Encyption_IV[16];
//everything after this is encrypted with the const file key and the randomly generated iv
uint8_t CHECKSUM_HEADER[16];
uint32_t remaining_size_of_save_slot; //each slot is 0x060030 bytes, minus the IV and Checksum and footer
uint8_t unknown_save_details[0x60000]; //this is the actual save file info. Format unknown
uint8_t FOOTER_PADDING[16];
}
struct SaveFileHeader {
uint32_t magic32_0 = 0x34444E42; // "BND4"
uint32_t magic32_1 = 0x00000000;
uint32_t magic32_2 = 0x00010000; // Tarvitz speculated that this was a revision number
uint32_t slot_count = 11; // Including the main menu data slot, so number of save slots is (slot_count - 1)
const uint32_t const32b_0 = 0x00000040;
const uint32_t const32b_1 = 0x00000000;
const uint32_t const32b_2 = 0x00000000;
const uint32_t const32b_3 = 0x00000000;
uint32_t slot_header_size = 0x00000020;
const uint32_t const32b_4 = 0x00000000;
uint32_t size = 0x000002C0; // Size of the file header in bytes (Including slot header array and title arrays)
const uint32_t const32b_5 = 0x00000000;
const uint32_t const32b_6 = 0x00002001;
const uint8_t padding[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
}
struct SaveFile {
SaveFileHeader header;
SaveEntry saves[11]; //one of these is unused and stores the menu information
}