Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
Add option to dump CID, and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
joel16 committed Jun 13, 2017
1 parent 08cfdb9 commit 4ff75a2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
13 changes: 13 additions & 0 deletions src/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,17 @@ char * getVitaModel()
return "2000";
else
return "1000";
}

int writeFile(char *file, void *buf, int size)
{
SceUID fd = sceIoOpen(file, SCE_O_WRONLY | SCE_O_CREAT | SCE_O_TRUNC, 0777);

if (fd < 0)
return fd;

int written = sceIoWrite(fd, buf, size);
sceIoClose(fd);

return written;
}
1 change: 1 addition & 0 deletions src/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ typedef struct {

int fileExists(const char* path);
int dirExists(const char* path);
int writeFile(char *file, void *buf, int size);
SceOff getPartitionInfo(int storage, const char * partition);
char * getVitaModel();

Expand Down
5 changes: 3 additions & 2 deletions src/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ int getModel()
char * getCID()
{
char CID[32];
static char idps[2 * 16] = {0};
static char idps[32];

// Get IDPS
_vshSblAimgrGetConsoleId(CID);

int i = 0;
for (i = 0; i < 16; i++)
snprintf(idps + (i * 2), (2 * 16) - (i * 2) + 1, "%02X", CID[i]);
snprintf(idps + (i * 2), (32) - (i * 2) + 1, "%02X", CID[i]);

return idps;
}
Expand Down Expand Up @@ -133,6 +133,7 @@ const char * getBoard()
}

/*
const char * getSysrootKernelModes(int data)
{
if (data == 0) //ksceSysrootIsExternalBootMode
Expand Down
15 changes: 10 additions & 5 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int main(int argc, char *argv[])
initNet();
psvDebugScreenInit();

printStr(false, GREEN, "", "VITAident 0.7.2\n\n");
printStr(false, GREEN, "", "VITAident 0.7.3\n\n");

/*Kernel Info*/

Expand Down Expand Up @@ -112,15 +112,20 @@ int main(int argc, char *argv[])

printStr(true, GREEN, "Internal storage free: ", "%s\n", free_size_string);

printStr(false, GREEN, "", "\n> Press any key to exit =)");
printStr(false, GREEN, "", "\n> Press any key to exit =) (O will dump your CID)");

while (1)
{
//sceDisplayWaitVblankStart();

sceCtrlPeekBufferPositive(0, &pad, 1);

if (pad.buttons & SCE_CTRL_ANY_KEY)
if (pad.buttons & SCE_CTRL_CIRCLE)
{
char buf[32];
strcpy(buf, getCID());
writeFile("ux0:/cid.txt", buf, strlen(buf) + 1);
break;
}
else if (pad.buttons & SCE_CTRL_ANY_KEY)
break;
}

Expand Down

0 comments on commit 4ff75a2

Please sign in to comment.