Move loadmodule/getprocaddress code into os_specific

This commit is contained in:
baldurk
2015-10-29 18:08:48 +01:00
parent 55914f99ae
commit 7b952c53ef
10 changed files with 32 additions and 45 deletions
+5 -11
View File
@@ -451,22 +451,16 @@ void Process::StartGlobalHook(const char *pathmatch, const char *logfile, const
RDCUNIMPLEMENTED("Global hooking of all processes on linux");
}
bool Process::LoadModule(const char *module)
void *Process::LoadModule(const char *module)
{
return dlopen(module, RTLD_NOW) != NULL;
return dlopen(module, RTLD_NOW);
}
void *Process::GetFunctionAddress(const char *module, const char *function)
void *Process::GetFunctionAddress(void *module, const char *function)
{
void *handle = dlopen(module, RTLD_NOW);
if(module == NULL) return NULL;
if(handle == NULL) return NULL;
void *ret = dlsym(handle, function);
dlclose(handle);
return ret;
return dlsym(module, function);
}
uint32_t Process::GetCurrentPID()