Esempio n. 1
0
bool pal::get_own_module_path(string_t* recv)
{
    HMODULE hmod;
    if (!GetModuleHandleFromAddress(&get_own_module_path, &hmod))
        return false;

    return GetModuleFileNameWrapper(hmod, recv);
}
Esempio n. 2
0
bool pal::get_current_module(dll_t *mod)
{
    HMODULE hmod = nullptr;
    if (!GetModuleHandleFromAddress(&get_current_module, &hmod))
        return false;

    *mod = (pal::dll_t)hmod;
    return true;
}
Esempio n. 3
0
// Gets the handle to the currently executing module.
static HMODULE GetCurrentModuleHandle() {
	// pass a pointer to the current function
	return GetModuleHandleFromAddress(GetCurrentModuleHandle);
}
static bool IsAddressInCurrentModule(void *address) {
	return GetCurrentModuleHandle() == GetModuleHandleFromAddress(address);
}