From 656331af532ac09e8689e26fbc7b0c2fef22f81e Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 2 Aug 2017 13:00:11 -0400 Subject: [PATCH] Minor changes to ACTU, also displays Mii ID (nothing major) Worth mentioning my mii data struct is probably quite off. --- include/services/actu.h | 4 ++-- source/main.c | 25 +++++++++++++------------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/services/actu.h b/include/services/actu.h index d320ab7..aea964b 100644 --- a/include/services/actu.h +++ b/include/services/actu.h @@ -15,9 +15,9 @@ struct Birthday typedef struct { - u8 miiID[0x4]; // Mii ID + u32 miiID; // Mii ID u64 systemID; // System ID (identifies owner, for purpose of enforcing editing restrictions and blue pants). - u8 dateOfCreation[0x4]; // Specialness and date of creation (big-endian 32bit unsigned integer) + u32 dateOfCreation; // Specialness and date of creation (big-endian 32bit unsigned integer) u8 mac_addr[0x6]; // Creator's full MAC u16 padding1; u16 birthday; // Bit-mapped: Birthday (4bit-day,5bit-month), Sex, Shirt color, Favorite diff --git a/source/main.c b/source/main.c index 547e314..2eaaa03 100644 --- a/source/main.c +++ b/source/main.c @@ -61,15 +61,16 @@ int main(int argc, char *argv[]) //=====================================================================// double wifiPercent, volPercent, _3dSliderPercent; - unsigned long long transferableID = 0, homemenuID = 0; + unsigned long long homemenuID = 0; u32 ip; - unsigned int principalID = 0, persistentID = 0; - u16 info[0x16]; + unsigned int principalID = 0; u8 batteryPercent = 0, batteryVolt = 0, volume = 0, mcuFwMajor = 0, mcuFwMinor = 0; bool isConnected = false; char sdFreeSize[16], sdTotalSize[16], ctrFreeSize[16], ctrTotalSize[16], name[0x16]; Result ret = 0; wifiSlotStructure slotData; + AccountDataBlock accountDataBlock; + MiiData miiData; consoleInit(GFX_BOTTOM, NULL); @@ -88,21 +89,21 @@ int main(int argc, char *argv[]) ACTU_GetAccountDataBlock(&principalID, 0x4, 0xC); // First check if principal ID exists then display NNID info. + ACTU_GetAccountDataBlock((u8*)&accountDataBlock, 0xA0, 0x11); + ACTU_GetAccountDataBlock((u8*)&miiData, 0x60, 0x7); + if (principalID != 0) { printf("\x1b[35;1m*\x1b[0m NNID: \x1b[35;1m%s\x1b[0m\n", getNNIDInfo(0x11, 0x8)); - ACTU_GetAccountDataBlock(info, 0x16, 0x1B); - utf2ascii(name, info); - printf("\x1b[35;1m*\x1b[0m Mii name: \x1b[35;1m%s\x1b[0m\n", name); + utf2ascii(name, accountDataBlock.miiName); + printf("\x1b[35;1m*\x1b[0m Mii name: \x1b[35;1m%s\x1b[0m (\x1b[35;1m%u\x1b[0m)\n", name, (unsigned int)miiData.miiID); printf("\x1b[35;1m*\x1b[0m Principal ID: \x1b[35;1m%u\x1b[0m\n", principalID); - - ACTU_GetAccountDataBlock(&persistentID, 0x4, 0x5); - printf("\x1b[35;1m*\x1b[0m Persistent ID: \x1b[35;1m%u\x1b[0m\n", persistentID); - - ACTU_GetAccountDataBlock(&transferableID, 0x8, 0x6); - printf("\x1b[35;1m*\x1b[0m Transferable ID: \x1b[35;1m%llu\x1b[0m\n", transferableID); + + printf("\x1b[35;1m*\x1b[0m Persistent ID: \x1b[35;1m%u\x1b[0m\n", (unsigned int)accountDataBlock.persistentID); + + printf("\x1b[35;1m*\x1b[0m Transferable ID: \x1b[35;1m%llu\x1b[0m\n", accountDataBlock.transferableID); printf("\x1b[35;1m*\x1b[0m Country: \x1b[35;1m%s\x1b[0m\n", getNNIDInfo(0x3, 0xB));