mirror of
https://github.com/HIllya51/LunaHook.git
synced 2025-01-11 20:39:34 +08:00
eushully
This commit is contained in:
parent
067b0c288b
commit
10ae1f92c4
@ -1,5 +1,5 @@
|
|||||||
#include"Eushully.h"
|
#include "Eushully.h"
|
||||||
|
|
||||||
/** jichi 6/1/2014 Eushully
|
/** jichi 6/1/2014 Eushully
|
||||||
* Insert to the last GetTextExtentPoint32A
|
* Insert to the last GetTextExtentPoint32A
|
||||||
*
|
*
|
||||||
@ -454,9 +454,10 @@ bool InsertEushullyHook()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
ULONG lastCaller = 0,
|
ULONG lastCaller = 0,
|
||||||
lastCall = 0;
|
lastCall = 0;
|
||||||
auto fun = [&lastCaller, &lastCall](ULONG caller, ULONG call) -> bool {
|
auto fun = [&lastCaller, &lastCall](ULONG caller, ULONG call) -> bool
|
||||||
|
{
|
||||||
lastCaller = caller;
|
lastCaller = caller;
|
||||||
lastCall = call;
|
lastCall = call;
|
||||||
return true; // find last caller && call
|
return true; // find last caller && call
|
||||||
@ -464,13 +465,15 @@ bool InsertEushullyHook()
|
|||||||
MemDbg::iterCallerAddressAfterInt3(fun, (ULONG)::GetTextExtentPoint32A, processStartAddress, processStopAddress);
|
MemDbg::iterCallerAddressAfterInt3(fun, (ULONG)::GetTextExtentPoint32A, processStartAddress, processStopAddress);
|
||||||
if (!lastCaller)
|
if (!lastCaller)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//OtherHook
|
// OtherHook
|
||||||
ULONG thisCaller = 0,
|
ULONG thisCaller = 0,
|
||||||
thisCall = 0,
|
thisCall = 0,
|
||||||
prevCall = 0;
|
prevCall = 0;
|
||||||
auto fun2 = [&thisCaller, &thisCall, &prevCall](ULONG caller, ULONG call) -> bool {
|
auto fun2 = [&thisCaller, &thisCall, &prevCall](ULONG caller, ULONG call) -> bool
|
||||||
if (call - prevCall == 133) { // 0x0046e1f8 - 0x0046e173 = 133
|
{
|
||||||
|
if (call - prevCall == 133)
|
||||||
|
{ // 0x0046e1f8 - 0x0046e173 = 133
|
||||||
thisCaller = caller;
|
thisCaller = caller;
|
||||||
thisCall = call;
|
thisCall = call;
|
||||||
return false; // stop iteration
|
return false; // stop iteration
|
||||||
@ -485,73 +488,122 @@ bool InsertEushullyHook()
|
|||||||
// _In_ int c,
|
// _In_ int c,
|
||||||
// _Out_ LPSIZE lpSize
|
// _Out_ LPSIZE lpSize
|
||||||
// );
|
// );
|
||||||
enum stack { // current stack
|
enum stack
|
||||||
//retaddr = 0 // esp[0] is the return address since this is the beginning of the function
|
{ // current stack
|
||||||
|
// retaddr = 0 // esp[0] is the return address since this is the beginning of the function
|
||||||
arg1_hdc = 4 * 1 // 0x4
|
arg1_hdc = 4 * 1 // 0x4
|
||||||
, arg2_lpString = 4 * 2 // 0x8
|
,
|
||||||
, arg3_lc = 4 * 3 // 0xc
|
arg2_lpString = 4 * 2 // 0x8
|
||||||
, arg4_lpSize = 4 * 4 // 0x10
|
,
|
||||||
|
arg3_lc = 4 * 3 // 0xc
|
||||||
|
,
|
||||||
|
arg4_lpSize = 4 * 4 // 0x10
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
enum : DWORD { sig = 0x550010c2 };
|
enum : DWORD
|
||||||
enum { fun_offset = 3 };
|
{
|
||||||
|
sig = 0x550010c2
|
||||||
|
};
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
fun_offset = 3
|
||||||
|
};
|
||||||
for (auto addr = lastCaller; addr < lastCall; addr++)
|
for (auto addr = lastCaller; addr < lastCall; addr++)
|
||||||
if (*(DWORD *)addr == sig) {
|
if (*(DWORD *)addr == sig)
|
||||||
lastCaller = addr + fun_offset;
|
{
|
||||||
|
lastCaller = addr + fun_offset;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HookParam hp;
|
HookParam hp;
|
||||||
hp.address = lastCaller;
|
hp.address = lastCaller;
|
||||||
hp.type = USING_STRING|FIXING_SPLIT|EMBED_ABLE|EMBED_BEFORE_SIMPLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS; // merging all threads
|
hp.type = USING_STRING | FIXING_SPLIT | EMBED_ABLE | EMBED_BEFORE_SIMPLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS; // merging all threads
|
||||||
hp.offset = arg2_lpString; // arg2 = 0x4 * 2
|
hp.offset = arg2_lpString; // arg2 = 0x4 * 2
|
||||||
hp.hook_font=F_MultiByteToWideChar|F_GetTextExtentPoint32A|F_GetGlyphOutlineA|F_CreateFontA;
|
hp.hook_font = F_MultiByteToWideChar | F_GetTextExtentPoint32A | F_GetGlyphOutlineA | F_CreateFontA;
|
||||||
ConsoleOutput("INSERT Eushully");
|
ConsoleOutput("INSERT Eushully");
|
||||||
bool succ=NewHook(hp, "ARCGameEngine");
|
bool succ = NewHook(hp, "ARCGameEngine");
|
||||||
if(thisCaller){
|
if (thisCaller)
|
||||||
|
{
|
||||||
hp.address = thisCall;
|
hp.address = thisCall;
|
||||||
hp.offset=get_stack(6);
|
hp.offset = get_stack(6);
|
||||||
succ|=NewHook(hp, "ARCGameEngine_other");
|
succ |= NewHook(hp, "ARCGameEngine_other");
|
||||||
}
|
}
|
||||||
return succ;
|
return succ;
|
||||||
}
|
}
|
||||||
namespace{
|
namespace
|
||||||
|
{
|
||||||
//(18禁ゲーム)[200529][エウシュリー] 天冥のコンキスタ DL版
|
//(18禁ゲーム)[200529][エウシュリー] 天冥のコンキスタ DL版
|
||||||
bool TENMEI(){
|
bool TENMEI()
|
||||||
BYTE sig[]={
|
{
|
||||||
0xc7,0x45,XX,0x00,0x00,0x00,0x00,
|
BYTE sig[] = {
|
||||||
0xc7,0x45,XX,0x00,0x00,0x00,0x00,
|
//clang-format off
|
||||||
0xc7,0x45,XX,0x00,0x00,0x00,0x00,
|
0xc7, 0x45, XX, 0x00, 0x00, 0x00, 0x00,
|
||||||
0xc7,0x45,XX,0x00,0x00,0x00,0x00,
|
0xc7, 0x45, XX, 0x00, 0x00, 0x00, 0x00,
|
||||||
0xc7,0x45,XX,0x0f,0x00,0x00,0x00,
|
0xc7, 0x45, XX, 0x00, 0x00, 0x00, 0x00,
|
||||||
0xc6,0x45,XX,0x00,
|
0xc7, 0x45, XX, 0x00, 0x00, 0x00, 0x00,
|
||||||
0xc6,0x45,XX,0x01,
|
0xc7, 0x45, XX, 0x0f, 0x00, 0x00, 0x00,
|
||||||
0xc7,0x45,XX,0x00,0x00,0x00,0x00,
|
0xc6, 0x45, XX, 0x00,
|
||||||
0xc7,0x45,XX,0x00,0x00,0x00,0x00,
|
0xc6, 0x45, XX, 0x01,
|
||||||
0xc7,0x45,XX,0x00,0x00,0x00,0x00,
|
0xc7, 0x45, XX, 0x00, 0x00, 0x00, 0x00,
|
||||||
0xc7,0x45,XX,0x0f,0x00,0x00,0x00,
|
0xc7, 0x45, XX, 0x00, 0x00, 0x00, 0x00,
|
||||||
0xc6,0x45,XX,0x00,
|
0xc7, 0x45, XX, 0x00, 0x00, 0x00, 0x00,
|
||||||
0xc6,0x45,XX,0x03,
|
0xc7, 0x45, XX, 0x0f, 0x00, 0x00, 0x00,
|
||||||
|
0xc6, 0x45, XX, 0x00,
|
||||||
|
0xc6, 0x45, XX, 0x03,
|
||||||
|
//clang-format on
|
||||||
};
|
};
|
||||||
auto addr=MemDbg::findBytes(sig,sizeof(sig),processStartAddress,processStopAddress);
|
auto addr = MemDbg::findBytes(sig, sizeof(sig), processStartAddress, processStopAddress);
|
||||||
if(addr==0)return false;
|
if (addr == 0)
|
||||||
addr=MemDbg::findEnclosingAlignedFunction(addr);
|
return false;
|
||||||
if(addr==0)return false;
|
addr = MemDbg::findEnclosingAlignedFunction(addr);
|
||||||
|
if (addr == 0)
|
||||||
|
return false;
|
||||||
HookParam hp;
|
HookParam hp;
|
||||||
hp.address = addr;
|
hp.address = addr;
|
||||||
hp.type = USING_STRING|USING_SPLIT|NO_CONTEXT;//必须NO_CONTEXT否则被注音的字会被分开
|
hp.type = USING_STRING | USING_SPLIT | NO_CONTEXT; // 必须NO_CONTEXT否则被注音的字会被分开
|
||||||
hp.offset = get_stack(5);
|
hp.offset = get_stack(5);
|
||||||
hp.split= get_stack(1); //name 80000000 各种所有text 0
|
hp.split = get_stack(1); // name 80000000 各种所有text 0
|
||||||
hp.filter_fun=[](void* data, size_t* len, HookParam* hp){
|
hp.filter_fun = [](void *data, size_t *len, HookParam *hp)
|
||||||
StringFilter((char*)data,len,"\xf0\x40",2);
|
{
|
||||||
NewLineCharFilterA((char*)data,len,hp);
|
StringFilter((char *)data, len, "\xf0\x40", 2);
|
||||||
|
NewLineCharFilterA((char *)data, len, hp);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
return NewHook(hp, "TENMEI");
|
return NewHook(hp, "TENMEI");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool Eushully::attach_function() {
|
namespace
|
||||||
|
{
|
||||||
return InsertEushullyHook()||TENMEI();
|
bool pchooks()
|
||||||
}
|
{
|
||||||
|
HookParam hp;
|
||||||
|
hp.address = (DWORD)GetStringTypeExW;
|
||||||
|
hp.offset = get_stack(3);
|
||||||
|
hp.type = USING_STRING | CODEC_UTF16;
|
||||||
|
hp.filter_fun = [](void *data, size_t *len, HookParam *hp)
|
||||||
|
{
|
||||||
|
// 破折号和省略号会变成乱码
|
||||||
|
for (auto i = 0; i < *len / 2; i++)
|
||||||
|
{
|
||||||
|
auto wc = (wchar_t *)data;
|
||||||
|
if (wc[i] == 0xe001)
|
||||||
|
wc[i] = 0x2014;
|
||||||
|
else if (wc[i] == 0xe003)
|
||||||
|
wc[i] = 0x2014;
|
||||||
|
else if (wc[i] == 0xe000)
|
||||||
|
wc[i] = 0x2026;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
auto succ = NewHook(hp, "eushully");
|
||||||
|
hp.address = (DWORD)GetTextExtentPoint32W;
|
||||||
|
hp.offset = get_stack(2);
|
||||||
|
succ |= NewHook(hp, "eushully");
|
||||||
|
return succ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool Eushully::attach_function()
|
||||||
|
{
|
||||||
|
|
||||||
|
return InsertEushullyHook() || TENMEI() || pchooks();
|
||||||
|
}
|
@ -1,11 +1,13 @@
|
|||||||
|
|
||||||
|
|
||||||
class Eushully:public ENGINE{
|
class Eushully : public ENGINE
|
||||||
public:
|
{
|
||||||
Eushully(){
|
public:
|
||||||
|
Eushully()
|
||||||
check_by=CHECK_BY::FILE;
|
{
|
||||||
check_by_target=L"AGERC.DLL";// 6/1/2014 jichi: Eushully, AGE.EXE
|
|
||||||
};
|
check_by = CHECK_BY::FILE;
|
||||||
bool attach_function();
|
check_by_target = L"AGERC.DLL"; // 6/1/2014 jichi: Eushully, AGE.EXE
|
||||||
|
};
|
||||||
|
bool attach_function();
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user