taiHEN
1.0
CFW framework for PS Vita
|
CFW framework for Vita. More...
Modules | |
Hooks Interface | |
Patches functions. | |
Injection Interface | |
Inject raw data into a module. | |
Data Structures | |
struct | _tai_module_info |
Extended module information. More... | |
struct | _tai_hook_args |
Pass hook arguments to kernel. More... | |
struct | _tai_offset_args |
Pass offset arguments to kernel. More... | |
struct | _tai_module_args |
Pass module arguments to kernel. More... | |
Macros | |
#define | KERNEL_PID 0x10005 |
#define | TAI_ANY_LIBRARY 0xFFFFFFFF |
#define | TAI_IGNORE_MODULE_NID 0xFFFFFFFF |
#define | TAI_MAIN_MODULE ((void *)0) |
#define | HELPER inline static __attribute__((unused)) |
Typedefs | |
typedef struct _tai_module_info | tai_module_info_t |
Extended module information. More... | |
typedef struct _tai_hook_args | tai_hook_args_t |
Pass hook arguments to kernel. | |
typedef struct _tai_offset_args | tai_offset_args_t |
Pass offset arguments to kernel. | |
typedef struct _tai_module_args | tai_module_args_t |
Pass module arguments to kernel. | |
Plugin loading | |
int | taiLoadPluginsForTitleForKernel (SceUID pid, const char *titleid, int flags) |
Parses the taiHEN config and loads all plugins for a titleid to a process. More... | |
Skprx Load | |
SceUID | taiLoadKernelModule (const char *path, int flags, void *opt) |
Loads a kernel module. More... | |
int | taiStartKernelModuleForUser (SceUID modid, tai_module_args_t *args, void *opt, int *res) |
Starts a kernel module. More... | |
SceUID | taiLoadStartKernelModuleForUser (const char *path, tai_module_args_t *args) |
Loads and starts a kernel module. More... | |
SceUID | taiLoadStartModuleForPidForUser (const char *path, tai_module_args_t *args) |
Loads and starts a user module for another process. More... | |
int | taiStopKernelModuleForUser (SceUID modid, tai_module_args_t *args, void *opt, int *res) |
Stops a kernel module. More... | |
int | taiUnloadKernelModule (SceUID modid, int flags, void *opt) |
Unloads a kernel module directly. More... | |
int | taiStopUnloadKernelModuleForUser (SceUID modid, tai_module_args_t *args, void *opt, int *res) |
Stops and unloads a kernel module. More... | |
int | taiStopModuleForPidForUser (SceUID modid, tai_module_args_t *args, void *opt, int *res) |
Stops a user module for another process. More... | |
int | taiUnloadModuleForPid (SceUID pid, SceUID modid, int flags, void *opt) |
Unloads a user module for a process directly. More... | |
int | taiStopUnloadModuleForPidForUser (SceUID modid, tai_module_args_t *args, void *opt, int *res) |
Stops and unloads a user module for a process. More... | |
HELPER int | taiStartKernelModule (SceUID modid, int args, void *argp, int flags, void *opt, int *res) |
Helper function for taiStartKernelModuleForUser. More... | |
HELPER SceUID | taiLoadStartKernelModule (const char *path, int args, void *argp, int flags) |
Helper function for taiLoadStartKernelModuleForUser. More... | |
HELPER SceUID | taiLoadStartModuleForPid (SceUID pid, const char *path, int args, void *argp, int flags) |
Helper function for taiLoadStartModuleForPidForUser. More... | |
HELPER int | taiStopKernelModule (SceUID modid, int args, void *argp, int flags, void *opt, int *res) |
Helper function for taiStopKernelModuleForUser. More... | |
HELPER int | taiStopUnloadKernelModule (SceUID modid, int args, void *argp, int flags, void *opt, int *res) |
Helper function for taiStopUnloadKernelModuleForUser. More... | |
HELPER int | taiStopModuleForPid (SceUID pid, SceUID modid, int args, void *argp, int flags, void *opt, int *res) |
Helper function for taiStopModuleForPidForUser. More... | |
HELPER int | taiStopUnloadModuleForPid (SceUID pid, SceUID modid, int args, void *argp, int flags, void *opt, int *res) |
Helper function for taiStopUnloadModuleForPidForUser. More... | |
Peek/Poke | |
int | taiMemcpyUserToKernel (void *kernel_dst, const void *user_src, size_t len) |
Copies data from user to kernel. More... | |
int | taiMemcpyKernelToUser (void *user_dst, const void *kernel_src, size_t len) |
Copies data from kernel to user. More... | |
CFW framework for Vita.
Provides basic helper utilities for plugins that aid in user to kernel interaction.
taiHEN proves three types of exports. First is a patch system for modifying code and read-only data. Second is basic peek/poke for the kernel. Third is support for loading kernel modules.
A common question is: when should I use hooks, injections, and peek/poke? If you wish to patch writable data in the kernel and you know the address, then taiMemcpyKernelToUser
works. If you don't know the address but you know the offset from its ELF segment then use an injection. If it is read-only data, then use an injection. Finally, if you wish to patch a function to run your own code, you should use a hook.
#define HELPER inline static __attribute__((unused)) |
#define TAI_ANY_LIBRARY 0xFFFFFFFF |
#define TAI_IGNORE_MODULE_NID 0xFFFFFFFF |
#define TAI_MAIN_MODULE ((void *)0) |
typedef struct _tai_module_info tai_module_info_t |
Extended module information.
This supplements the output of sceKernelGetModuleInfo
SceUID taiLoadKernelModule | ( | const char * | path, |
int | flags, | ||
void * | opt | ||
) |
Loads a kernel module.
[in] | path | The path to the skprx |
[in] | flags | The flags |
opt | Optional arguments, set to NULL |
opt
is not NULLDefinition at line 373 of file taihen-user.c.
int taiLoadPluginsForTitleForKernel | ( | SceUID | pid, |
const char * | titleid, | ||
int | flags | ||
) |
Parses the taiHEN config and loads all plugins for a titleid to a process.
[in] | pid | The pid to load to |
[in] | titleid | The title to read from the config |
[in] | flags | The flags |
HELPER SceUID taiLoadStartKernelModule | ( | const char * | path, |
int | args, | ||
void * | argp, | ||
int | flags | ||
) |
Helper function for taiLoadStartKernelModuleForUser.
[in] | path | The path of the skprx |
[in] | args | The size of the arguments |
argp | The arguments | |
[in] | flags | The flags |
SceUID taiLoadStartKernelModuleForUser | ( | const char * | path, |
tai_module_args_t * | args | ||
) |
Loads and starts a kernel module.
[in] | path | The path of the skprx |
[in] | args | The arguments |
args
is too largeDefinition at line 469 of file taihen-user.c.
HELPER SceUID taiLoadStartModuleForPid | ( | SceUID | pid, |
const char * | path, | ||
int | args, | ||
void * | argp, | ||
int | flags | ||
) |
Helper function for taiLoadStartModuleForPidForUser.
[in] | pid | The pid to load to |
[in] | path | The path of the suprx |
[in] | args | The size of the arguments |
argp | The arguments | |
[in] | flags | The flags |
SceUID taiLoadStartModuleForPidForUser | ( | const char * | path, |
tai_module_args_t * | args | ||
) |
Loads and starts a user module for another process.
[in] | path | The path of the skprx |
[in] | args | The arguments |
args
is too largeDefinition at line 522 of file taihen-user.c.
int taiMemcpyKernelToUser | ( | void * | user_dst, |
const void * | kernel_src, | ||
size_t | len | ||
) |
Copies data from kernel to user.
Does not bypass the MMU!
user_dst | The user address | |
[in] | kernel_src | The kernel address |
[in] | len | The length |
Definition at line 916 of file taihen-user.c.
int taiMemcpyUserToKernel | ( | void * | kernel_dst, |
const void * | user_src, | ||
size_t | len | ||
) |
Copies data from user to kernel.
kernel_dst | The kernel address | |
[in] | user_src | The user address |
[in] | len | The length |
Definition at line 884 of file taihen-user.c.
HELPER int taiStartKernelModule | ( | SceUID | modid, |
int | args, | ||
void * | argp, | ||
int | flags, | ||
void * | opt, | ||
int * | res | ||
) |
Helper function for taiStartKernelModuleForUser.
[in] | modid | The id from taiLoadKernelModule |
[in] | args | The size of the arguments |
argp | The arguments | |
[in] | flags | The flags |
opt | Optional arguments, set to NULL | |
res | Return value of module_start |
int taiStartKernelModuleForUser | ( | SceUID | modid, |
tai_module_args_t * | args, | ||
void * | opt, | ||
int * | res | ||
) |
Starts a kernel module.
[in] | modid | The id from taiLoadKernelModule |
[in] | args | The arguments |
opt | Optional arguments, set to NULL | |
res | Return value of module_start |
args
is too large or opt
is not NULLDefinition at line 416 of file taihen-user.c.
HELPER int taiStopKernelModule | ( | SceUID | modid, |
int | args, | ||
void * | argp, | ||
int | flags, | ||
void * | opt, | ||
int * | res | ||
) |
Helper function for taiStopKernelModuleForUser.
[in] | modid | The loaded module reference |
[in] | args | The size of the arguments to module_stop |
argp | The arguments to module_stop | |
[in] | flags | The flags |
opt | Optional arguments, set to NULL | |
res | Return value of module_stop |
int taiStopKernelModuleForUser | ( | SceUID | modid, |
tai_module_args_t * | args, | ||
void * | opt, | ||
int * | res | ||
) |
Stops a kernel module.
[in] | modid | The loaded module reference |
[in] | args | The arguments |
opt | Optional arguments, set to NULL | |
res | Return value of module_stop |
args
is too large or opt
is not NULLDefinition at line 576 of file taihen-user.c.
HELPER int taiStopModuleForPid | ( | SceUID | pid, |
SceUID | modid, | ||
int | args, | ||
void * | argp, | ||
int | flags, | ||
void * | opt, | ||
int * | res | ||
) |
Helper function for taiStopModuleForPidForUser.
[in] | pid | The pid |
[in] | modid | The loaded module reference |
[in] | args | The size of the arguments to module_stop |
argp | The arguments to module_stop | |
[in] | flags | The flags |
opt | Optional arguments, set to NULL | |
res | Return value of module_stop |
int taiStopModuleForPidForUser | ( | SceUID | modid, |
tai_module_args_t * | args, | ||
void * | opt, | ||
int * | res | ||
) |
Stops a user module for another process.
[in] | modid | The loaded module reference |
[in] | args | The arguments |
opt | Optional arguments, set to NULL | |
res | Return value of module_stop |
args
is too large or opt
is not NULLDefinition at line 734 of file taihen-user.c.
HELPER int taiStopUnloadKernelModule | ( | SceUID | modid, |
int | args, | ||
void * | argp, | ||
int | flags, | ||
void * | opt, | ||
int * | res | ||
) |
Helper function for taiStopUnloadKernelModuleForUser.
[in] | modid | The loaded module reference |
[in] | args | The size of the arguments to module_stop |
argp | The arguments to module_stop | |
[in] | flags | The flags |
opt | Optional arguments, set to NULL | |
res | Return value of module_stop |
int taiStopUnloadKernelModuleForUser | ( | SceUID | modid, |
tai_module_args_t * | args, | ||
void * | opt, | ||
int * | res | ||
) |
Stops and unloads a kernel module.
[in] | modid | The loaded module reference |
[in] | args | The arguments |
opt | Optional arguments, set to NULL | |
res | Return value of module_stop |
args
is too large or opt
is not NULLDefinition at line 675 of file taihen-user.c.
HELPER int taiStopUnloadModuleForPid | ( | SceUID | pid, |
SceUID | modid, | ||
int | args, | ||
void * | argp, | ||
int | flags, | ||
void * | opt, | ||
int * | res | ||
) |
Helper function for taiStopUnloadModuleForPidForUser.
[in] | pid | The pid |
[in] | modid | The loaded module reference |
[in] | args | The size of the arguments to module_stop |
argp | The arguments to module_stop | |
[in] | flags | The flags |
opt | Optional arguments, set to NULL | |
res | Return value of module_stop |
int taiStopUnloadModuleForPidForUser | ( | SceUID | modid, |
tai_module_args_t * | args, | ||
void * | opt, | ||
int * | res | ||
) |
Stops and unloads a user module for a process.
[in] | modid | The loaded module reference |
[in] | args | The arguments |
opt | Optional arguments, set to NULL | |
res | Return value of module_stop |
args
is too large or opt
is not NULLDefinition at line 829 of file taihen-user.c.
int taiUnloadKernelModule | ( | SceUID | modid, |
int | flags, | ||
void * | opt | ||
) |
Unloads a kernel module directly.
[in] | modid | The loaded module reference |
[in] | flags | The flags |
opt | Set to NULL |
Definition at line 633 of file taihen-user.c.
int taiUnloadModuleForPid | ( | SceUID | pid, |
SceUID | modid, | ||
int | flags, | ||
void * | opt | ||
) |
Unloads a user module for a process directly.
[in] | modid | The loaded module reference |
[in] | flags | The flags |
opt | Set to NULL |
Definition at line 789 of file taihen-user.c.