mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-11-23 13:55:36 +08:00
URGP
This commit is contained in:
parent
d80d92f586
commit
05de2db240
@ -32,6 +32,11 @@ namespace
|
||||
if (i < 4)
|
||||
{
|
||||
hp->offset = i << 2;
|
||||
if (i == 2 && hp->user_value != 1)
|
||||
{
|
||||
hp->split = get_stack(1);
|
||||
hp->type |= USING_SPLIT;
|
||||
}
|
||||
*data = val;
|
||||
*len = 2;
|
||||
hp->text_fun = nullptr;
|
||||
@ -66,6 +71,21 @@ namespace
|
||||
return false;
|
||||
if (DWORD i = SafeFindEnclosingAlignedFunction((DWORD)s, 0x200))
|
||||
{
|
||||
auto [s, e] = Util::QueryModuleLimits((HMODULE)low);
|
||||
auto refs = findxref_reverse_checkcallop(i, s, e, 0xe8);
|
||||
if (refs.size() == 1)
|
||||
{
|
||||
auto f2 = findfuncstart(refs[0], 0x100, true);
|
||||
if (f2)
|
||||
{
|
||||
HookParam hp;
|
||||
hp.address = f2;
|
||||
hp.text_fun = SpecialHookRUGP1;
|
||||
hp.user_value = 1;
|
||||
hp.type = CODEC_ANSI_BE | USING_CHAR;
|
||||
return NewHook(hp, "rUGP");
|
||||
}
|
||||
}
|
||||
HookParam hp;
|
||||
hp.address = i;
|
||||
hp.text_fun = SpecialHookRUGP1;
|
||||
|
@ -93,7 +93,17 @@ uintptr_t getasbaddr(const HookParam &hp)
|
||||
{
|
||||
if (hp.type & FUNCTION_OFFSET)
|
||||
{
|
||||
if (FARPROC function = GetProcAddress(GetModuleHandleW(hp.module), hp.function))
|
||||
FARPROC function = NULL;
|
||||
try
|
||||
{
|
||||
auto ordinal = std::stoi(hp.function);
|
||||
function = GetProcAddress(GetModuleHandleW(hp.module), (LPCSTR)ordinal);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
function = GetProcAddress(GetModuleHandleW(hp.module), hp.function);
|
||||
}
|
||||
if (function)
|
||||
address += (uint64_t)function;
|
||||
else
|
||||
return ConsoleOutput(FUNC_MISSING), 0;
|
||||
|
Loading…
Reference in New Issue
Block a user