1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-15 20:39:17 +00:00
hashcat/src/dynloader.c

45 lines
700 B
C
Raw Normal View History

2016-09-11 09:42:19 +00:00
/**
* Author......: See docs/credits.txt
2016-09-11 09:42:19 +00:00
* License.....: MIT
*/
#include "common.h"
2019-01-14 09:11:23 +00:00
#include "types.h"
2016-09-11 09:42:19 +00:00
#include "dynloader.h"
#ifdef _WIN
2019-01-14 09:11:23 +00:00
hc_dynlib_t hc_dlopen (LPCSTR lpLibFileName)
{
return LoadLibraryA (lpLibFileName);
}
2019-01-14 09:11:23 +00:00
BOOL hc_dlclose (hc_dynlib_t hLibModule)
{
return FreeLibrary (hLibModule);
}
2019-01-14 09:11:23 +00:00
hc_dynfunc_t hc_dlsym (hc_dynlib_t hModule, LPCSTR lpProcName)
{
return GetProcAddress (hModule, lpProcName);
}
#else
2019-01-14 09:11:23 +00:00
hc_dynlib_t hc_dlopen (const char *filename)
{
return dlopen (filename, RTLD_NOW);
}
2019-01-14 09:11:23 +00:00
int hc_dlclose (hc_dynlib_t handle)
{
return dlclose (handle);
}
2019-01-14 09:11:23 +00:00
hc_dynfunc_t hc_dlsym (hc_dynlib_t handle, const char *symbol)
{
return dlsym (handle, symbol);
}
#endif