forked from Public-Mirror/Textractor
new cotopha hook
This commit is contained in:
parent
b7b9a315c4
commit
aeb0cafb15
@ -42,7 +42,7 @@ struct HookParam
|
||||
DWORD user_value; // 7/20/2014: jichi additional parameters for PSP games
|
||||
|
||||
void(*text_fun)(DWORD stack, HookParam* hp, BYTE obsoleteAlwaysZero, DWORD* data, DWORD* split, DWORD* len);
|
||||
bool(*filter_fun)(void* data, DWORD* len, HookParam* hp, BYTE obsoleteAlwaysZero); // jichi 10/24/2014: Add filter function. Return true if skip the text
|
||||
bool(*filter_fun)(void* data, DWORD* len, HookParam* hp, BYTE obsoleteAlwaysZero); // jichi 10/24/2014: Add filter function. Return false to skip the text
|
||||
bool(*hook_fun)(DWORD stack, HookParam* hp); // jichi 10/24/2014: Add generic hook function, return false if stop execution.
|
||||
int(*length_fun)(uintptr_t stack, uintptr_t data); // data after padding added
|
||||
|
||||
|
@ -6332,7 +6332,7 @@ static bool InsertYuris2Hook()
|
||||
bool InsertYurisHook()
|
||||
{ return InsertYuris1Hook() || InsertYuris2Hook(); }
|
||||
|
||||
bool InsertCotophaHook()
|
||||
bool InsertCotophaHook1()
|
||||
{
|
||||
enum : DWORD { ins = 0xec8b55 }; // mov ebp,esp, sub esp,* ; jichi 7/12/2014
|
||||
ULONG addr = MemDbg::findCallerAddress((ULONG)::GetTextMetricsA, ins, processStartAddress, processStopAddress);
|
||||
@ -6351,6 +6351,30 @@ bool InsertCotophaHook()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool InsertCotophaHook2()
|
||||
{
|
||||
if (void* addr = GetProcAddress(GetModuleHandleW(NULL), "eslHeapFree"))
|
||||
{
|
||||
HookParam hp = {};
|
||||
hp.address = (uintptr_t)addr;
|
||||
hp.offset = 8;
|
||||
hp.type = USING_UNICODE | USING_STRING;
|
||||
hp.filter_fun = [](void* data, DWORD* len, HookParam*, BYTE)
|
||||
{
|
||||
return std::wstring_view((wchar_t*)data, *len / sizeof(wchar_t)).find(L'\\') != std::wstring_view::npos;
|
||||
};
|
||||
ConsoleOutput("Textractor: INSERT Cotopha 2");
|
||||
NewHook(hp, "Cotopha2");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool InsertCotophaHook()
|
||||
{
|
||||
return InsertCotophaHook1() | InsertCotophaHook2();
|
||||
}
|
||||
|
||||
// jichi 5/10/2014
|
||||
// See also: http://bbs.sumisora.org/read.php?tid=11044704&fpage=2
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user