Skip to content

Commit

Permalink
cIPL working on 4g+
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Apr 15, 2024
1 parent ba136ad commit 733c6e9
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 35 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ clean:
$(Q)$(MAKE) $@ -C extras/apps/installer/
$(Q)$(MAKE) $@ -C extras/apps/uninstaller
$(Q)$(MAKE) $@ -C libs/daveeipl
$(Q)$(MAKE) $@ -C loader/perma/cipl/new/ipl_stage1_payload
$(Q)$(MAKE) $@ -C loader/perma/cipl/new/ipl_stage2_payload
$(Q)rm -f extras/apps/updater/ARK_01234.PKG | true
$(Q)rm -f extras/apps/updater/EBOOT_PSP.PBP | true
$(Q)rm -f extras/apps/updater/EBOOT_GO.PBP | true
Expand Down
42 changes: 21 additions & 21 deletions libs/daveeipl/handshake.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,49 +146,49 @@ static const HandshakeSecrets *get_handshake_secrets(unsigned int version)
// (04g/07g/09g/11g) or type2 (05g) secrets
unsigned int model_code = BARYON_VERSION_MODEL_CODE(version);

// type1 is 04g/07g/09g/11g
if (BARYON_MODEL_CODE_IS_HANDSHAKE_TYPE1(model_code)) {
static const HandshakeSecrets type1_secrets = {
// type2 is 05g
if (BARYON_MODEL_CODE_IS_HANDSHAKE_TYPE2(model_code)) {
static const HandshakeSecrets type2_secret = {
.secret1 = {
0x8D, 0x5D, 0xA6, 0x08, 0xF2, 0xBB, 0xC6, 0xCC,
0x61, 0x7A, 0x56, 0x42, 0xF8, 0xED, 0xC5, 0xE4,
0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23
},
.secret2 = {
0xD5, 0x96, 0x55, 0x56, 0xB9, 0x39, 0xD8, 0x9D,
0x6E, 0x79, 0xD3, 0x8C, 0x88, 0x7B, 0xF3, 0x0A
0xF3, 0x58, 0x22, 0xBA, 0x99, 0x4F, 0x86, 0x93,
0x6A, 0xFF, 0xB7, 0x05, 0x5D, 0xDD, 0x14, 0xFC,
},
.expected1 = {
0x34, 0xDB, 0x81, 0x24, 0x1D, 0x6F, 0x40, 0x57
.expected1 = {
0xDB, 0xB1, 0x1E, 0x20, 0x48, 0x83, 0xB1, 0x6F
},
.expected2 = {
0xE0, 0xDC, 0x41, 0xAF, 0xC2, 0xCD, 0x1C, 0x2D
0x04, 0xF4, 0x69, 0x8A, 0x8C, 0xAA, 0x95, 0x30
}
};

return &type1_secrets;
return &type2_secret;
}

// type2 is 05g
else if (BARYON_MODEL_CODE_IS_HANDSHAKE_TYPE2(model_code)) {
static const HandshakeSecrets type2_secret = {
// type1 is 04g/07g/09g/11g
//if (BARYON_MODEL_CODE_IS_HANDSHAKE_TYPE1(model_code)) {
static const HandshakeSecrets type1_secrets = {
.secret1 = {
0x61, 0x7A, 0x56, 0x42, 0xF8, 0xED, 0xC5, 0xE4,
0x8D, 0x5D, 0xA6, 0x08, 0xF2, 0xBB, 0xC6, 0xCC,
0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23
},
.secret2 = {
0xF3, 0x58, 0x22, 0xBA, 0x99, 0x4F, 0x86, 0x93,
0x6A, 0xFF, 0xB7, 0x05, 0x5D, 0xDD, 0x14, 0xFC,
0xD5, 0x96, 0x55, 0x56, 0xB9, 0x39, 0xD8, 0x9D,
0x6E, 0x79, 0xD3, 0x8C, 0x88, 0x7B, 0xF3, 0x0A
},
.expected1 = {
0xDB, 0xB1, 0x1E, 0x20, 0x48, 0x83, 0xB1, 0x6F
.expected1 = {
0x34, 0xDB, 0x81, 0x24, 0x1D, 0x6F, 0x40, 0x57
},
.expected2 = {
0x04, 0xF4, 0x69, 0x8A, 0x8C, 0xAA, 0x95, 0x30
0xE0, 0xDC, 0x41, 0xAF, 0xC2, 0xCD, 0x1C, 0x2D
}
};

return &type2_secret;
}
return &type1_secrets;
//}

return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion libs/iplsdk/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TARGET = iplsdk
OBJS = fat.o kirk.o ms.o printf.o syscon.o sysreg.o uart.o gpio.o
OBJS = kirk.o printf.o syscon.o sysreg.o uart.o

INCDIR =
CFLAGS = -Os -G0 -Wall -std=c99 -fno-pic $(BFLAGS) -fdata-sections -ffunction-sections -Wl,--gc-sections
Expand Down
10 changes: 0 additions & 10 deletions libs/iplsdk/sysreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,4 @@ void SysregBusclkKirkDisable()
void SysregResetKirkDisable()
{
SysregReset(0x400, 0);
}

void sysreg_io_enable_gpio(void)
{
REG32(0xbc100058) |= 0x800000;
}

void sysreg_io_enable_gpio_port(int port)
{
REG32(0xbc10007c) |= (1 << port);
}
11 changes: 9 additions & 2 deletions loader/dc/vunbricker/install.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,8 @@ int install_thread(SceSize args, void *argp)
dcSetCancelMode(1);

#ifndef INFINITY
if (fw != FW_OFW && model > 2)
InstallError(fw, "Unsupported model.");
//if (fw != FW_OFW && model > 2)
// InstallError(fw, "Unsupported model.");
#endif

switch(LoadUpdaterModules(fw))
Expand Down Expand Up @@ -1066,6 +1066,8 @@ int install_thread(SceSize args, void *argp)
case 1: ipl_name = "flash0:/ipl_02g.bin"; break;
case 2: ipl_name = "flash0:/ipl_03g.bin"; ipl_key = 1; break;
case 3: ipl_name = "flash0:/ipl_04g.bin"; ipl_key = 1; break;
case 4: ipl_name = "flash0:/ipl_05g.bin"; ipl_key = 2; break;
case 6: ipl_name = "flash0:/ipl_07g.bin"; ipl_key = 1; break;
case 8: ipl_name = "flash0:/ipl_09g.bin"; ipl_key = 1; break;
case 10: ipl_name = "flash0:/ipl_11g.bin"; ipl_key = 1; break;
default: InstallError(fw, "Unsupported model.");
Expand All @@ -1092,6 +1094,11 @@ int install_thread(SceSize args, void *argp)
}
break;
case 2: ipl_name = "flash0:/cipl_03g.bin"; break;
case 3: ipl_name = "flash0:/cipl_04g.bin"; break;
case 4: ipl_name = "flash0:/cipl_05g.bin"; break;
case 6: ipl_name = "flash0:/cipl_07g.bin"; break;
case 8: ipl_name = "flash0:/cipl_09g.bin"; break;
case 10: ipl_name = "flash0:/cipl_11g.bin"; break;
default: InstallError(fw, "Unsupported model.");
}
}
Expand Down
2 changes: 1 addition & 1 deletion loader/perma/cipl/new/ipl_stage1_payload/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CFLAGS = -Os -G0 -Wall -std=c99 -fno-pic $(BFLAGS) -fdata-sections -ffunction-se
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBS = -ldaveeipl
LIBS = -ldaveeipl -liplsdk
LIBDIR = $(ARKROOT)/libs
LDFLAGS = -nostartfiles -T linkfile.l -fdata-sections -ffunction-sections -Wl,--gc-sections

Expand Down
1 change: 1 addition & 0 deletions loader/perma/cipl/new/ipl_stage1_payload/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ int main()
#ifndef MSIPL
syscon_init();
#ifdef SET_SEED_ADDRESS
unlockSyscon();
syscon_handshake_unlock();
#endif
#endif
Expand Down

0 comments on commit 733c6e9

Please sign in to comment.