Skip to content

Commit

Permalink
Added NoLockScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOfficialFloW committed Jul 26, 2018
0 parents commit a3ded5f
Show file tree
Hide file tree
Showing 6 changed files with 773 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions NoLockScreen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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(nolockscreen)
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(nolockscreen
main.c
)

target_link_libraries(nolockscreen
taiHEN_stub
)

vita_create_self(nolockscreen.suprx nolockscreen CONFIG exports.yml UNSAFE)
8 changes: 8 additions & 0 deletions NoLockScreen/exports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
NoLockScreen:
attributes: 0
version:
major: 1
minor: 0
main:
start: module_start
stop: module_stop
52 changes: 52 additions & 0 deletions NoLockScreen/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
VitaTweaks: NoLockScreen
Copyright (C) 2018, TheFloW
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <psp2/kernel/modulemgr.h>
#include <taihen.h>

static SceUID hookid = -1;

void _start() __attribute__ ((weak, alias("module_start")));
int module_start(SceSize args, void *argp) {
tai_module_info_t info;
info.size = sizeof(info);
if (taiGetModuleInfo("SceShell", &info) >= 0) {
uint32_t movs_a1_1_nop_opcode = 0xBF002001;

switch (info.module_nid) {
case 0x0552F692: // 3.60 retail
hookid = taiInjectData(info.modid, 0, 0x2361D2, &movs_a1_1_nop_opcode, sizeof(movs_a1_1_nop_opcode));
break;

case 0x5549BF1F: // 3.65 retail
case 0x34B4D82E: // 3.67 retail
case 0x12DAC0F3: // 3.68 retail
hookid = taiInjectData(info.modid, 0, 0x23626E, &movs_a1_1_nop_opcode, sizeof(movs_a1_1_nop_opcode));
break;
}
}

return SCE_KERNEL_START_SUCCESS;
}

int module_stop(SceSize args, void *argp) {
if (hookid >= 0)
taiInjectRelease(hookid);

return SCE_KERNEL_STOP_SUCCESS;
}
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# VitaTweaks

A collection of small tweaks for the PS Vita

## 1. NoLockScreen

Enable it in `*main`

```
*main
ux0:tai/nolockscreen.suprx
```

0 comments on commit a3ded5f

Please sign in to comment.