diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..80e6dda --- /dev/null +++ b/src/Makefile @@ -0,0 +1,304 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.17 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Disable VCS-based implicit rules. +% : %,v + + +# Disable VCS-based implicit rules. +% : RCS/% + + +# Disable VCS-based implicit rules. +% : RCS/%,v + + +# Disable VCS-based implicit rules. +% : SCCS/s.% + + +# Disable VCS-based implicit rules. +% : s.% + + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake.exe + +# The command to remove a file. +RM = /usr/bin/cmake.exe -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/User/vita/PocketstationUnlocker/src + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/User/vita/PocketstationUnlocker/src + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake.exe -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake.exe -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip/fast + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake.exe -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake.exe -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake.exe -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake.exe -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components + +.PHONY : list_install_components/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/bin/ccmake.exe -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake.exe --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/User/vita/PocketstationUnlocker/src/CMakeFiles /home/User/vita/PocketstationUnlocker/src/CMakeFiles/progress.marks + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /home/User/vita/PocketstationUnlocker/src/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named pocketstationunlocker.skprx + +# Build rule for target. +pocketstationunlocker.skprx: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 pocketstationunlocker.skprx +.PHONY : pocketstationunlocker.skprx + +# fast build rule for target. +pocketstationunlocker.skprx/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/pocketstationunlocker.skprx.dir/build.make CMakeFiles/pocketstationunlocker.skprx.dir/build +.PHONY : pocketstationunlocker.skprx/fast + +#============================================================================= +# Target rules for targets named pocketstationunlocker + +# Build rule for target. +pocketstationunlocker: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 pocketstationunlocker +.PHONY : pocketstationunlocker + +# fast build rule for target. +pocketstationunlocker/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/pocketstationunlocker.dir/build.make CMakeFiles/pocketstationunlocker.dir/build +.PHONY : pocketstationunlocker/fast + +#============================================================================= +# Target rules for targets named pocketstationunlocker-stubs + +# Build rule for target. +pocketstationunlocker-stubs: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 pocketstationunlocker-stubs +.PHONY : pocketstationunlocker-stubs + +# fast build rule for target. +pocketstationunlocker-stubs/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/pocketstationunlocker-stubs.dir/build.make CMakeFiles/pocketstationunlocker-stubs.dir/build +.PHONY : pocketstationunlocker-stubs/fast + +#============================================================================= +# Target rules for targets named libPocketStationUnlcoker_stub_weak.a + +# Build rule for target. +libPocketStationUnlcoker_stub_weak.a: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 libPocketStationUnlcoker_stub_weak.a +.PHONY : libPocketStationUnlcoker_stub_weak.a + +# fast build rule for target. +libPocketStationUnlcoker_stub_weak.a/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/libPocketStationUnlcoker_stub_weak.a.dir/build.make CMakeFiles/libPocketStationUnlcoker_stub_weak.a.dir/build +.PHONY : libPocketStationUnlcoker_stub_weak.a/fast + +#============================================================================= +# Target rules for targets named libPocketStationUnlcoker_stub.a + +# Build rule for target. +libPocketStationUnlcoker_stub.a: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 libPocketStationUnlcoker_stub.a +.PHONY : libPocketStationUnlcoker_stub.a + +# fast build rule for target. +libPocketStationUnlcoker_stub.a/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/libPocketStationUnlcoker_stub.a.dir/build.make CMakeFiles/libPocketStationUnlcoker_stub.a.dir/build +.PHONY : libPocketStationUnlcoker_stub.a/fast + +pocketstationunlocker.obj: pocketstationunlocker.c.obj + +.PHONY : pocketstationunlocker.obj + +# target to build an object file +pocketstationunlocker.c.obj: + $(MAKE) $(MAKESILENT) -f CMakeFiles/pocketstationunlocker.dir/build.make CMakeFiles/pocketstationunlocker.dir/pocketstationunlocker.c.obj +.PHONY : pocketstationunlocker.c.obj + +pocketstationunlocker.i: pocketstationunlocker.c.i + +.PHONY : pocketstationunlocker.i + +# target to preprocess a source file +pocketstationunlocker.c.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/pocketstationunlocker.dir/build.make CMakeFiles/pocketstationunlocker.dir/pocketstationunlocker.c.i +.PHONY : pocketstationunlocker.c.i + +pocketstationunlocker.s: pocketstationunlocker.c.s + +.PHONY : pocketstationunlocker.s + +# target to generate assembly for a file +pocketstationunlocker.c.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/pocketstationunlocker.dir/build.make CMakeFiles/pocketstationunlocker.dir/pocketstationunlocker.c.s +.PHONY : pocketstationunlocker.c.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... install" + @echo "... install/local" + @echo "... install/strip" + @echo "... list_install_components" + @echo "... rebuild_cache" + @echo "... libPocketStationUnlcoker_stub.a" + @echo "... libPocketStationUnlcoker_stub_weak.a" + @echo "... pocketstationunlocker-stubs" + @echo "... pocketstationunlocker.skprx" + @echo "... pocketstationunlocker" + @echo "... pocketstationunlocker.obj" + @echo "... pocketstationunlocker.i" + @echo "... pocketstationunlocker.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/src/pocketstationunlocker.c b/src/pocketstationunlocker.c index 2dc6a00..af13031 100644 --- a/src/pocketstationunlocker.c +++ b/src/pocketstationunlocker.c @@ -1,13 +1,17 @@ // PocketStationUnlocker -// Created by SilicaAndPina (she/they) +// Created by Li (they/them) #include #include #include #include -static int ispstitle = -1; -static tai_hook_ref_t ref_ispstitle; +static int is_pocketstation_license_valid_hook = -1; +static int ref_is_pocketstation_license_valid_hook = -1; + +static int is_pocketstation_title_hook = -1; +static tai_hook_ref_t ref_is_pocketstation_title_hook; + static int return_1() { return 1; @@ -16,18 +20,27 @@ static int return_1() { void _start() __attribute__ ((weak, alias ("module_start"))); int module_start(SceSize argc, const void *args) { - ispstitle = taiHookFunctionExportForKernel(KERNEL_PID, - &ref_ispstitle, + is_pocketstation_title_hook = taiHookFunctionExportForKernel(KERNEL_PID, + &ref_is_pocketstation_title_hook, "SceCompat", - TAI_ANY_LIBRARY, - 0x7DCFBCCE, + 0x0F35909D, // SceCompat + 0x7DCFBCCE, // sceCompatIsPocketStationTitle return_1); + + is_pocketstation_license_valid_hook = taiHookFunctionExportForKernel(KERNEL_PID, + &ref_is_pocketstation_license_valid_hook, + "SceCompat", + 0x0F35909D, // SceCompat + 0x96FC2A87, //sceCompatCheckPocketStation + return_1); + return SCE_KERNEL_START_SUCCESS; } int module_stop(SceSize argc, const void *args) { - if (ispstitle >= 0) taiHookReleaseForKernel(ispstitle, ref_ispstitle); - + if (is_pocketstation_title_hook >= 0) taiHookReleaseForKernel(is_pocketstation_title_hook, ref_is_pocketstation_title_hook); + if (is_pocketstation_license_valid_hook >= 0) taiHookReleaseForKernel(is_pocketstation_license_valid_hook, ref_is_pocketstation_license_valid_hook); + return SCE_KERNEL_STOP_SUCCESS; }