Add files via upload

This commit is contained in:
Silica 2018-03-19 15:49:56 +13:00 committed by GitHub
parent a9c2b18ab0
commit 2569ce119e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 132 additions and 0 deletions

51
CMakeLists.txt Normal file
View File

@ -0,0 +1,51 @@
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(cidSpoof)
include("$ENV{VITASDK}/share/vita.cmake" REQUIRED)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-q -Wall -O3 -std=gnu99")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -nostdlib")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-rtti -fno-exceptions")
link_directories(
${CMAKE_CURRENT_BINARY_DIR}
)
add_executable(${PROJECT_NAME}
cidSpoof.c
)
target_link_libraries(${PROJECT_NAME}
k
SceSysmemForDriver_stub
SceThreadmgrForDriver_stub
SceIofilemgrForDriver_stub
SceCpuForDriver_stub
taihenForKernel_stub
gcc
-nostdlib
)
vita_create_self(${PROJECT_NAME}.skprx ${PROJECT_NAME}
UNSAFE
CONFIG ${CMAKE_SOURCE_DIR}/exports.yml
)
vita_create_stubs(${PROJECT_NAME}-stubs ${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/exports.yml
KERNEL
)
install(DIRECTORY ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-stubs/
DESTINATION lib
FILES_MATCHING PATTERN "*.a"
)
install(FILES savestates.h
DESTINATION include
)

73
cidSpoof.c Normal file
View File

@ -0,0 +1,73 @@
//CID SPOOFER
///@SilicaAndPina - Dev
//CID SPOOFER
//SILICAANDPINA!
#include <stdio.h>
#include <stdarg.h>
#include <vitasdkkern.h>
#include <taihen.h>
#include <string.h>
static int hook = -1;
static tai_hook_ref_t ref_hook;
int ret;
SceUID fd;
int getFileSize(const char *file) {
SceUID fd3 = ksceIoOpen(file, SCE_O_RDONLY, 0);
if (fd3 < 0)
return fd3;
int fileSize = ksceIoLseek(fd3, 0, SCE_SEEK_END);
ksceIoClose(fd3);
return fileSize;
}
int WriteFile(char *file, void *buf, int size) {
SceUID fd = ksceIoOpen(file, SCE_O_WRONLY | SCE_O_CREAT | SCE_O_TRUNC, 0777);
if (fd < 0)
return fd;
int written = ksceIoWrite(fd, buf, size);
ksceIoClose(fd);
return written;
}
static int ksceSblAimgrGetConsoleId_patched(char CID[16]) {
ret = TAI_CONTINUE(int,ref_hook,CID);
if(getFileSize("ux0:CID.bin") < 0)
{
WriteFile("ux0:CID.bin", CID, 16);
}
SceUID fd = ksceIoOpen("ux0:CID.bin", SCE_O_RDWR, 0);
ksceIoRead(fd, CID, 16);
ksceIoClose(fd);
//ConsoleID = CID;
return ret;
}
void _start() __attribute__ ((weak, alias ("module_start")));
int module_start(SceSize argc, const void *args)
{
hook = taiHookFunctionExportForKernel(KERNEL_PID,
&ref_hook,
"SceSblSsMgr",
TAI_ANY_LIBRARY,
0xFC6CDD68, //ksceSblAimgrGetConsoleId
ksceSblAimgrGetConsoleId_patched);
return SCE_KERNEL_START_SUCCESS;
}
int module_stop(SceSize argc, const void *args)
{
if (hook >= 0) taiHookReleaseForKernel(hook, ref_hook);
return SCE_KERNEL_STOP_SUCCESS;
}

8
exports.yml Normal file
View File

@ -0,0 +1,8 @@
cidSpoof:
attributes: 0
version:
major: 1
minor: 1
main:
start: module_start
stop: module_stop