Upload src code.
This commit is contained in:
parent
1e1aa42514
commit
3db707a7e7
|
@ -0,0 +1,47 @@
|
|||
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(DolcePolce)
|
||||
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(DolcePolce
|
||||
DolcePolce.c
|
||||
)
|
||||
|
||||
target_link_libraries(DolcePolce
|
||||
taihen_stub
|
||||
SceLibKernel_stub
|
||||
SceAppMgr_stub
|
||||
SceLibc_stub
|
||||
SceVshBridge_stub
|
||||
SceIofilemgr_stub
|
||||
)
|
||||
|
||||
set_target_properties(DolcePolce
|
||||
PROPERTIES LINK_FLAGS "-nostdlib"
|
||||
)
|
||||
|
||||
vita_create_self(DolcePolce.suprx DolcePolce
|
||||
CONFIG ${CMAKE_SOURCE_DIR}/DolcePolce.yml
|
||||
)
|
|
@ -0,0 +1,111 @@
|
|||
|
||||
#include <psp2/kernel/modulemgr.h>
|
||||
#include <taihen.h>
|
||||
#include <string.h>
|
||||
#include <vitasdk.h>
|
||||
|
||||
static SceUID check_psm_allowed_hook = -1;
|
||||
static tai_hook_ref_t check_psm_allowed_hook_ref;
|
||||
|
||||
static SceUID check_vita_allowed_hook = -1;
|
||||
static tai_hook_ref_t check_vita_allowed_hook_ref;
|
||||
|
||||
static SceUID check_pspemu_allowed_hook = -1;
|
||||
static tai_hook_ref_t check_pspemu_allowed_hook_ref;
|
||||
|
||||
|
||||
static int check_psm_allowed(char **game, int *is_allowed, int *unk) {
|
||||
int ret = TAI_CONTINUE(int, check_psm_allowed_hook_ref,game, is_allowed, unk);
|
||||
sceClibPrintf("[DolcePolce] check_psm_allowed(%s,%x,%x); ret = %x!\n",*game, *is_allowed, *unk, ret);
|
||||
|
||||
if(*is_allowed <= 0)
|
||||
{
|
||||
sceClibPrintf("[DolcePolce] check_psm_allowed: %s is blacklisted... launching anyway!\n",*game);
|
||||
*is_allowed = 1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int check_vita_allowed(char **game, int *is_allowed, int *unk) {
|
||||
int ret = TAI_CONTINUE(int, check_vita_allowed_hook_ref, game, is_allowed, unk);
|
||||
sceClibPrintf("[DolcePolce] check_vita_allowed(%s,%x,%x); ret = %x!\n",*game, *is_allowed, *unk, ret);
|
||||
|
||||
if(*is_allowed <= 0)
|
||||
{
|
||||
sceClibPrintf("[DolcePolce] check_vita_allowed: %s is blacklisted... launching anyway!\n",*game);
|
||||
*is_allowed = 1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int check_pspemu_allowed(char **game, int *is_allowed, int *unk) {
|
||||
int ret = TAI_CONTINUE(int, check_pspemu_allowed_hook_ref, game, is_allowed, unk);
|
||||
sceClibPrintf("[DolcePolce] check_pspemu_allowed(%s,%x,%x); ret = %x!\n",*game, *is_allowed, *unk, ret);
|
||||
|
||||
if(*is_allowed <= 0)
|
||||
{
|
||||
sceClibPrintf("[DolcePolce] check_pspemu_allowed %s is blacklisted... launching anyway!\n",*game);
|
||||
*is_allowed = 1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void _start() __attribute__ ((weak, alias ("module_start")));
|
||||
int module_start(SceSize argc, const void *args) {
|
||||
|
||||
/*
|
||||
* Read Fw Version
|
||||
*/
|
||||
|
||||
SceKernelFwInfo fwInfo;
|
||||
fwInfo.size = sizeof(SceKernelFwInfo);
|
||||
_vshSblGetSystemSwVersion(&fwInfo);
|
||||
int fw = fwInfo.version;
|
||||
|
||||
sceClibPrintf("[DolcePolce] Loaded! running on FW: %x\n",fw);
|
||||
|
||||
/*
|
||||
* Get SceShell Info
|
||||
*/
|
||||
tai_module_info_t tai_info;
|
||||
tai_info.size = sizeof(tai_module_info_t);
|
||||
taiGetModuleInfo("SceShell", &tai_info);
|
||||
|
||||
if(fw >= 0x3650000)
|
||||
{
|
||||
check_psm_allowed_hook = taiHookFunctionOffset(&check_psm_allowed_hook_ref, tai_info.modid,0,0x2E928,1, check_psm_allowed);
|
||||
check_vita_allowed_hook = taiHookFunctionOffset(&check_vita_allowed_hook_ref, tai_info.modid,0,0x2E480,1, check_vita_allowed);
|
||||
check_pspemu_allowed_hook = taiHookFunctionOffset(&check_pspemu_allowed_hook_ref, tai_info.modid,0,0x2E78C,1, check_pspemu_allowed);
|
||||
}
|
||||
else
|
||||
{
|
||||
check_psm_allowed_hook = taiHookFunctionOffset(&check_psm_allowed_hook_ref, tai_info.modid,0,0x2E8D0,1, check_psm_allowed);
|
||||
check_vita_allowed_hook = taiHookFunctionOffset(&check_vita_allowed_hook_ref, tai_info.modid,0,0x2E428,1, check_vita_allowed);
|
||||
check_pspemu_allowed_hook = taiHookFunctionOffset(&check_pspemu_allowed_hook_ref, tai_info.modid,0,0x2E734,1, check_pspemu_allowed);
|
||||
}
|
||||
|
||||
|
||||
sceClibPrintf("[DolcePolce] check_psm_allowed: %x %x\n",check_psm_allowed_hook,check_psm_allowed_hook_ref);
|
||||
sceClibPrintf("[DolcePolce] check_vita_allowed: %x %x\n",check_vita_allowed_hook,check_vita_allowed_hook_ref);
|
||||
sceClibPrintf("[DolcePolce] check_pspemu_allowed: %x %x\n",check_pspemu_allowed_hook,check_pspemu_allowed_hook_ref);
|
||||
|
||||
return SCE_KERNEL_START_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
int module_stop(SceSize argc, const void *args) {
|
||||
|
||||
// release hooks
|
||||
if (check_psm_allowed_hook >= 0) taiHookRelease(check_psm_allowed_hook, check_psm_allowed_hook_ref);
|
||||
if (check_vita_allowed_hook >= 0) taiHookRelease(check_vita_allowed_hook, check_vita_allowed_hook_ref);
|
||||
if (check_pspemu_allowed_hook >= 0) taiHookRelease(check_pspemu_allowed_hook, check_pspemu_allowed_hook_ref);
|
||||
|
||||
|
||||
return SCE_KERNEL_STOP_SUCCESS;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
MakePsmGreatAgain:
|
||||
attributes: 0
|
||||
version:
|
||||
major: 1
|
||||
minor: 1
|
||||
main:
|
||||
start: module_start
|
||||
stop: module_stop
|
Loading…
Reference in New Issue