mirror of
https://github.com/DarkStore-3DS/Project_CTR.git
synced 2026-07-03 00:39:14 +00:00
ctrtool: tmd savesize detection & smarter exheader pre check
This commit is contained in:
+9
-1
@@ -86,6 +86,7 @@ void tmd_print(tmd_context* ctx)
|
||||
ctr_tmd_header_2048* header2048 = 0;
|
||||
ctr_tmd_body* body = 0;
|
||||
unsigned int contentcount = 0;
|
||||
unsigned int savesize = 0;
|
||||
unsigned int i;
|
||||
|
||||
if (type == TMD_RSA_2048_SHA256 || type == TMD_RSA_2048_SHA1)
|
||||
@@ -104,7 +105,8 @@ void tmd_print(tmd_context* ctx)
|
||||
body = tmd_get_body(ctx);
|
||||
|
||||
contentcount = getbe16(body->contentcount);
|
||||
|
||||
savesize = getle32(body->savedatasize);
|
||||
|
||||
fprintf(stdout, "\nTMD header:\n");
|
||||
fprintf(stdout, "Signature type: %s\n", tmd_get_type_string(type));
|
||||
fprintf(stdout, "Issuer: %s\n", body->issuer);
|
||||
@@ -115,6 +117,12 @@ void tmd_print(tmd_context* ctx)
|
||||
memdump(stdout, "Title id: ", body->titleid, 8);
|
||||
fprintf(stdout, "Title type: %08x\n", getbe32(body->titletype));
|
||||
fprintf(stdout, "Group id: %04x\n", getbe16(body->groupid));
|
||||
if(savesize < sizeKB)
|
||||
fprintf(stdout, "Save Size: %08x\n", savesize);
|
||||
else if(savesize < sizeMB)
|
||||
fprintf(stdout, "Save Size: %dKB (%08x)\n", savesize/sizeKB, savesize);
|
||||
else
|
||||
fprintf(stdout, "Save Size: %dMB (%08x)\n", savesize/sizeMB, savesize);
|
||||
fprintf(stdout, "Access rights: %08x\n", getbe32(body->accessrights));
|
||||
fprintf(stdout, "Title version: %04x\n", getbe16(body->titleversion));
|
||||
fprintf(stdout, "Content count: %04x\n", getbe16(body->contentcount));
|
||||
|
||||
Reference in New Issue
Block a user