diff --git a/include/system.h b/include/system.h index dc68c50..00a3729 100644 --- a/include/system.h +++ b/include/system.h @@ -12,4 +12,7 @@ u64 getSoapId(void); char * getDeviceCert(void); char * getNNID(void); char * isDebugModeEnabled(); -char * getBrightness(u32 screen); \ No newline at end of file +char * getBrightness(u32 screen); +const char * getUsername(); +char * getBirthday(); +char * getEulaVersion(); \ No newline at end of file diff --git a/resources/cia.rsf b/resources/cia.rsf index b89b072..e48bfbf 100644 --- a/resources/cia.rsf +++ b/resources/cia.rsf @@ -166,7 +166,6 @@ AccessControlInfo: - dlp:FKCL - dlp:SRVR - dsp::DSP - - frd:u - fs:USER - gsp::Gpu - gsp::Lcd diff --git a/source/main.c b/source/main.c index a0a9643..4062cac 100644 --- a/source/main.c +++ b/source/main.c @@ -62,6 +62,10 @@ int main(int argc, char *argv[]) consoleInit(GFX_BOTTOM, NULL); + printf("\x1b[36;1m*\x1b[0m Username: \x1b[36;1m %s \n\x1b[0m", getUsername()); + printf("\x1b[36;1m*\x1b[0m Birthday: \x1b[36;1m%s\x1b[0m \n", getBirthday()); + printf("\x1b[36;1m*\x1b[0m EULA version: \x1b[36;1m%s\x1b[0m \n\n ", getEulaVersion()); + printf("\n\x1b[32;1m> Press any key to exit =)\x1b[0m"); //printf("\x1b[31;1m*\x1b[0m Device cert: \x1b[31;1m%s\x1b[0m \n\n", getDeviceCert()); diff --git a/source/system.c b/source/system.c index 9a47637..6399937 100644 --- a/source/system.c +++ b/source/system.c @@ -227,3 +227,48 @@ char * getBrightness(u32 screen) else return "n3DS only"; } + +const char * getUsername() +{ + int i; + size_t size = 0x16; + u8 * temp = (u8*)malloc(size); + char * username = (char*)malloc(size / 2); + + for(i = 0; i < (size / 2); i++) + username[i] = 0; + + CFGU_GetConfigInfoBlk2(0x1C, 0xA0000, temp); + + for(i = 0; i < (size / 2); i++) + username[i] = (char)((u16*)temp)[i]; + + return username; +} + +char * getBirthday() +{ + u16 date = 0; + static char birthday[6]; + + CFGU_GetConfigInfoBlk2(0x2, 0xA0001, (u8*)&date); + + u8 month = date / 256; + u8 day = date % 256; + + sprintf(birthday, "%u/%u", day, month); + + return birthday; +} + +char * getEulaVersion() +{ + u8 eulaData[4]; + static char version[5]; + + CFGU_GetConfigInfoBlk2(4, 0xD0000, eulaData); + + sprintf(version, "%02X.%02X", eulaData[1], eulaData[0]); + + return version; +} \ No newline at end of file