Skip to content

Commit

Permalink
v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SKGleba authored Nov 4, 2018
1 parent 8c885b2 commit 61b9811
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 16 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ all: $(TARGET).vpk
vita-pack-vpk -s param.sfo -b eboot.bin \
-a sce_sys/livearea/contents/bg.png=sce_sys/livearea/contents/bg.png \
-a sce_sys/livearea/contents/template.xml=sce_sys/livearea/contents/template.xml \
-a plugin/itls.suprx=Media/69 \
-a pkg/Media/01=Media/01 \
-a pkg/Media/00=Media/00 \$@

Expand Down
29 changes: 13 additions & 16 deletions main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
iTLS-Enso v1.75 by SKGleba
iTLS-Enso v2.0 by SKGleba
All Rights Reserved
*/

Expand All @@ -13,11 +13,9 @@
#include <psp2/io/stat.h>
#include "graphics.h"

//char mmit[][200] = {" -> Install 3.68 compat module"," -> Uninstall 3.68 compat module"," -> Install 3.69 root certs"," -> Install/Uninstall the iTLS plugin"," -> Exit"};
char mmit[][150] = {" -> Install 3.68 compat module"," -> Uninstall 3.68 compat module"," -> Install 3.69 root certs"," -> Exit"};
char mmit[][200] = {" -> Install 3.68 compat module"," -> Uninstall 3.68 compat module"," -> Install 3.69 root certs"," -> Install/Uninstall the iTLS plugin"," -> Exit"};

//int optct = 5;
int optct = 4;
int optct = 5;

int sel = 0;
int i;
Expand Down Expand Up @@ -59,7 +57,7 @@ int fcp(const char *from, const char *to, int rem) {
void smenu(){
psvDebugScreenClear(COLOR_BLACK);
psvDebugScreenSetFgColor(COLOR_CYAN);
psvDebugScreenPrintf(" iTLS-Enso 1.76 \n");
psvDebugScreenPrintf(" iTLS-Enso 2.0 \n");
psvDebugScreenPrintf(" By SKGleba \n");
psvDebugScreenSetFgColor(COLOR_RED);
for(i = 0; i < optct; i++){
Expand All @@ -74,8 +72,7 @@ void smenu(){
}

int do_shit(){
//if (sel == 4) sceKernelExitProcess(0);
if (sel == 3) sceKernelExitProcess(0);
if (sel == 4) sceKernelExitProcess(0);
void *buf = malloc(0x100);
vshIoUmount(0x300, 0, 0, 0);
vshIoUmount(0x300, 1, 0, 0);
Expand All @@ -85,19 +82,19 @@ if (ex("vs0:/data/external/webcore/cpt.o") == 0) fcp("vs0:/data/external/webcore
if (sel == 0) fcp("app0:Media/00", "vs0:/data/external/webcore/ScePsp2Compat.suprx", 1);
if (sel == 1) fcp("vs0:/data/external/webcore/cpt.o", "vs0:/data/external/webcore/ScePsp2Compat.suprx", 1);
if (sel == 2) fcp("app0:Media/01", "vs0:/data/external/cert/CA_LIST.cer", 1);
/*
if (sel == 3) {
int pex = ex("ur0:tai/itls.suprx");
int mex = ex("ur0:tai/itls_compat.suprx");
sceIoMkdir("ur0:itls/", 0777);
int pex = ex("ur0:itls/itls.suprx");
int mex = ex("ur0:itls/compat.suprx");
if (mex == 1 && pex == 1) {
sceIoRemove("ur0:tai/itls.suprx");
sceIoRemove("ur0:tai/itls_compat.suprx");
sceIoRemove("ur0:itls/itls.suprx");
sceIoRemove("ur0:itls/compat.suprx");
} else {
fcp("app0:Media/69", "ur0:tai/itls.suprx", 1);
fcp("app0:Media/00", "ur0:tai/itls_compat.suprx", 1);
fcp("app0:Media/69", "ur0:itls/itls.suprx", 1);
fcp("app0:Media/00", "ur0:itls/compat.suprx", 1);
}
}
*/

psvDebugScreenPrintf("Done\n");
sceKernelDelayThread(1 * 1000 * 1000);sceKernelExitProcess(0);}
int main()
Expand Down
33 changes: 33 additions & 0 deletions plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
cmake_minimum_required(VERSION 2.8)

if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
if(DEFINED ENV{VITASDK})
set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
else()
message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
endif()
endif()

project(itls)
include("${VITASDK}/share/vita.cmake" REQUIRED)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-q -Wall -O3 -nostdlib")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions")

add_executable(itls
src/main.c
)

target_link_libraries(itls

k
gcc
taihen_stub
SceLibKernel_stub

)

vita_create_self(itls.suprx itls
CONFIG ${CMAKE_SOURCE_DIR}/exports.yml
UNSAFE
)
8 changes: 8 additions & 0 deletions plugin/exports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
itls:
attributes: 0
version:
major: 1
minor: 0
main:
start: module_start
stop: module_stop
30 changes: 30 additions & 0 deletions plugin/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
iTLS-Enso v2.0 by SKGleba
All Rights Reserved
*/
// Requires ioplus v0.1 or higher
#include <psp2/kernel/modulemgr.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <taihen.h>

static int hk;
static tai_hook_ref_t lum_hook;
static SceUID lum_patch(char *path, SceSize args, void *argp, int flags, SceKernelLMOption *option, int *status) {
int pathlen = strlen(path);
if (path[pathlen - 14] == 0x70 && path[pathlen - 13] == 0x32 && path[pathlen - 12] == 0x43) path = "ur0:itls/compat.suprx";
SceUID ret = TAI_CONTINUE(SceUID, lum_hook, path, args, argp, flags, option, status);
return ret;
}

void _start() __attribute__ ((weak, alias("module_start")));
int module_start(SceSize args, void *argp) {
hk = taiHookFunctionImport(&lum_hook, TAI_MAIN_MODULE, TAI_ANY_LIBRARY, 0x2DCC4AFA, lum_patch);
return 0;
}

int module_stop(SceSize args, void *argp) {
if(hk >= 0)taiHookRelease(hk, lum_hook);
return SCE_KERNEL_STOP_SUCCESS;
}

0 comments on commit 61b9811

Please sign in to comment.