Skip to content

Commit

Permalink
v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoti committed Jan 16, 2024
1 parent 06f785c commit d3d6a37
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 48 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,11 @@

# Debug files
*.dSYM/
*.su

# Sony PlayStation Vita
*.velf
*.vpk

# Archives
*.7z
*.zip
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# psv_idpsdump
PSV IDPS Dumper (GPLv3) / based on VitaCID by Major_Tom

v1.0 [PSP/PSV]
- psp qaf detection
- regions also has their retail codes

v0.9 [PSP/PSV]
- psv proto/devkit/testkit detection
- pstv testkit proper detection
Expand Down
3 changes: 3 additions & 0 deletions change.log
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ v0.8 [PSP/PSV]
v0.9 [PSP/PSV]
- psv proto/devkit/testkit detection
- pstv testkit proper detection
v1.0 [PSP/PSV]
- psp qaf detection
- regions also has their retail codes
77 changes: 36 additions & 41 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#include "graphics.h"

#define VER_MAJOR 0
#define VER_MINOR 9
#define VER_MAJOR 1
#define VER_MINOR 0
#define VER_BUILD ""

#define VAL_LENGTH 0x10
Expand All @@ -32,27 +32,23 @@ int _vshSblAimgrGetConsoleId(char CID[32]);

SceCtrlData pad;

void ExitCross(char*text)
{
void ExitCross(char*text) {
printf("%s, press X to exit...\n", text);
do
{
do {
sceCtrlReadBufferPositive(0, &pad, 1);
sceKernelDelayThread(0.05*1000*1000);
}
while(!(pad.buttons & SCE_CTRL_CROSS));
sceKernelExitProcess(0);
}

void ExitError(char*text, int delay, int error)
{
void ExitError(char*text, int delay, int error) {
printf(text, error);
sceKernelDelayThread(delay*1000*1000);
sceKernelExitProcess(0);
}

int WriteFile(char*file, void*buf, int size)
{
int WriteFile(char*file, void*buf, int size) {
sceIoRemove(file);
SceUID fd = sceIoOpen(file, SCE_O_WRONLY | SCE_O_CREAT | SCE_O_TRUNC, 0777);
if (fd < 0)
Expand All @@ -64,8 +60,7 @@ int WriteFile(char*file, void*buf, int size)
return written;
}

int main(int argc, char *argv[])
{
int main(int argc, char *argv[]) {
int i = 0;
int paranoid = 0;
char idps_buffer[16];
Expand Down Expand Up @@ -101,6 +96,8 @@ int main(int argc, char *argv[])
psvDebugScreenSetFgColor(0xFF0000FF); // red #3
else if (i == 0x07)
psvDebugScreenSetFgColor(0xFF00FF00); // green #4
else if (i == 0x08)
psvDebugScreenSetFgColor(0xFF007FFF); // orange #5
else
psvDebugScreenSetFgColor(0xFFFFFFFF); // white
printf("%02X", (u8)idps_buffer[i]);
Expand All @@ -123,8 +120,7 @@ int main(int argc, char *argv[])
psvDebugScreenSetFgColor(0xFF0000FF); // red
if (idps_buffer[0x04] == 0x00)
printf("PlayStation Portable");
else if (idps_buffer[0x04] == 0x01) // psv, vtv/pstv
{
else if (idps_buffer[0x04] == 0x01) { // psv, vtv/pstv
if (idps_buffer[0x06] == 0x00)
printf("PlayStation Vita"); // fatWF/fat3G, slim
else if (idps_buffer[0x06] == 0x02)
Expand All @@ -133,18 +129,15 @@ int main(int argc, char *argv[])
printf("PlayStation/Vita TV"); // vtv, pstv (testkit)
else
printf("Unknown Vita 0x%02X", idps_buffer[0x06]);
}
else
} else
printf("Unknown PS 0x%02X", idps_buffer[0x04]);
psvDebugScreenSetFgColor(0xFFFFFFFF); // white
printf("\n");

printf(" Your motherboard is ");
psvDebugScreenSetFgColor(0xFF00FF00); // green
if (idps_buffer[0x06] == 0x00) // portable
{
switch(idps_buffer[0x07])
{
if (idps_buffer[0x06] == 0x00) { // portable
switch(idps_buffer[0x07]) {
case 0x01:
printf("TA-079/081 (PSP-1000)");
break;
Expand Down Expand Up @@ -189,11 +182,8 @@ int main(int argc, char *argv[])
printf("Unknown MoBo 0x%02X", idps_buffer[0x07]);
break;
}
}
else if ((idps_buffer[0x06] == 0x02) || (idps_buffer[0x06] == 0x06)) // home system
{
switch(idps_buffer[0x07])
{
} else if ((idps_buffer[0x06] == 0x02) || (idps_buffer[0x06] == 0x06)) { // home system
switch(idps_buffer[0x07]) {
case 0x01:
printf("DOL-1001 (VTE-1000)");
break;
Expand All @@ -207,13 +197,18 @@ int main(int argc, char *argv[])
}
else
printf("Unknown type 0x%02X", idps_buffer[0x06]);
psvDebugScreenSetFgColor(0xFF007FFF); // orange
if ((u8)idps_buffer[0x08] == 0x8C)
printf(" [QAF]");
else
printf(" [non-QAF]");
psvDebugScreenSetFgColor(0xFFFFFFFF); // white
//printf(" [Product Sub Code]");
printf("\n");

printf(" And your region is ");
psvDebugScreenSetFgColor(0xFFFF0000); // blue
switch(idps_buffer[0x05])
{
switch(idps_buffer[0x05]) {
case 0x00:
printf("Proto");
break;
Expand All @@ -224,43 +219,44 @@ int main(int argc, char *argv[])
printf("TestKit");
break;
case 0x03:
printf("Japan");
printf("Japan 00");
break;
case 0x04:
printf("North America");
printf("North America 01");
break;
case 0x05:
printf("Europe/East/Africa");
printf("Europe/East/Africa 04");
break;
case 0x06:
printf("Korea");
printf("Korea 05");
break;
case 0x07: // PCH-xx03 VTE-1016
printf("Great Britain/United Kingdom");
case 0x07:
printf("Great Britain/United Kingdom 03");
break;
case 0x08:
printf("Mexica/Latin America");
printf("Mexica/Latin America 10");
break;
case 0x09:
printf("Australia/New Zeland");
printf("Australia/New Zeland 02");
break;
case 0x0A:
printf("Hong Kong/Singapore");
printf("Hong Kong/Singapore 06");
break;
case 0x0B:
printf("Taiwan");
printf("Taiwan 07");
break;
case 0x0C:
printf("Russia");
printf("Russia 08");
break;
case 0x0D:
printf("China");
printf("China 09");
break;
default:
printf("Unknown region 0x%02X", idps_buffer[0x05]);
break;
}
psvDebugScreenSetFgColor(0xFFFFFFFF); // white
//printf(" [Product Code]");
printf("\n\n");

// binary
Expand All @@ -272,8 +268,7 @@ int main(int argc, char *argv[])
printf("\n");

// text
for (i=0; i<0x10; i++)
{
for (i=0; i<0x10; i++) {
idps_text_char_tmp[1]=idps_buffer[i];
idps_text_char_1st[1]=(idps_text_char_tmp[1] & 0xf0) >> 4;
idps_text_char_2nd[1]=(idps_text_char_tmp[1] & 0x0f);
Expand Down
6 changes: 3 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TITLE_ID = YPID00001
TITLE = PSV IDPS Dumper v0.9
TARGET = PSV_IDPS_Dumper_v0.9
TITLE = PSV IDPS Dumper v1.0
TARGET = PSV_IDPS_Dumper_v1.0
OBJS = main.o graphics.o font.o

LIBS = -lSceLibKernel_stub -lSceVshBridge_stub -lSceDisplay_stub -lSceCtrl_stub
Expand All @@ -13,7 +13,7 @@ ASFLAGS = $(CFLAGS)
all: $(TARGET).vpk

%.vpk: eboot.bin
vita-mksfoex -d PARENTAL_LEVEL=1 -s APP_VER=00.80 -s TITLE_ID=$(TITLE_ID) "$(TITLE)" param.sfo
vita-mksfoex -d PARENTAL_LEVEL=1 -s APP_VER=01.00 -s TITLE_ID=$(TITLE_ID) "$(TITLE)" param.sfo
vita-pack-vpk -s param.sfo -b eboot.bin \
--add change.log=sce_sys/manual/change.log \
--add thanks.txt=sce_sys/manual/thanks.txt \
Expand Down
6 changes: 3 additions & 3 deletions makefile_lite
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TITLE_ID = YPID00001
TITLE = PSV IDPS Dumper v0.9
TARGET = PSV_IDPS_Dumper_v0.9
TITLE = PSV IDPS Dumper v1.0
TARGET = PSV_IDPS_Dumper_v1.0
OBJS = main.o graphics.o font.o

LIBS = -lSceLibKernel_stub -lSceVshBridge_stub -lSceDisplay_stub -lSceCtrl_stub
Expand All @@ -13,7 +13,7 @@ ASFLAGS = $(CFLAGS)
all: $(TARGET).vpk

%.vpk: eboot.bin
vita-mksfoex -d PARENTAL_LEVEL=1 -s APP_VER=00.80 -s TITLE_ID=$(TITLE_ID) "$(TITLE)" param.sfo
vita-mksfoex -d PARENTAL_LEVEL=1 -s APP_VER=01.00 -s TITLE_ID=$(TITLE_ID) "$(TITLE)" param.sfo
vita-pack-vpk -s param.sfo -b eboot.bin $@

eboot.bin: $(TARGET).velf
Expand Down

0 comments on commit d3d6a37

Please sign in to comment.