Skip to content

Commit

Permalink
nnid: Hide non functioning details for now
Browse files Browse the repository at this point in the history
  • Loading branch information
joel16 committed Nov 11, 2024
1 parent 34de6a0 commit 3cdaa48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
11 changes: 6 additions & 5 deletions source/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace GUI {
ptmuInit();
cfguInit();
dspInit();
socInit((u32*)memalign(0x1000, 0x10000), 0x10000);
socInit(static_cast<u32 *>(memalign(0x1000, 0x10000)), 0x10000);
}

void Exit(void) {
Expand Down Expand Up @@ -214,10 +214,11 @@ namespace GUI {
static void NNIDInfoPage(const NNIDInfo &info, bool &displayInfo) {
GUI::DrawItemf(1, "Persistent ID:", "%u", displayInfo? info.persistentID : 0);
GUI::DrawItemf(2, "Transferable ID Base:", "%llu", displayInfo? info.transferableIdBase : 0);
GUI::DrawItem(3, "Account ID:", info.accountId);
GUI::DrawItem(4, "Country:", displayInfo? info.countryName : "");
GUI::DrawItemf(5, "Principal ID:", "%u", displayInfo? info.principalID : 0);
GUI::DrawItem(6, "NFS Password:", displayInfo? info.nfsPassword : "");
GUI::DrawItemf(3, "Principal ID:", "%u", displayInfo? info.principalID : 0);
// The following are not functioning
// GUI::DrawItem(4, "Account ID:", info.accountId);
// GUI::DrawItem(5, "Country:", displayInfo? info.countryName : "");
// GUI::DrawItem(6, "NFS Password:", displayInfo? info.nfsPassword : "");
}

static void ConfigInfoPage(const ConfigInfo &info, bool &displayInfo) {
Expand Down
19 changes: 11 additions & 8 deletions source/nnid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace NNID {
Result ret = 0;
u32 persistentId;

if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x5, 0x4, std::addressof(persistentId)))) {
if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x5, sizeof(u32), std::addressof(persistentId)))) {
return ret;
}

Expand All @@ -18,29 +18,31 @@ namespace NNID {
Result ret = 0;
u64 transferableIdBase;

if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x6, 0x8, std::addressof(transferableIdBase)))) {
if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x6, sizeof(u64), std::addressof(transferableIdBase)))) {
return ret;
}

return transferableIdBase;
}

// TODO: Fix/research
const char *GetAccountId(void) {
Result ret = 0;
static char accountId[0x11];

if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x8, 0x11, accountId))) {
if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x8, sizeof(accountId), accountId))) {
return "unknown";
}

return accountId;
}


// TODO: Fix/research
const char *GetCountryName(void) {
Result ret = 0;
static char countryName[0x3];

if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0xB, 0x3, countryName))) {
if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0xB, sizeof(countryName), countryName))) {
return "unknown";
}

Expand All @@ -51,18 +53,19 @@ namespace NNID {
Result ret = 0;
u32 principalId;

if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0xC, 0x4, std::addressof(principalId)))) {
if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0xC, sizeof(u32), std::addressof(principalId)))) {
return ret;
}

return principalId;
}


// TODO: Fix/research
const char *GetNfsPassword(void) {
Result ret = 0;
static char nfsPassword[0x11];

if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x1C, 0x11, nfsPassword))) {
if (R_FAILED(ret = ACTU::GetAccountDataBlock(0xFE, 0x1C, sizeof(nfsPassword), nfsPassword))) {
return "unknown";
}

Expand Down

0 comments on commit 3cdaa48

Please sign in to comment.