mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-11-30 09:05:39 +08:00
padding
This commit is contained in:
parent
8eec4da368
commit
6e571ccf84
@ -10,7 +10,7 @@ namespace
|
|||||||
uint64_t address = 0;
|
uint64_t address = 0;
|
||||||
uint64_t em_addr = 0;
|
uint64_t em_addr = 0;
|
||||||
int argidx = 0;
|
int argidx = 0;
|
||||||
uintptr_t padding = 0;
|
intptr_t padding = 0;
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
JITTYPE jittype;
|
JITTYPE jittype;
|
||||||
char text[MAX_STRING_SIZE] = {};
|
char text[MAX_STRING_SIZE] = {};
|
||||||
@ -124,7 +124,7 @@ bool IsBadReadPtr(void *data)
|
|||||||
}
|
}
|
||||||
return cacheEntry == BAD_PAGE;
|
return cacheEntry == BAD_PAGE;
|
||||||
}
|
}
|
||||||
void DoSend(int i, uintptr_t address, char *str, uintptr_t padding, JITTYPE jittype = JITTYPE::PC, uint64_t em_addr = 0)
|
void DoSend(int i, uintptr_t address, char *str, intptr_t padding, JITTYPE jittype = JITTYPE::PC, uint64_t em_addr = 0)
|
||||||
{
|
{
|
||||||
str += padding;
|
str += padding;
|
||||||
if (IsBadReadPtr(str) || IsBadReadPtr(str + MAX_STRING_SIZE))
|
if (IsBadReadPtr(str) || IsBadReadPtr(str + MAX_STRING_SIZE))
|
||||||
@ -189,7 +189,7 @@ void Send(char **stack, uintptr_t address)
|
|||||||
DoSend(i, address, stack[i], sp.padding);
|
DoSend(i, address, stack[i], sp.padding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void SafeSendJitVeh(hook_stack *stack, uintptr_t address, uint64_t em_addr, JITTYPE jittype, uintptr_t padding)
|
void SafeSendJitVeh(hook_stack *stack, uintptr_t address, uint64_t em_addr, JITTYPE jittype, intptr_t padding)
|
||||||
{
|
{
|
||||||
__try
|
__try
|
||||||
{
|
{
|
||||||
@ -225,7 +225,7 @@ void SafeSendJitVeh(hook_stack *stack, uintptr_t address, uint64_t em_addr, JITT
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::unordered_map<uintptr_t, uint64_t> addresscalledtime;
|
std::unordered_map<uintptr_t, uint64_t> addresscalledtime;
|
||||||
bool SendJitVeh(PCONTEXT context, uintptr_t address, uint64_t em_addr, JITTYPE jittype, uintptr_t padding)
|
bool SendJitVeh(PCONTEXT context, uintptr_t address, uint64_t em_addr, JITTYPE jittype, intptr_t padding)
|
||||||
{
|
{
|
||||||
if (safeautoleaveveh)
|
if (safeautoleaveveh)
|
||||||
return true;
|
return true;
|
||||||
|
@ -134,7 +134,7 @@ namespace
|
|||||||
// [padding+]
|
// [padding+]
|
||||||
if (std::regex_search(HCode, match, std::wregex(L"^([[:xdigit:]]+)\\+")))
|
if (std::regex_search(HCode, match, std::wregex(L"^([[:xdigit:]]+)\\+")))
|
||||||
{
|
{
|
||||||
hp.padding = std::stoull(match[1], nullptr, 16);
|
hp.padding = std::stoll(match[1], nullptr, 16);
|
||||||
HCode.erase(0, match[0].length());
|
HCode.erase(0, match[0].length());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ struct SearchParam
|
|||||||
codepage = SHIFT_JIS;
|
codepage = SHIFT_JIS;
|
||||||
// uintptr_t padding = 0, // same as hook param padding
|
// uintptr_t padding = 0, // same as hook param padding
|
||||||
// minAddress = 0, maxAddress = (uintptr_t)-1; // hook all functions between these addresses (used only if both modules empty)
|
// minAddress = 0, maxAddress = (uintptr_t)-1; // hook all functions between these addresses (used only if both modules empty)
|
||||||
ALIGNPTR(uint64_t __1, uintptr_t padding = 0);
|
ALIGNPTR(uint64_t __1, intptr_t padding = 0);
|
||||||
ALIGNPTR(uint64_t __2, uintptr_t minAddress = 0);
|
ALIGNPTR(uint64_t __2, uintptr_t minAddress = 0);
|
||||||
ALIGNPTR(uint64_t __3, uintptr_t maxAddress = (uintptr_t)-1);
|
ALIGNPTR(uint64_t __3, uintptr_t maxAddress = (uintptr_t)-1);
|
||||||
wchar_t boundaryModule[MAX_MODULE_SIZE] = {}; // hook all functions within this module (middle priority)
|
wchar_t boundaryModule[MAX_MODULE_SIZE] = {}; // hook all functions within this module (middle priority)
|
||||||
|
Loading…
Reference in New Issue
Block a user