C11
[ps4-sdk.git] / source / module.c
blob0b50b7b53c6a27608532e4d539de92e934d0eb51
1 #include "syscall.h"
2 #include "kernel.h"
4 #include "module.h"
6 int (*sceSysmoduleLoadModule)(int id);
8 int getFunctionAddressByName(int loadedModuleID, char *name, void *destination) {
9 return syscall(591, loadedModuleID, name, destination);
12 int getLoadedModules(int *destination, int max, int *count) {
13 return syscall(592, destination, max, count);
16 int getModuleInfo(int loadedModuleID, struct moduleInfo *destination) {
17 return syscall(593, loadedModuleID, destination);
20 int loadModule(const char *name, int *idDestination) {
21 return syscall(594, name, 0, idDestination, 0);
24 int unloadModule(int id) {
25 return syscall(595, id, 0, 0);
28 void initModule(void) {
29 int libModule = sceKernelLoadStartModule("libSceSysmodule.sprx", 0, NULL, 0, 0, 0);
31 // Just use sceKernelLoadStartModule instead
32 RESOLVE(libModule, sceSysmoduleLoadModule);