taiHEN  1.0
CFW framework for PS Vita
Injection Interface

Inject raw data into a module. More...

Kernel Injections

Injection exports to kernel

SceUID taiInjectAbsForKernel (SceUID pid, void *dest, const void *src, size_t size)
 Injects data into a process bypassing MMU flags. More...
 
SceUID taiInjectDataForKernel (SceUID pid, SceUID modid, int segidx, uint32_t offset, const void *data, size_t size)
 Inject data into a process bypassing MMU flags given an offset. More...
 
int taiInjectReleaseForKernel (SceUID tai_uid)
 Release an injection. More...
 

User Injections

Injection exports to user

SceUID taiInjectAbs (void *dest, const void *src, size_t size)
 Injects data into the current process bypassing MMU flags. More...
 
SceUID taiInjectDataForUser (tai_offset_args_t *args)
 Inject data into the current process bypassing MMU flags given an offset. More...
 
int taiInjectRelease (SceUID tai_uid)
 Release an injection for the calling process. More...
 
HELPER SceUID taiInjectData (SceUID modid, int segidx, uint32_t offset, const void *data, size_t size)
 Helper function for taiInjectDataForUser. More...
 

Detailed Description

Inject raw data into a module.

Sometimes, there is a need to inject data directly. This can also be used to inject code for functions too small to be hooked. Unlike hooks only one module can patch a given module and given address at a time. Also note that the original data will be saved by the kernel. That means huge patches are not recommended!

Function Documentation

§ taiInjectAbs()

SceUID taiInjectAbs ( void *  dest,
const void *  src,
size_t  size 
)

Injects data into the current process bypassing MMU flags.

See also
taiInjectAbsForKernel
Parameters
destThe address to inject
[in]srcSource data
[in]sizeThe size of the injection in bytes
Returns
A tai patch reference on success, < 0 on error
  • TAI_ERROR_PATCH_EXISTS if the address is already patched

Definition at line 276 of file taihen-user.c.

§ taiInjectAbsForKernel()

SceUID taiInjectAbsForKernel ( SceUID  pid,
void *  dest,
const void *  src,
size_t  size 
)

Injects data into a process bypassing MMU flags.

Parameters
[in]pidThe pid of the target (can be KERNEL_PID)
destThe destination in the process address space
[in]srcThe source in kernel address space
[in]sizeThe size of the injection in bytes
Returns
A tai patch reference on success, < 0 on error
  • TAI_ERROR_PATCH_EXISTS if the address is already patched

Definition at line 219 of file taihen.c.

§ taiInjectData()

HELPER SceUID taiInjectData ( SceUID  modid,
int  segidx,
uint32_t  offset,
const void *  data,
size_t  size 
)

Helper function for taiInjectDataForUser.

See also
taiInjectDataForUser
Parameters
[in]modidThe module UID from taiGetModuleInfo
[in]segidxIndex of the ELF segment containing the data to patch
[in]offsetThe offset from the start of the segment
[in]dataThe data in kernel address space
[in]sizeThe size of the injection in bytes

Definition at line 402 of file taihen.h.

§ taiInjectDataForKernel()

SceUID taiInjectDataForKernel ( SceUID  pid,
SceUID  modid,
int  segidx,
uint32_t  offset,
const void *  data,
size_t  size 
)

Inject data into a process bypassing MMU flags given an offset.

Parameters
[in]pidThe pid of the target (can be KERNEL_PID)
[in]modidThe module UID from taiGetModuleInfoForKernel
[in]segidxIndex of the ELF segment containing the data to patch
[in]offsetThe offset from the start of the segment
[in]dataThe data in kernel address space
[in]sizeThe size of the injection in bytes
Returns
A tai patch reference on success, < 0 on error
  • TAI_ERROR_PATCH_EXISTS if the address is already patched

Definition at line 236 of file taihen.c.

§ taiInjectDataForUser()

SceUID taiInjectDataForUser ( tai_offset_args_t args)

Inject data into the current process bypassing MMU flags given an offset.

See also
taiInjectDataForKernel
Parameters
[in]argsCall arguments
Returns
A tai patch reference on success, < 0 on error
  • TAI_ERROR_PATCH_EXISTS if the address is already patched

Definition at line 304 of file taihen-user.c.

§ taiInjectRelease()

int taiInjectRelease ( SceUID  tai_uid)

Release an injection for the calling process.

See also
taiInjectReleaseForKernel
Parameters
[in]tai_uidThe tai patch reference to free
Returns
Zero on success, < 0 on error

Definition at line 344 of file taihen-user.c.

§ taiInjectReleaseForKernel()

int taiInjectReleaseForKernel ( SceUID  tai_uid)

Release an injection.

Parameters
[in]tai_uidThe tai patch reference to free
Returns
Zero on success, < 0 on error

Definition at line 255 of file taihen.c.