Fixed cmake dependencies. Thanks to @devnoname120

This commit is contained in:
TheFloW 2018-08-27 15:29:02 +02:00
parent 344f7bd17c
commit b98ce6b46c
13 changed files with 67 additions and 65 deletions

View File

@ -22,7 +22,14 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c+ + 11 -fno-rtti -fno-exceptions")
set(VITA_MKSFOEX_FLAGS "${VITA_MKSFOEX_FLAGS} -d PARENTAL_LEVEL=1")
set(VITA_MAKE_FSELF_FLAGS "${VITA_MAKE_FSELF_FLAGS} -a 0x2808000000000000")
add_subdirectory(modules/kernel)
add_subdirectory(modules/user)
add_subdirectory(modules/patch)
add_subdirectory(modules/usbdevice)
include_directories(
modules/kernel
modules/user
)
link_directories(
@ -50,6 +57,11 @@ ENDFUNCTION()
file(GLOB res_files RELATIVE
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/modules/kernel/kernel.skprx
${CMAKE_CURRENT_BINARY_DIR}/modules/user/user.suprx
${CMAKE_CURRENT_BINARY_DIR}/modules/patch/patch.skprx
${CMAKE_CURRENT_BINARY_DIR}/modules/usbdevice/usbdevice.skprx
resources/umass.skprx
resources/default/*.png
resources/default/*.txt
resources/electron/*.png
@ -57,8 +69,6 @@ file(GLOB res_files RELATIVE
resources/*.png
resources/*.txt
resources/*.bin
resources/*.suprx
resources/*.skprx
)
add_resources(vitashell_res ${res_files})
@ -123,7 +133,10 @@ add_executable(VitaShell
libmad/timer.c
)
add_dependencies(VitaShell vitashell_user_stubs)
target_link_libraries(VitaShell
${CMAKE_CURRENT_BINARY_DIR}/modules/user/vitashell_user_stubs/libVitaShellUser_stub_weak.a
ftpvita
vita2d
vorbisfile
@ -142,7 +155,6 @@ target_link_libraries(VitaShell
crypto
expat
taihen_stub
VitaShellUser_stub_weak
SceAppMgr_stub
SceAppUtil_stub
SceAudio_stub

26
init.c
View File

@ -77,11 +77,16 @@ INCLUDE_EXTERN_RESOURCE(electron_sfo_icon_png);
INCLUDE_EXTERN_RESOURCE(electron_text_icon_png);
INCLUDE_EXTERN_RESOURCE(electron_settings_png);
INCLUDE_EXTERN_RESOURCE(user_suprx);
INCLUDE_EXTERN_RESOURCE(usbdevice_skprx);
INCLUDE_EXTERN_RESOURCE(kernel_skprx);
INCLUDE_EXTERN_RESOURCE(umass_skprx);
INCLUDE_EXTERN_RESOURCE(patch_skprx);
extern unsigned char _binary_build_modules_kernel_kernel_skprx_start;
extern unsigned char _binary_build_modules_kernel_kernel_skprx_size;
extern unsigned char _binary_build_modules_user_user_suprx_start;
extern unsigned char _binary_build_modules_user_user_suprx_size;
extern unsigned char _binary_build_modules_patch_patch_skprx_start;
extern unsigned char _binary_build_modules_patch_patch_skprx_size;
extern unsigned char _binary_build_modules_usbdevice_usbdevice_skprx_start;
extern unsigned char _binary_build_modules_usbdevice_usbdevice_skprx_size;
#define DEFAULT_FILE(path, name, replace) { path, (void *)&_binary_resources_##name##_start, (int)&_binary_resources_##name##_size, replace }
@ -137,11 +142,16 @@ static DefaultFile default_files[] = {
DEFAULT_FILE("ux0:VitaShell/theme/Electron/text_icon.png", electron_text_icon_png, 1),
DEFAULT_FILE("ux0:VitaShell/theme/Electron/settings.png", electron_settings_png, 1),
DEFAULT_FILE("ux0:VitaShell/module/user.suprx", user_suprx, 1),
DEFAULT_FILE("ux0:VitaShell/module/usbdevice.skprx", usbdevice_skprx, 1),
DEFAULT_FILE("ux0:VitaShell/module/kernel.skprx", kernel_skprx, 1),
DEFAULT_FILE("ux0:VitaShell/module/umass.skprx", umass_skprx, 1),
DEFAULT_FILE("ux0:VitaShell/module/patch.skprx", patch_skprx, 1),
{ "ux0:VitaShell/module/kernel.skprx", (void *)&_binary_build_modules_kernel_kernel_skprx_start,
(int)&_binary_build_modules_kernel_kernel_skprx_size, 1 },
{ "ux0:VitaShell/module/user.suprx", (void *)&_binary_build_modules_user_user_suprx_start,
(int)&_binary_build_modules_user_user_suprx_size, 1 },
{ "ux0:VitaShell/module/patch.skprx", (void *)&_binary_build_modules_patch_patch_skprx_start,
(int)&_binary_build_modules_patch_patch_skprx_size, 1 },
{ "ux0:VitaShell/module/usbdevice.skprx", (void *)&_binary_build_modules_usbdevice_usbdevice_skprx_start,
(int)&_binary_build_modules_usbdevice_usbdevice_skprx_size, 1 },
};
char vitashell_titleid[12];

View File

@ -32,18 +32,4 @@ target_link_libraries(kernel
vita_create_self(kernel.skprx kernel CONFIG exports.yml UNSAFE)
vita_create_stubs(stubs kernel ${CMAKE_SOURCE_DIR}/exports.yml KERNEL)
install(DIRECTORY ${CMAKE_BINARY_DIR}/stubs/
DESTINATION lib
FILES_MATCHING PATTERN "*.a"
)
install(FILES vitashell_kernel.h
DESTINATION include
)
add_custom_target(copy
COMMAND cp kernel.skprx ../../../resources/kernel.skprx
DEPENDS kernel.skprx
)
vita_create_stubs(vitashell_kernel_stubs kernel exports.yml KERNEL)

View File

@ -127,7 +127,8 @@ int _shellKernelMountById(ShellMountIdArgs *args) {
int res;
void *(* sceAppMgrFindProcessInfoByPid)(void *data, SceUID pid);
int (* sceAppMgrMountById)(SceUID pid, void *info, int id, const char *titleid, const char *path, const char *desired_mount_point, const void *klicensee, char *mount_point);
int (* sceAppMgrMountById)(SceUID pid, void *info, int id, const char *titleid, const char *path,
const char *desired_mount_point, const void *klicensee, char *mount_point);
int (* _ksceKernelGetModuleInfo)(SceUID pid, SceUID modid, SceKernelModuleInfo *info);
// Get tai module info
@ -154,9 +155,11 @@ int _shellKernelMountById(ShellMountIdArgs *args) {
break;
}
res = module_get_export_func(KERNEL_PID, "SceKernelModulemgr", 0xC445FA63, 0xD269F915, (uintptr_t *)&_ksceKernelGetModuleInfo);
res = module_get_export_func(KERNEL_PID, "SceKernelModulemgr",
0xC445FA63, 0xD269F915, (uintptr_t *)&_ksceKernelGetModuleInfo);
if (res < 0)
res = module_get_export_func(KERNEL_PID, "SceKernelModulemgr", 0x92C9FFC2, 0xDAA90093, (uintptr_t *)&_ksceKernelGetModuleInfo);
res = module_get_export_func(KERNEL_PID, "SceKernelModulemgr",
0x92C9FFC2, 0xDAA90093, (uintptr_t *)&_ksceKernelGetModuleInfo);
if (res < 0)
return res;
@ -192,8 +195,14 @@ int _shellKernelMountById(ShellMountIdArgs *args) {
if (args->klicensee)
ksceKernelMemcpyUserToKernel(klicensee, (uintptr_t)args->klicensee, 0x10);
res = sceAppMgrMountById(process_id, info + 0x580, args->id, args->process_titleid ? process_titleid : NULL, args->path ? path : NULL,
args->desired_mount_point ? desired_mount_point : NULL, args->klicensee ? klicensee : NULL, mount_point);
res = sceAppMgrMountById(process_id,
info + 0x580,
args->id,
args->process_titleid ? process_titleid : NULL,
args->path ? path : NULL,
args->desired_mount_point ? desired_mount_point : NULL,
args->klicensee ? klicensee : NULL,
mount_point);
if (args->mount_point)
ksceKernelStrncpyKernelToUser((uintptr_t)args->mount_point, mount_point, 15);
@ -257,11 +266,13 @@ int module_start(SceSize args, void *argp) {
}
// Fake safe mode so that SceUsbMass can be loaded
tmp1 = taiHookFunctionExportForKernel(KERNEL_PID, &ksceSysrootIsSafeModeRef, "SceSysmem", 0x2ED7F97A, 0x834439A7, ksceSysrootIsSafeModePatched);
tmp1 = taiHookFunctionExportForKernel(KERNEL_PID, &ksceSysrootIsSafeModeRef, "SceSysmem",
0x2ED7F97A, 0x834439A7, ksceSysrootIsSafeModePatched);
if (tmp1 < 0)
return SCE_KERNEL_START_SUCCESS;
// this patch is only needed on handheld units
tmp2 = taiHookFunctionExportForKernel(KERNEL_PID, &ksceSblAimgrIsDolceRef, "SceSysmem", 0xFD00C69A, 0x71608CA3, ksceSblAimgrIsDolcePatched);
tmp2 = taiHookFunctionExportForKernel(KERNEL_PID, &ksceSblAimgrIsDolceRef, "SceSysmem",
0xFD00C69A, 0x71608CA3, ksceSblAimgrIsDolcePatched);
if (tmp2 < 0)
return SCE_KERNEL_START_SUCCESS;
@ -277,7 +288,8 @@ int module_start(SceSize args, void *argp) {
return SCE_KERNEL_START_SUCCESS;
// Fake safe mode in SceUsbServ
hookid = taiHookFunctionImportForKernel(KERNEL_PID, &ksceSysrootIsSafeModeRef, "SceUsbServ", 0x2ED7F97A, 0x834439A7, ksceSysrootIsSafeModePatched);
hookid = taiHookFunctionImportForKernel(KERNEL_PID, &ksceSysrootIsSafeModeRef, "SceUsbServ",
0x2ED7F97A, 0x834439A7, ksceSysrootIsSafeModePatched);
return SCE_KERNEL_START_SUCCESS;
}

View File

@ -23,10 +23,3 @@ target_link_libraries(patch
)
vita_create_self(patch.skprx patch CONFIG exports.yml UNSAFE)
vita_create_stubs(stubs patch ${CMAKE_SOURCE_DIR}/exports.yml KERNEL)
add_custom_target(copy
COMMAND cp patch.skprx ../../../resources/patch.skprx
DEPENDS patch.skprx
)

View File

@ -25,8 +25,3 @@ target_link_libraries(usbdevice
)
vita_create_self(usbdevice.skprx usbdevice CONFIG exports.yml UNSAFE)
add_custom_target(copy
COMMAND cp usbdevice.skprx ../../../resources/usbdevice.skprx
DEPENDS usbdevice.skprx
)

View File

@ -75,8 +75,10 @@ int module_start(SceSize args, void *argp) {
hooks[0] = taiInjectDataForKernel(KERNEL_PID, info.modid, 0, 0x1738, zero, 0x6E);
// Add patches to support exFAT
hooks[1] = taiHookFunctionImportForKernel(KERNEL_PID, &ksceIoOpenRef, "SceUsbstorVStorDriver", 0x40FD29C7, 0x75192972, ksceIoOpenPatched);
hooks[2] = taiHookFunctionImportForKernel(KERNEL_PID, &ksceIoReadRef, "SceUsbstorVStorDriver", 0x40FD29C7, 0xE17EFC03, ksceIoReadPatched);
hooks[1] = taiHookFunctionImportForKernel(KERNEL_PID, &ksceIoOpenRef, "SceUsbstorVStorDriver",
0x40FD29C7, 0x75192972, ksceIoOpenPatched);
hooks[2] = taiHookFunctionImportForKernel(KERNEL_PID, &ksceIoReadRef, "SceUsbstorVStorDriver",
0x40FD29C7, 0xE17EFC03, ksceIoReadPatched);
return SCE_KERNEL_START_SUCCESS;
}

View File

@ -14,30 +14,22 @@ 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")
include_directories(
../kernel
)
add_executable(user
main.c
)
add_dependencies(user vitashell_kernel_stubs)
target_link_libraries(user
${CMAKE_CURRENT_BINARY_DIR}/../kernel/vitashell_kernel_stubs/libVitaShellKernel2_stub.a
SceLibKernel_stub
SceIofilemgr_stub
VitaShellKernel2_stub
)
vita_create_self(user.suprx user CONFIG exports.yml UNSAFE)
vita_create_stubs(stubs user ${CMAKE_SOURCE_DIR}/exports.yml)
install(DIRECTORY ${CMAKE_BINARY_DIR}/stubs/
DESTINATION lib
FILES_MATCHING PATTERN "*.a"
)
install(FILES vitashell_user.h
DESTINATION include
)
add_custom_target(copy
COMMAND cp user.suprx ../../../resources/user.suprx
DEPENDS user.suprx
)
vita_create_stubs(vitashell_user_stubs user exports.yml)

View File

@ -19,7 +19,7 @@
#ifndef __VITASHELL_USER_H__
#define __VITASHELL_USER_H__
#include <vitashell_kernel.h>
#include "vitashell_kernel.h"
int shellUserIsUx0Redirected(const char *blkdev, const char *blkdev2);
int shellUserRedirectUx0(const char *blkdev, const char *blkdev2);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.