Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
krazynez committed Jan 1, 2025
2 parents 387d2fe + 775de2d commit 7016bad
Show file tree
Hide file tree
Showing 13 changed files with 199 additions and 45 deletions.
2 changes: 1 addition & 1 deletion common/include/ark.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extern "C" {
#define ARK_MAJOR_VERSION 4
#define ARK_MINOR_VERSION 20
#define ARK_MICRO_VERSION 69
#define ARK_REVISION 151
#define ARK_REVISION 152

// Pointers and sizes
#define ARK_PATH_SIZE 128
Expand Down
4 changes: 4 additions & 0 deletions extras/150kernel/installer/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
TARGET = ark150addoninstaller
OBJS = \
pspbtcnf_game.h \
pspbtcnf.h \
reboot150.h \
systemctrl150.h \
tmctrl150.h \
Expand Down Expand Up @@ -29,6 +30,9 @@ all: $(TARGET).prx
pspbtcnf_game.h:
$(Q)bin2c ../btcnf/pspbtcnf_game.txt pspbtcnf_game.h pspbtcnf_game

pspbtcnf.h:
$(Q)bin2c ../btcnf/pspbtcnf.txt pspbtcnf.h pspbtcnf

reboot150.h:
$(Q)bin2c $(ARKROOT)/extras/150kernel/reboot150/reboot150.prx reboot150.h reboot150

Expand Down
172 changes: 139 additions & 33 deletions extras/150kernel/installer/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <kubridge.h>

#include "pspbtcnf_game.h"
#include "pspbtcnf.h"
#include "reboot150.h"
#include "systemctrl150.h"
#include "tmctrl150.h"
Expand All @@ -32,7 +33,7 @@ PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_VSH);

#define PSAR_SIZE_150 10149440

#define N_FILES 4
#define N_FILES 5

#define LOADEXEC_661_SIZE 0xBA00

Expand All @@ -49,6 +50,7 @@ ARKFile arkfiles[N_FILES] =
{ ARK_DC_PATH "/150/kd/ark_systemctrl150.prx", systemctrl150, sizeof(systemctrl150) },
{ ARK_DC_PATH "/150/tmctrl150.prx", tmctrl150, sizeof(tmctrl150) },
{ ARK_DC_PATH "/150/kd/pspbtcnf_game.txt", pspbtcnf_game, sizeof(pspbtcnf_game) },
{ ARK_DC_PATH "/150/kd/pspbtcnf.txt", pspbtcnf, sizeof(pspbtcnf) },
};

////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -90,7 +92,6 @@ u8 reboot661_header[REBOOT_HEADER_SIZE] =
};

#define N_DELETE 13
#define N_150 109

char *todelete[N_DELETE] =
{
Expand All @@ -109,11 +110,11 @@ char *todelete[N_DELETE] =
"flash0:/font/kr0.pgf"
};

char *subset150[N_150] =
char *subset150[] =
{
"flash0:/kd/ata.prx",
"flash0:/kd/audio.prx",
"flash0:/kd/ata.prx",
"flash0:/kd/audiocodec.prx",
"flash0:/kd/audio.prx",
"flash0:/kd/blkdev.prx",
"flash0:/kd/chkreg.prx",
"flash0:/kd/clockgen.prx",
Expand Down Expand Up @@ -148,41 +149,43 @@ char *subset150[N_150] =
"flash0:/kd/libupdown.prx",
"flash0:/kd/loadcore.prx",
"flash0:/kd/loadexec.prx",
"flash0:/kd/me_for_vsh.prx",
"flash0:/kd/me_wrapper.prx",
"flash0:/kd/mebooter.prx",
"flash0:/kd/mebooter_umdvideo.prx",
"flash0:/kd/mediaman.prx",
"flash0:/kd/mediasync.prx",
"flash0:/kd/me_for_vsh.prx",
"flash0:/kd/memab.prx",
"flash0:/kd/memlmd.prx",
"flash0:/kd/mesg_led.prx",
"flash0:/kd/me_wrapper.prx",
"flash0:/kd/mgr.prx",
"flash0:/kd/modulemgr.prx",
"flash0:/kd/mpeg_vsh.prx",
"flash0:/kd/mpegbase.prx",
"flash0:/kd/mpeg_vsh.prx",
"flash0:/kd/msaudio.prx",
"flash0:/kd/mscm.prx",
"flash0:/kd/msstor.prx",
"flash0:/kd/openpsid.prx",
"flash0:/kd/peq.prx",
"flash0:/kd/power.prx",
//"flash0:/kd/pspbtcnf.txt",
//"flash0:/kd/pspbtcnf_game.txt",
//"flash0:/kd/pspbtcnf.txt",
//"flash0:/kd/pspbtcnf_updater.txt",
"flash0:/kd/pspcnf_tbl.txt",
"flash0:/kd/pspnet.prx",
"flash0:/kd/pspnet_adhoc.prx",
"flash0:/kd/pspnet_adhoc_auth.prx",
"flash0:/kd/pspnet_adhocctl.prx",
"flash0:/kd/pspnet_adhoc_download.prx",
"flash0:/kd/pspnet_adhoc_matching.prx",
"flash0:/kd/pspnet_adhocctl.prx",
"flash0:/kd/pspnet_ap_dialog_dummy.prx",
"flash0:/kd/pspnet_adhoc.prx",
"flash0:/kd/pspnet_apctl.prx",
"flash0:/kd/pspnet_ap_dialog_dummy.prx",
"flash0:/kd/pspnet_inet.prx",
"flash0:/kd/pspnet.prx",
"flash0:/kd/pspnet_resolver.prx",
"flash0:/kd/pwm.prx",
"flash0:/kd/reboot.prx",
"flash0:/kd/registry.prx",
"flash0:/kd/resource/impose.rsc",
"flash0:/kd/resource",
"flash0:/kd/rtc.prx",
"flash0:/kd/semawm.prx",
"flash0:/kd/sircs.prx",
Expand All @@ -197,36 +200,133 @@ char *subset150[N_150] =
"flash0:/kd/umd9660.prx",
"flash0:/kd/umdman.prx",
"flash0:/kd/usb.prx",
"flash0:/kd/usbstor.prx",
"flash0:/kd/usbstorboot.prx",
"flash0:/kd/usbstormgr.prx",
"flash0:/kd/usbstorms.prx",
"flash0:/kd/usbstor.prx",
"flash0:/kd/usersystemlib.prx",
"flash0:/kd/utility.prx",
"flash0:/kd/utils.prx",
"flash0:/kd/vaudio.prx",
"flash0:/kd/vaudio_game.prx",
"flash0:/kd/vaudio.prx",
"flash0:/kd/videocodec.prx",
"flash0:/kd/vshbridge.prx",
"flash0:/kd/wlan.prx",
"flash0:/vsh/module/chnnlsv.prx",
"flash0:/vsh/module/common_gui.prx",
"flash0:/vsh/module/common_util.prx",
"flash0:/vsh/module/dialogmain.prx",
"flash0:/vsh/module/heaparea1.prx",
"flash0:/vsh/module/heaparea2.prx",
"flash0:/vsh/module/netconf_plugin.prx",
"flash0:/vsh/module/netplay_client_plugin.prx",
"flash0:/vsh/module/netplay_server_utility.prx",
"flash0:/vsh/module/osk_plugin.prx",
//"flash0:/vsh/module/paf.prx",
"flash0:/vsh/module/pafmini.prx",
"flash0:/vsh/module/savedata_auto_dialog.prx",
"flash0:/vsh/module/savedata_plugin.prx",
"flash0:/vsh/module/savedata_utility.prx",
//"flash0:/vsh/module/vshmain.prx"
"flash0:/vsh/module/auth_plugin.prx",
"flash0:/vsh/module/chnnlsv.prx",
"flash0:/vsh/module/common_gui.prx",
"flash0:/vsh/module/common_util.prx",
"flash0:/vsh/module/dialogmain.prx",
"flash0:/vsh/module/game_plugin.prx",
"flash0:/vsh/module/heaparea1.prx",
"flash0:/vsh/module/heaparea2.prx",
"flash0:/vsh/module/impose_plugin.prx",
"flash0:/vsh/module/msgdialog_plugin.prx",
"flash0:/vsh/module/msvideo_plugin.prx",
"flash0:/vsh/module/music_plugin.prx",
"flash0:/vsh/module/netconf_plugin.prx",
"flash0:/vsh/module/netplay_client_plugin.prx",
"flash0:/vsh/module/netplay_server_utility.prx",
"flash0:/vsh/module/opening_plugin.prx",
"flash0:/vsh/module/osk_plugin.prx",
"flash0:/vsh/module/pafmini.prx",
"flash0:/vsh/module/paf.prx",
"flash0:/vsh/module/photo_plugin.prx",
"flash0:/vsh/module/savedata_auto_dialog.prx",
"flash0:/vsh/module/savedata_plugin.prx",
"flash0:/vsh/module/savedata_utility.prx",
"flash0:/vsh/module/sysconf_plugin.prx",
"flash0:/vsh/module/update_plugin.prx",
"flash0:/vsh/module/video_plugin.prx",
"flash0:/vsh/module/vshmain.prx",
"flash0:/vsh/etc/index.dat",
"flash0:/vsh/etc/jis2ucs.bin",
"flash0:/vsh/etc/jis2ucs.cbin",
"flash0:/vsh/etc/ucs2jis.bin",
"flash0:/vsh/etc/ucs2jis.cbin",
"flash0:/vsh/etc/version.txt",
"flash0:/vsh/resource/01.bmp",
"flash0:/vsh/resource/02.bmp",
"flash0:/vsh/resource/03.bmp",
"flash0:/vsh/resource/04.bmp",
"flash0:/vsh/resource/05.bmp",
"flash0:/vsh/resource/06.bmp",
"flash0:/vsh/resource/07.bmp",
"flash0:/vsh/resource/08.bmp",
"flash0:/vsh/resource/09.bmp",
"flash0:/vsh/resource/10.bmp",
"flash0:/vsh/resource/11.bmp",
"flash0:/vsh/resource/12.bmp",
"flash0:/vsh/resource/auth_plugin.rco",
"flash0:/vsh/resource/gameboot.pmf",
"flash0:/vsh/resource/game_plugin.rco",
"flash0:/vsh/resource/impose_plugin.rco",
"flash0:/vsh/resource/msgdialog_plugin.rco",
"flash0:/vsh/resource/msvideo_plugin.rco",
"flash0:/vsh/resource/music_plugin.rco",
"flash0:/vsh/resource/netconf_dialog.rco",
"flash0:/vsh/resource/netplay_plugin.rco",
"flash0:/vsh/resource/opening_plugin.rco",
"flash0:/vsh/resource/osk_plugin.rco",
"flash0:/vsh/resource/osk_utility.rco",
"flash0:/vsh/resource/photo_plugin.rco",
"flash0:/vsh/resource/savedata_plugin.rco",
"flash0:/vsh/resource/savedata_utility.rco",
"flash0:/vsh/resource/sysconf_plugin.rco",
"flash0:/vsh/resource/system_plugin_bg.rco",
"flash0:/vsh/resource/system_plugin_fg.rco",
"flash0:/vsh/resource/system_plugin.rco",
"flash0:/vsh/resource/topmenu_plugin.rco",
"flash0:/vsh/resource/update_plugin.rco",
"flash0:/vsh/resource/video_plugin.rco",
"flash0:/vsh/resource/video_plugin_videotoolbar.rco",
"flash0:/data/cert/Class1_PCA_G2_v2.cer",
"flash0:/data/cert/Class1_PCA_G3v2.cer",
"flash0:/data/cert/Class1_PCA_ss_v4.cer",
"flash0:/data/cert/Class2_PCA_G2_v2.cer",
"flash0:/data/cert/Class2_PCA_G3v2.cer",
"flash0:/data/cert/Class2_PCA_ss_v4.cer",
"flash0:/data/cert/Class3_PCA_G2_v2.cer",
"flash0:/data/cert/Class3_PCA_G3v2.cer",
"flash0:/data/cert/Class3_PCA_ss_v4.cer",
"flash0:/data/cert/Class4_PCA_G2_v2.cer",
"flash0:/data/cert/Class4_PCA_G3v2.cer",
"flash0:/data/cert/RSA1024_v1.cer",
"flash0:/data/cert/RSA2048_v3.cer",
"flash0:/data/cert/RSA_SecureServer.cer",
"flash0:/data/cert/SCE_CA01.cer",
"flash0:/data/cert/SCE_CA02.cer",
"flash0:/data/cert/SCE_CA03.cer",
"flash0:/data/cert/SCE_CA04.cer",
"flash0:/data/cert/SCE_CA05.cer",
"flash0:/data/cert/VeriSign_TSA_CA.cer",
"flash0:/font/jpn0.pgf",
"flash0:/font/ltn0.pgf",
"flash0:/font/ltn10.pgf",
"flash0:/font/ltn11.pgf",
"flash0:/font/ltn12.pgf",
"flash0:/font/ltn13.pgf",
"flash0:/font/ltn14.pgf",
"flash0:/font/ltn15.pgf",
"flash0:/font/ltn1.pgf",
"flash0:/font/ltn2.pgf",
"flash0:/font/ltn3.pgf",
"flash0:/font/ltn4.pgf",
"flash0:/font/ltn5.pgf",
"flash0:/font/ltn6.pgf",
"flash0:/font/ltn7.pgf",
"flash0:/font/ltn8.pgf",
"flash0:/font/ltn9.pgf",
"flash0:/dic/apotp.dic",
"flash0:/dic/atokp.dic",
"flash0:/dic/aux0.dic",
"flash0:/dic/aux1.dic",
"flash0:/dic/aux2.dic",
"flash0:/dic/aux3.dic"
};

static int N_150 = sizeof(subset150)/sizeof(subset150[0]);

void ErrorExit(int milisecs, char *fmt, ...)
{
va_list list;
Expand Down Expand Up @@ -607,11 +707,17 @@ static void CreateDirs()
sceIoMkdir("ms0:/TM", 0777);
sceIoMkdir(ARK_DC_PATH, 0777);
sceIoMkdir(ARK_DC_PATH "/150", 0777);
sceIoMkdir(ARK_DC_PATH "/150/data", 0777);
sceIoMkdir(ARK_DC_PATH "/150/data/cert", 0777);
sceIoMkdir(ARK_DC_PATH "/150/dic", 0777);
sceIoMkdir(ARK_DC_PATH "/150/font", 0777);
sceIoMkdir(ARK_DC_PATH "/150/kd", 0777);
sceIoMkdir(ARK_DC_PATH "/150/kd/resource", 0777);
sceIoMkdir(ARK_DC_PATH "/150/registry", 0777);
sceIoMkdir(ARK_DC_PATH "/150/vsh", 0777);
sceIoMkdir(ARK_DC_PATH "/150/vsh/module", 0777);
sceIoMkdir(ARK_DC_PATH "/150/vsh/etc", 0777);
sceIoMkdir(ARK_DC_PATH "/150/vsh/resource", 0777);
printf("OK\n");
}

Expand Down Expand Up @@ -722,7 +828,7 @@ int main(void)
printf("OK\n");
}

CopyRegistry();
//CopyRegistry();

ErrorExit(7000, "\n\nDone.\nAuto-exiting in 7 seconds.\n");

Expand Down
3 changes: 2 additions & 1 deletion extras/150kernel/reboot150/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int LoadReboot(void * arg1, unsigned int arg2, void * arg3, unsigned int arg4)

int module_start(SceSize args, void *argp)
{
int dreg = sceIoOpen("ms0:/TM/DCARK/150/registry/system.dreg", PSP_O_RDONLY, 0);
/*int dreg = sceIoOpen("ms0:/TM/DCARK/150/registry/system.dreg", PSP_O_RDONLY, 0);
int ireg = sceIoOpen("ms0:/TM/DCARK/150/registry/system.ireg", PSP_O_RDONLY, 0);
if(dreg < 0 || ireg < 0) {
dreg = sceIoOpen("ms0:/TM/DCARK/150/registry/system.dreg", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777);
Expand All @@ -64,6 +64,7 @@ int module_start(SceSize args, void *argp)
sceIoClose(ireg);
*/
sctrlHENSetLoadRebootOverrideHandler(LoadReboot);

return 0;
Expand Down
1 change: 1 addition & 0 deletions extras/150kernel/systemctrl150/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ int module_start(SceSize args, void * argp)
// Flush Cache
flushCache();


// Return Success
return 0;
}
Expand Down
14 changes: 8 additions & 6 deletions extras/150kernel/systemctrl150/src/loadexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ extern int (* OrigLoadExecAction)(int apitype, void *a1, void *a2, void *a3, voi
void patchLoadExec() {

SceModule2 *mod = sceKernelFindModuleByName("sceLoadExec");

if (mod != NULL) {
OrigLoadExecAction = (void *)(mod->text_addr + 0x2138);
MAKE_CALL(mod->text_addr + 0x2090, LoadExecActionPatched);
MAKE_CALL(mod->text_addr + 0x2344, sceKernelGzipDecompressPatched);
MAKE_CALL(mod->text_addr + 0x232C, sceKernelMemsetPatched);

OrigLoadExecAction = (void *)(mod->text_addr + 0x2138);
MAKE_CALL(mod->text_addr + 0x2090, LoadExecActionPatched);
MAKE_CALL(mod->text_addr + 0x2344, sceKernelGzipDecompressPatched);
MAKE_CALL(mod->text_addr + 0x232C, sceKernelMemsetPatched);

_sw(0x3C0188FC, mod->text_addr + 0x2384);
_sw(0x3C0188FC, mod->text_addr + 0x2384);
}
}
4 changes: 2 additions & 2 deletions extras/150kernel/systemctrl150/src/rebootex.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int LoadExecActionPatched(int apitype, void *a1, void *a2, void *a3, void *t0)
{
if ((apitype & 0x200) == 0x200) /* vsh */
{
reboot66x = 1;
reboot66x = 0;
}

return OrigLoadExecAction(apitype, a1, a2, a3, t0);
Expand Down Expand Up @@ -118,4 +118,4 @@ int sceKernelGzipDecompressPatched(u8 *dest, u32 destSize, const u8 *src, void *
memcpy(REBOOTEX_TEXT, rebootex150, size_rebootex150);

return sceKernelGzipDecompress(dest, destSize, src, unknown);
}
}
7 changes: 6 additions & 1 deletion extras/150kernel/systemctrl150/src/syspatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ static void ARKSyspatchOnModuleStart(SceModule2 * mod)

flushCache();
}
else if (strcmp(moduleName, "sceLoadExec") == 0)
{
patchLoadExec();
flushCache();
}
}

// Add Module Start Patcher
Expand All @@ -160,4 +165,4 @@ int SysEventHandler(int eventId, char *eventName, void *param, int *result)
}

return 0;
}
}
Loading

0 comments on commit 7016bad

Please sign in to comment.