taiHEN  1.0
CFW framework for PS Vita
Functions
NID Lookup Interface

NID lookup system. More...

Functions

int module_get_by_name_nid (SceUID pid, const char *name, uint32_t nid, tai_module_info_t *info)
 Gets a loaded module by name or NID or both. More...
 
int module_get_offset (SceUID pid, SceUID modid, int segidx, size_t offset, uintptr_t *addr)
 Gets an offset from a segment in a module. More...
 
int module_get_export_func (SceUID pid, const char *modname, uint32_t libnid, uint32_t funcnid, uintptr_t *func)
 Gets an exported function address. More...
 
int module_get_import_func (SceUID pid, const char *modname, uint32_t target_libnid, uint32_t funcnid, uintptr_t *stub)
 Gets an imported function stub address. More...
 

Detailed Description

NID lookup system.

Function Documentation

§ module_get_by_name_nid()

int module_get_by_name_nid ( SceUID  pid,
const char *  name,
uint32_t  nid,
tai_module_info_t info 
)

Gets a loaded module by name or NID or both.

If name is NULL, then only the NID is used to locate the loaded module. If name is not NULL then it will be used to lookup the loaded module. If NID is not TAI_IGNORE_MODULE_NID, then it will be used in the lookup too. If name is NULL and NID is TAI_IGNORE_MODULE_NID then if there is only one main module, it will be returned.

Parameters
[in]pidThe pid
[in]nameThe name to lookup. Can be NULL.
[in]nidThe nid to lookup. Can be TAI_IGNORE_MODULE_NID.
[out]infoThe information
Returns
Zero on success, < 0 on error
  • TAI_ERROR_INVALID_MODULE if both name and NID are undefined and there are multiple main modules. KERNEL_PID will always return this error.

Definition at line 235 of file module.c.

§ module_get_export_func()

int module_get_export_func ( SceUID  pid,
const char *  modname,
uint32_t  libnid,
uint32_t  funcnid,
uintptr_t *  func 
)

Gets an exported function address.

Parameters
[in]pidThe pid
[in]modnameThe name of module to lookup
[in]libnidNID of the exporting library. Can be TAI_ANY_LIBRARY.
[in]funcnidNID of the exported function
[out]funcOutput address of the function
Returns
Zero on success, < 0 on error

Definition at line 326 of file module.c.

§ module_get_import_func()

int module_get_import_func ( SceUID  pid,
const char *  modname,
uint32_t  target_libnid,
uint32_t  funcnid,
uintptr_t *  stub 
)

Gets an imported function stub address.

Parameters
[in]pidThe pid
[in]modnameThe name of the module importing the function
[in]target_libnidThe target's library NID. Can be TAI_ANY_LIBRARY
[in]funcnidThe target's function NID
[out]stubOutput address to stub calling the imported function
Returns
Zero on success, < 0 on error

Definition at line 392 of file module.c.

§ module_get_offset()

int module_get_offset ( SceUID  pid,
SceUID  modid,
int  segidx,
size_t  offset,
uintptr_t *  addr 
)

Gets an offset from a segment in a module.

Parameters
[in]pidThe pid of caller
[in]modidThe module to offset from
[in]segidxSegment in module to offset from
[in]offsetOffset from segment
[out]addrOutput final address
Returns
Zero on success, < 0 on error

Definition at line 288 of file module.c.