commit fd842c1ecbd9f446ff493a3423880e1b88e5b858 Author: Li Date: Mon Jan 15 00:28:33 2024 +1300 upload src diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ada173 --- /dev/null +++ b/.gitignore @@ -0,0 +1,55 @@ +# ---> C +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf + +build/* \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..37d4ef4 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,34 @@ +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(PythonWhiteFin) +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(PythonWhiteFin + packetlog.c +) + +target_link_libraries(PythonWhiteFin + taihenForKernel_stub + SceIofilemgrForDriver_stub + SceSdifForDriver_stub + SceNpDrmForDriver_stub + SceRtcForDriver_stub + SceRegMgrForDriver_stub + SceSblSsMgrForDriver_stub + SceSysclibForDriver_stub + SceDebugForDriver_stub + SceThreadmgrForDriver_stub +) + +vita_create_self(PythonWhiteFin.skprx PythonWhiteFin CONFIG exports.yml UNSAFE) \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d00cac7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2024 Li + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..324f03c --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# PythonWhiteFin + +revert cobra blackfin patches added in 3.60 \ No newline at end of file diff --git a/exports.yml b/exports.yml new file mode 100644 index 0000000..016037c --- /dev/null +++ b/exports.yml @@ -0,0 +1,8 @@ +packetlog: + attributes: 0 + version: + major: 1 + minor: 1 + main: + start: module_start + stop: module_stop diff --git a/packetlog.c b/packetlog.c new file mode 100644 index 0000000..91ad287 --- /dev/null +++ b/packetlog.c @@ -0,0 +1,34 @@ +#include +#include +#include +#include + +static int kernelGetSysTime = -1; +static tai_hook_ref_t kernelGetSysTimeRef; + +uint64_t sceKernelGetSystemTimeWide_Patched(){ + return 0; +} + +void _start() __attribute__ ((weak, alias ("module_start"))); +int module_start(SceSize argc, const void *args) +{ + + // undo cobra blackfin patch + kernelGetSysTime = taiHookFunctionImportForKernel(KERNEL_PID, + &kernelGetSysTimeRef, + "SceSblGcAuthMgr", + 0xE2C40624, // SceThreadmgrForDriver + 0xF4EE4FA9, // sceKernelGetSystemTimeWide + sceKernelGetSystemTimeWide_Patched); + ksceKernelPrintf("[started] %x %x\n", kernelGetSysTime, kernelGetSysTimeRef); + + return SCE_KERNEL_START_SUCCESS; +} + +int module_stop(SceSize argc, const void *args) +{ + if (kernelGetSysTime >= 0) taiHookReleaseForKernel(kernelGetSysTime, kernelGetSysTimeRef); + + return SCE_KERNEL_STOP_SUCCESS; +}