Update tad.c

This commit is contained in:
Lillian Skinner 2025-09-30 15:26:52 -04:00 committed by GitHub
parent adfc7d6c45
commit 751c22214f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,6 +41,10 @@ const unsigned char debuggerKey[] = {
0xA2, 0xFD, 0xDD, 0xF2 ,0xE4, 0x23, 0x57, 0x4A, 0xA2, 0xFD, 0xDD, 0xF2 ,0xE4, 0x23, 0x57, 0x4A,
0xE7, 0xED, 0x86, 0x57, 0xB5, 0xAB, 0x19, 0xD3 0xE7, 0xED, 0x86, 0x57, 0xB5, 0xAB, 0x19, 0xD3
}; };
const unsigned char customKey[] = {
0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00 ,0x00, 0x00, 0x00, 0x00
};
// Content IV be fine as a hardcoded string. Content IV is based off of the content index. (index # with zerobyte padding) // Content IV be fine as a hardcoded string. Content IV is based off of the content index. (index # with zerobyte padding)
// All TADs I've seen only ever had a single content. It might be a good idea to add something down the line in case a // All TADs I've seen only ever had a single content. It might be a good idea to add something down the line in case a
// weird TAD pops up, but until then this should do. // weird TAD pops up, but until then this should do.
@ -252,6 +256,11 @@ char* openTad(char const* src) {
iprintf("Key fail!\n\nTrying debugger common key...\n"); iprintf("Key fail!\n\nTrying debugger common key...\n");
keyFail = decryptTad(debuggerKey, title_key_iv, title_key_enc, content_iv, swap_endian_u32(srlTrueSize), srlTidLow, dataTitle, contentHash); keyFail = decryptTad(debuggerKey, title_key_iv, title_key_enc, content_iv, swap_endian_u32(srlTrueSize), srlTidLow, dataTitle, contentHash);
} }
if (keyFail == TRUE) {
remove("sd:/_nds/TADDeliveryTool/tmp/temp.srl");
iprintf("Key fail!\n\nTrying custom key...\n");
keyFail = decryptTad(customKey, title_key_iv, title_key_enc, content_iv, swap_endian_u32(srlTrueSize), srlTidLow, dataTitle, contentHash);
}
if (keyFail == TRUE) { if (keyFail == TRUE) {
remove("sd:/_nds/TADDeliveryTool/tmp/temp.srl"); remove("sd:/_nds/TADDeliveryTool/tmp/temp.srl");
iprintf("All keys failed!\n"); iprintf("All keys failed!\n");