Skip to content

Commit

Permalink
Add src code
Browse files Browse the repository at this point in the history
  • Loading branch information
Princess-of-Sleeping committed Dec 31, 2021
1 parent 58877d2 commit f2926d8
Show file tree
Hide file tree
Showing 10 changed files with 802 additions and 1 deletion.
57 changes: 57 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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(CmepMgr)
set(SELF_NAME "cmep_mgr")
include("${VITASDK}/share/vita.cmake" REQUIRED)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-q -Wall -O2 -fno-inline")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions")

enable_language(C ASM)

add_executable(${PROJECT_NAME}
src/main.c
src/cmep_mgr.c
)

target_link_libraries(${PROJECT_NAME}
SceCpuForDriver_stub
SceDebugForDriver_stub
SceIofilemgrForDriver_stub
SceSysmemForDriver_stub
SceSysclibForDriver_stub
SceSysrootForKernel_stub
SceSblACMgrForDriver_stub
SceSblSmCommForKernel_stub
SceThreadmgrForDriver_stub
)

set_target_properties(${PROJECT_NAME}
PROPERTIES LINK_FLAGS "-nostdlib"
COMPILE_FLAGS "-D__PSP2_KERNEL__"
)

vita_create_self(${SELF_NAME}.skprx ${PROJECT_NAME}
CONFIG exports.yml
UNSAFE
STRIPPED
REL_OPTIMIZE
)

vita_create_stubs(stubs ${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/exports.yml KERNEL)

install(FILES build/stubs/libCmepMgrForKernel_stub.a
DESTINATION lib
)

install(FILES src/cmep_mgr.h
DESTINATION include
)
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
# CmepMgr

# CmepMgr

A framework for easily executing cmep code.

# Installation

Add to you're KERNEL section on config.txt

# Caution

Currently the framework only works with __**3.60**__.

# Credits

Yifan Lu for update_service_sm exploit.

Everybody who contributed on vitasdk.
9 changes: 9 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

if [ ! -d build ]; then
mkdir build
fi

cd build
cmake ../
make install
cd ..
18 changes: 18 additions & 0 deletions exports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CmepMgr:
attributes: 7
version:
major: 1
minor: 1
main:
start: module_start
modules:
CmepMgrForKernel:
version: 1
syscall: false
functions:
- cmepMgrStart
- cmepMgrStartByPath
- cmepMgrStop
- cmepMgrCallFunc
- cmepMgrDcacheCleanRange
- cmepMgrDcacheInvalidateRange
Loading

0 comments on commit f2926d8

Please sign in to comment.