Upload SRC
This commit is contained in:
parent
239a593109
commit
0b9b360519
|
@ -0,0 +1,48 @@
|
|||
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(FreePSM)
|
||||
include("${VITASDK}/share/vita.cmake" REQUIRED)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-q -Wall -O3 -std=gnu99")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-rtti -fno-exceptions")
|
||||
|
||||
include_directories(
|
||||
)
|
||||
|
||||
link_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
if (NOT ${RELEASE})
|
||||
add_definitions(-DENABLE_LOGGING)
|
||||
endif()
|
||||
|
||||
add_executable(FreePSM
|
||||
FreePSM.c
|
||||
)
|
||||
|
||||
target_link_libraries(FreePSM
|
||||
taihen_stub
|
||||
SceLibKernel_stub
|
||||
SceIofilemgr_stub
|
||||
SceAppMgr_stub
|
||||
SceLibc_stub
|
||||
SceKernelModulemgr_stub
|
||||
SceProcessmgr_stub
|
||||
)
|
||||
|
||||
set_target_properties(FreePSM
|
||||
PROPERTIES LINK_FLAGS "-nostdlib"
|
||||
)
|
||||
|
||||
vita_create_self(FreePSM.suprx FreePSM
|
||||
CONFIG ${CMAKE_SOURCE_DIR}/FreePSM.yml
|
||||
)
|
|
@ -0,0 +1,73 @@
|
|||
#include <taihen.h>
|
||||
#include <vitasdk.h>
|
||||
#include <string.h>
|
||||
|
||||
static SceUID LoadModuleHook = -1;
|
||||
static tai_hook_ref_t LoadModuleHook_ref;
|
||||
|
||||
static SceUID SceLibPsmAimMgrIsDexHook = -1;
|
||||
static tai_hook_ref_t SceLibPsmAimMgrIsDexHook_ref;
|
||||
|
||||
char titleid[12];
|
||||
|
||||
|
||||
|
||||
int SceLibPsmAimMgrIsDex_p()
|
||||
{
|
||||
int ret = TAI_CONTINUE(int, SceLibPsmAimMgrIsDexHook_ref,);
|
||||
|
||||
if(ret > -1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
sceClibPrintf("[FreePSM] ERROR: SceLibPsmAimMgrIsDex returned %x",ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
SceUID sceKernelLoadStartModule_p(char *path, SceSize args, void *argp, int flags, SceKernelLMOption *option, int *status)
|
||||
{
|
||||
sceClibPrintf("[FreePSM] Starting Module: %s\n",path);
|
||||
|
||||
SceUID ret;
|
||||
ret = TAI_CONTINUE(SceUID, LoadModuleHook_ref, path, args, argp, flags, option, status);
|
||||
|
||||
if(strstr(path,"libpsm.suprx"))
|
||||
{
|
||||
SceLibPsmAimMgrIsDexHook = taiHookFunctionOffset(&SceLibPsmAimMgrIsDexHook_ref,
|
||||
ret,
|
||||
0,
|
||||
0x450da, //2.01 Retail Runtime
|
||||
1,
|
||||
SceLibPsmAimMgrIsDex_p);
|
||||
sceClibPrintf("[FreePSM] SceLibPsmAimMgrIsDexHook %x %x\n",SceLibPsmAimMgrIsDexHook,SceLibPsmAimMgrIsDexHook_ref);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void _start() __attribute__ ((weak, alias ("module_start")));
|
||||
|
||||
void module_start(SceSize argc, const void *args) {
|
||||
sceAppMgrAppParamGetString(0, 12, titleid, 256);
|
||||
|
||||
if(!strcmp(titleid,"PCSI00011")) // PSM Runtime
|
||||
{
|
||||
sceClibPrintf("[FreePSM] Silca: I like to see girls die :3\n");
|
||||
sceClibPrintf("[FreePSM] Loaded!\n");
|
||||
sceClibPrintf("[FreePSM] Running on %s\n",titleid);
|
||||
|
||||
LoadModuleHook = taiHookFunctionImport(&LoadModuleHook_ref,
|
||||
TAI_MAIN_MODULE,
|
||||
TAI_ANY_LIBRARY,
|
||||
0x2DCC4AFA, //sceKernelLoadStartModule
|
||||
sceKernelLoadStartModule_p);
|
||||
|
||||
sceClibPrintf("[FreePSM] LoadModuleHook %x, %x\n",LoadModuleHook,LoadModuleHook_ref);
|
||||
}
|
||||
}
|
||||
|
||||
int module_stop(SceSize argc, const void *args) {
|
||||
|
||||
// release hooks
|
||||
return SCE_KERNEL_STOP_SUCCESS;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
FreePSM:
|
||||
attributes: 0
|
||||
version:
|
||||
major: 1
|
||||
minor: 1
|
||||
main:
|
||||
start: module_start
|
||||
stop: module_stop
|
Loading…
Reference in New Issue