Skip to content

Commit

Permalink
Merge upstream changes from GUI - Config Info category
Browse files Browse the repository at this point in the history
  • Loading branch information
joel16 committed Jun 10, 2017
1 parent c0fe6d3 commit 1f02265
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 2 deletions.
5 changes: 4 additions & 1 deletion include/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ u64 getSoapId(void);
char * getDeviceCert(void);
char * getNNID(void);
char * isDebugModeEnabled();
char * getBrightness(u32 screen);
char * getBrightness(u32 screen);
const char * getUsername();
char * getBirthday();
char * getEulaVersion();
1 change: 0 additions & 1 deletion resources/cia.rsf
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ AccessControlInfo:
- dlp:FKCL
- dlp:SRVR
- dsp::DSP
- frd:u
- fs:USER
- gsp::Gpu
- gsp::Lcd
Expand Down
4 changes: 4 additions & 0 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
45 changes: 45 additions & 0 deletions source/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 1f02265

Please sign in to comment.