NID lookup system.
More...
|
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...
|
|
NID lookup system.
§ 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] | pid | The pid |
[in] | name | The name to lookup. Can be NULL. |
[in] | nid | The nid to lookup. Can be TAI_IGNORE_MODULE_NID . |
[out] | info | The 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] | pid | The pid |
[in] | modname | The name of module to lookup |
[in] | libnid | NID of the exporting library. Can be TAI_ANY_LIBRARY . |
[in] | funcnid | NID of the exported function |
[out] | func | Output 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] | pid | The pid |
[in] | modname | The name of the module importing the function |
[in] | target_libnid | The target's library NID. Can be TAI_ANY_LIBRARY |
[in] | funcnid | The target's function NID |
[out] | stub | Output 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] | pid | The pid of caller |
[in] | modid | The module to offset from |
[in] | segidx | Segment in module to offset from |
[in] | offset | Offset from segment |
[out] | addr | Output final address |
- Returns
- Zero on success, < 0 on error
Definition at line 288 of file module.c.