Reorganize storage details and add more info.

Now displays device ID, and soap ID.
Storage is displayed as {Partition} Storage : Free / Total
Enabled cfgs service to allow the use of CFGS functions (getSerial)
This commit is contained in:
Joel 2016-10-16 15:00:34 -05:00
parent 281c1a744c
commit 2d51eae691
4 changed files with 42 additions and 8 deletions

View File

@ -162,6 +162,7 @@ AccessControlInfo:
- cam:u
- cecd:u
- cfg:u
- cfg:s
- dlp:FKCL
- dlp:SRVR
- dsp::DSP
@ -169,7 +170,6 @@ AccessControlInfo:
- fs:USER
- gsp::Gpu
- hid:USER
- http:C
- mcu::HWC
- mic:u
- ndm:u

16
source/am.c Normal file
View File

@ -0,0 +1,16 @@
#include "am.h"
Result AMNet_GetDeviceCert(u8 *buffer)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x818,1,2); // 0x08180042
cmdbuf[1] = 0x180;
cmdbuf[2] = (0x180 << 4) | 0xC;
cmdbuf[3] = (u32)buffer;
if(R_FAILED(ret = svcSendSyncRequest(amHandle))) return ret;
return (Result)cmdbuf[1];
}

5
source/am.h Normal file
View File

@ -0,0 +1,5 @@
#include <3ds.h>
Handle amHandle;
Result AMNet_GetDeviceCert(u8 *buffer);

View File

@ -203,6 +203,20 @@ char * getSerialNum(void)
return str;
}
u32 getDeviceId(void)
{
u32 tmp = 0;
AM_GetDeviceId(&tmp);
return tmp;
}
u64 getSoapId(void)
{
u32 tmp = 0;
AM_GetDeviceId(&tmp);
return (tmp | (((u64) 4) << 32));
}
int main(int argc, char *argv[])
{
gfxInitDefault();
@ -251,7 +265,6 @@ int main(int argc, char *argv[])
getScreenType();
printf("\x1b[31m*\x1b[0m Region: %s\n", getRegion());
//printf("\x1b[31m*\x1b[0m Friend key: %llu\n", principalIdToFriendCode(getMyFriendKey().principalId));
printf("\x1b[31m*\x1b[0m Language: %s\n", getLang());
u32 nnidNum = 0xFFFFFFFF;
@ -276,7 +289,8 @@ int main(int argc, char *argv[])
{
vaPrint("\x1b[31m*\x1b[0m NNID number: Error could not retrieve NNID\n");
}
printf("\x1b[31m*\x1b[0m Device ID: (%lu)\n", getDeviceId());
printf("\x1b[31m*\x1b[0m ECS Device ID: (%llu)\n", getSoapId());
printf("\x1b[31m*\x1b[0m MAC Address: %s\n", getMacAddress());
printf("\x1b[31m*\x1b[0m Serial number: %s\n", getSerialNum());
@ -310,14 +324,13 @@ int main(int argc, char *argv[])
//printf("\x1b[32m*\x1b[0m SD Detected: %s\n", detectSD() ? "Yes" : "No"); Don't need this
FS_ArchiveResource resource = {0};
FSUSER_GetArchiveResource(&resource, SYSTEM_MEDIATYPE_SD);
printf("\x1b[32m*\x1b[0m SD Size: %.1f MB\n", (((u64) resource.totalClusters * (u64) resource.clusterSize) / 1024.0 / 1024.0));
printf("\x1b[32m*\x1b[0m SD Free: %.1f MB\n", ((u64) resource.freeClusters * (u64) resource.clusterSize) / 1024.0 / 1024.0);
FSUSER_GetArchiveResource(&resource, SYSTEM_MEDIATYPE_SD);
printf("\x1b[32m*\x1b[0m SD Size: Free (%.1f MB) / Total (%.1f MB)\n", (((u64) resource.freeClusters * (u64) resource.clusterSize) / 1024.0 / 1024.0), (((u64) resource.totalClusters * (u64) resource.clusterSize) / 1024.0 / 1024.0));
FSUSER_GetArchiveResource(&resource, SYSTEM_MEDIATYPE_CTR_NAND);
printf("\x1b[32m*\x1b[0m CTR Size: %.1f MB\n", (((u64) resource.totalClusters * (u64) resource.clusterSize) / 1024.0 / 1024.0));
printf("\x1b[32m*\x1b[0m CTR Free: %.1f MB\n", ((u64) resource.freeClusters * (u64) resource.clusterSize) / 1024.0 / 1024.0);
printf("\x1b[32m*\x1b[0m CTR Size: Free (%.1f MB) / Total (%.1f MB)\n", (((u64) resource.freeClusters * (u64) resource.clusterSize) / 1024.0 / 1024.0), (((u64) resource.totalClusters * (u64) resource.clusterSize) / 1024.0 / 1024.0));
u32 installedTitles = titleCount(MEDIATYPE_SD);
printf("\x1b[32m*\x1b[0m Installed titles: %i\n", (int)installedTitles);