mirror of
https://github.com/DarkStore-3DS/Project_CTR.git
synced 2026-07-03 00:39:14 +00:00
Format string fixes for GCC on Windows
This commit is contained in:
+2
-1
@@ -4,6 +4,7 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "cia.h"
|
#include "cia.h"
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
|
||||||
void cia_init(cia_context* ctx)
|
void cia_init(cia_context* ctx)
|
||||||
@@ -304,5 +305,5 @@ void cia_print(cia_context* ctx)
|
|||||||
fprintf(stdout, "Meta offset: 0x%04x\n", ctx->offsetmeta);
|
fprintf(stdout, "Meta offset: 0x%04x\n", ctx->offsetmeta);
|
||||||
fprintf(stdout, "Meta size: 0x%04x\n", ctx->sizemeta);
|
fprintf(stdout, "Meta size: 0x%04x\n", ctx->sizemeta);
|
||||||
fprintf(stdout, "Content offset: 0x%08x\n", ctx->offsetcontent);
|
fprintf(stdout, "Content offset: 0x%08x\n", ctx->offsetcontent);
|
||||||
fprintf(stdout, "Content size: 0x%016llx\n", getle64(header->contentsize));
|
fprintf(stdout, "Content size: 0x%016"PRIx64"\n", getle64(header->contentsize));
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-7
@@ -5,6 +5,7 @@
|
|||||||
#include "exheader.h"
|
#include "exheader.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "ncch.h"
|
#include "ncch.h"
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
void exheader_init(exheader_context* ctx)
|
void exheader_init(exheader_context* ctx)
|
||||||
{
|
{
|
||||||
@@ -428,7 +429,7 @@ void exheader_print_arm11storageinfo(exheader_context* ctx)
|
|||||||
accessiblesaveID[i] = 0;
|
accessiblesaveID[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stdout, "Ext savedata id: 0x%08llX\n",extdataID);
|
fprintf(stdout, "Ext savedata id: 0x%08"PRIX64"\n",extdataID);
|
||||||
for(i = 0; i < 2; i++)
|
for(i = 0; i < 2; i++)
|
||||||
fprintf(stdout, "System savedata id %d: 0x%08x %s\n",i+1,systemsaveID[i],exheader_getvalidstring(ctx->validsystemsaveID[i]));
|
fprintf(stdout, "System savedata id %d: 0x%08x %s\n",i+1,systemsaveID[i],exheader_getvalidstring(ctx->validsystemsaveID[i]));
|
||||||
for(i = 0; i < 3; i++)
|
for(i = 0; i < 3; i++)
|
||||||
@@ -578,17 +579,17 @@ void exheader_print(exheader_context* ctx)
|
|||||||
for(i=0; i<0x30; i++)
|
for(i=0; i<0x30; i++)
|
||||||
{
|
{
|
||||||
if (getle64(ctx->header.deplist.programid[i]) != 0x0000000000000000UL)
|
if (getle64(ctx->header.deplist.programid[i]) != 0x0000000000000000UL)
|
||||||
fprintf(stdout, "Dependency: %016llX\n", getle64(ctx->header.deplist.programid[i]));
|
fprintf(stdout, "Dependency: %016"PRIX64"\n", getle64(ctx->header.deplist.programid[i]));
|
||||||
}
|
}
|
||||||
if(savedatasize < sizeKB)
|
if(savedatasize < sizeKB)
|
||||||
fprintf(stdout, "Savedata size: 0x%llX\n", savedatasize);
|
fprintf(stdout, "Savedata size: 0x%"PRIX64"\n", savedatasize);
|
||||||
else if(savedatasize < sizeMB)
|
else if(savedatasize < sizeMB)
|
||||||
fprintf(stdout, "Savedata size: %lluK\n", savedatasize/sizeKB);
|
fprintf(stdout, "Savedata size: %"PRIu64"K\n", savedatasize/sizeKB);
|
||||||
else
|
else
|
||||||
fprintf(stdout, "Savedata size: %lluM\n", savedatasize/sizeMB);
|
fprintf(stdout, "Savedata size: %"PRIu64"M\n", savedatasize/sizeMB);
|
||||||
fprintf(stdout, "Jump id: %016llX\n", getle64(ctx->header.systeminfo.jumpid));
|
fprintf(stdout, "Jump id: %016"PRIx64"\n", getle64(ctx->header.systeminfo.jumpid));
|
||||||
|
|
||||||
fprintf(stdout, "Program id: %016llX %s\n", getle64(ctx->header.arm11systemlocalcaps.programid), exheader_getvalidstring(ctx->validprogramid));
|
fprintf(stdout, "Program id: %016"PRIx64" %s\n", getle64(ctx->header.arm11systemlocalcaps.programid), exheader_getvalidstring(ctx->validprogramid));
|
||||||
fprintf(stdout, "Core version: 0x%X\n", getle32(ctx->header.arm11systemlocalcaps.coreversion));
|
fprintf(stdout, "Core version: 0x%X\n", getle32(ctx->header.arm11systemlocalcaps.coreversion));
|
||||||
fprintf(stdout, "System mode: 0x%X\n", (ctx->header.arm11systemlocalcaps.flag>>4)&0xF);
|
fprintf(stdout, "System mode: 0x%X\n", (ctx->header.arm11systemlocalcaps.flag>>4)&0xF);
|
||||||
fprintf(stdout, "Ideal processor: %d %s\n", (ctx->header.arm11systemlocalcaps.flag>>0)&0x3, exheader_getvalidstring(ctx->valididealprocessor));
|
fprintf(stdout, "Ideal processor: %d %s\n", (ctx->header.arm11systemlocalcaps.flag>>0)&0x3, exheader_getvalidstring(ctx->valididealprocessor));
|
||||||
|
|||||||
+4
-3
@@ -5,6 +5,7 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "ivfc.h"
|
#include "ivfc.h"
|
||||||
#include "ctr.h"
|
#include "ctr.h"
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
void ivfc_init(ivfc_context* ctx)
|
void ivfc_init(ivfc_context* ctx)
|
||||||
{
|
{
|
||||||
@@ -168,9 +169,9 @@ void ivfc_print(ivfc_context* ctx)
|
|||||||
fprintf(stdout, "Level %d: \n", i);
|
fprintf(stdout, "Level %d: \n", i);
|
||||||
else
|
else
|
||||||
fprintf(stdout, "Level %d (%s): \n", i, level->hashcheck == Good? "GOOD" : "FAIL");
|
fprintf(stdout, "Level %d (%s): \n", i, level->hashcheck == Good? "GOOD" : "FAIL");
|
||||||
fprintf(stdout, " Data offset: 0x%016llx\n", ctx->offset + level->dataoffset);
|
fprintf(stdout, " Data offset: 0x%016"PRIx64"\n", ctx->offset + level->dataoffset);
|
||||||
fprintf(stdout, " Data size: 0x%016llx\n", level->datasize);
|
fprintf(stdout, " Data size: 0x%016"PRIx64"\n", level->datasize);
|
||||||
fprintf(stdout, " Hash offset: 0x%016llx\n", ctx->offset + level->hashoffset);
|
fprintf(stdout, " Hash offset: 0x%016"PRIx64"\n", ctx->offset + level->hashoffset);
|
||||||
fprintf(stdout, " Hash block size: 0x%08x\n", level->hashblocksize);
|
fprintf(stdout, " Hash block size: 0x%08x\n", level->hashblocksize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-3
@@ -6,6 +6,7 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "ctr.h"
|
#include "ctr.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
static int programid_is_system(u8 programid[8])
|
static int programid_is_system(u8 programid[8])
|
||||||
{
|
{
|
||||||
@@ -561,10 +562,10 @@ void ncch_print(ncch_context* ctx)
|
|||||||
else
|
else
|
||||||
memdump(stdout, "Signature (FAIL): ", header->signature, 0x100);
|
memdump(stdout, "Signature (FAIL): ", header->signature, 0x100);
|
||||||
fprintf(stdout, "Content size: 0x%08x\n", getle32(header->contentsize)*mediaunitsize);
|
fprintf(stdout, "Content size: 0x%08x\n", getle32(header->contentsize)*mediaunitsize);
|
||||||
fprintf(stdout, "Partition id: %016llx\n", getle64(header->partitionid));
|
fprintf(stdout, "Partition id: %016"PRIx64"\n", getle64(header->partitionid));
|
||||||
fprintf(stdout, "Maker code: %04x\n", getle16(header->makercode));
|
fprintf(stdout, "Maker code: %04x\n", getle16(header->makercode));
|
||||||
fprintf(stdout, "Version: %04x\n", getle16(header->version));
|
fprintf(stdout, "Version: %04x\n", getle16(header->version));
|
||||||
fprintf(stdout, "Program id: %016llx\n", getle64(header->programid));
|
fprintf(stdout, "Program id: %016"PRIx64"\n", getle64(header->programid));
|
||||||
if(ctx->logohashcheck == Unchecked)
|
if(ctx->logohashcheck == Unchecked)
|
||||||
memdump(stdout, "Logo hash: ", header->logohash, 0x20);
|
memdump(stdout, "Logo hash: ", header->logohash, 0x20);
|
||||||
else if(ctx->logohashcheck == Good)
|
else if(ctx->logohashcheck == Good)
|
||||||
@@ -579,7 +580,7 @@ void ncch_print(ncch_context* ctx)
|
|||||||
memdump(stdout, "Exheader hash (GOOD): ", header->extendedheaderhash, 0x20);
|
memdump(stdout, "Exheader hash (GOOD): ", header->extendedheaderhash, 0x20);
|
||||||
else
|
else
|
||||||
memdump(stdout, "Exheader hash (FAIL): ", header->extendedheaderhash, 0x20);
|
memdump(stdout, "Exheader hash (FAIL): ", header->extendedheaderhash, 0x20);
|
||||||
fprintf(stdout, "Flags: %016llx\n", getle64(header->flags));
|
fprintf(stdout, "Flags: %016"PRIx64"\n", getle64(header->flags));
|
||||||
fprintf(stdout, " > Mediaunit size: 0x%x\n", mediaunitsize);
|
fprintf(stdout, " > Mediaunit size: 0x%x\n", mediaunitsize);
|
||||||
if (header->flags[7] & 4)
|
if (header->flags[7] & 4)
|
||||||
fprintf(stdout, " > Crypto key: None\n");
|
fprintf(stdout, " > Crypto key: None\n");
|
||||||
|
|||||||
+2
-1
@@ -5,6 +5,7 @@
|
|||||||
#include "ncsd.h"
|
#include "ncsd.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "ctr.h"
|
#include "ctr.h"
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
|
||||||
void ncsd_init(ncsd_context* ctx)
|
void ncsd_init(ncsd_context* ctx)
|
||||||
@@ -122,7 +123,7 @@ void ncsd_print(ncsd_context* ctx)
|
|||||||
else
|
else
|
||||||
memdump(stdout, "Signature (FAIL): ", header->signature, 0x100);
|
memdump(stdout, "Signature (FAIL): ", header->signature, 0x100);
|
||||||
fprintf(stdout, "Media size: 0x%08x\n", getle32(header->mediasize));
|
fprintf(stdout, "Media size: 0x%08x\n", getle32(header->mediasize));
|
||||||
fprintf(stdout, "Media id: %016llx\n", getle64(header->mediaid));
|
fprintf(stdout, "Media id: %016"PRIX64"\n", getle64(header->mediaid));
|
||||||
//memdump(stdout, "Partition FS type: ", header->partitionfstype, 8);
|
//memdump(stdout, "Partition FS type: ", header->partitionfstype, 8);
|
||||||
//memdump(stdout, "Partition crypt type: ", header->partitioncrypttype, 8);
|
//memdump(stdout, "Partition crypt type: ", header->partitioncrypttype, 8);
|
||||||
//memdump(stdout, "Partition offset/size: ", header->partitionoffsetandsize, 0x40);
|
//memdump(stdout, "Partition offset/size: ", header->partitionoffsetandsize, 0x40);
|
||||||
|
|||||||
+2
-1
@@ -4,6 +4,7 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "tmd.h"
|
#include "tmd.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
|
||||||
void tmd_init(tmd_context* ctx)
|
void tmd_init(tmd_context* ctx)
|
||||||
@@ -158,7 +159,7 @@ void tmd_print(tmd_context* ctx)
|
|||||||
fprintf(stdout, "[shared]");
|
fprintf(stdout, "[shared]");
|
||||||
}
|
}
|
||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
fprintf(stdout, "Content size: %016llx\n", getbe64(chunk->size));
|
fprintf(stdout, "Content size: %016"PRIx64"\n", getbe64(chunk->size));
|
||||||
|
|
||||||
switch(ctx->content_hash_stat[getbe16(chunk->index)]) {
|
switch(ctx->content_hash_stat[getbe16(chunk->index)]) {
|
||||||
case 1: memdump(stdout, "Content hash [OK]: ", chunk->hash, 32); break;
|
case 1: memdump(stdout, "Content hash [OK]: ", chunk->hash, 32); break;
|
||||||
|
|||||||
Reference in New Issue
Block a user