This commit is contained in:
2023-05-12 16:08:39 +08:00
parent c1943df644
commit 26aea31550
8 changed files with 272 additions and 214 deletions

View File

@@ -81,6 +81,7 @@ void _fastcall hook::H_Register_DrawCode(DWORD thisc, int Seat, int a3, int a4,
//Hook文字
#ifdef CODEDRAW
if (CodeDrawMap.count(GameStr) == 1)
{
@@ -159,7 +160,7 @@ void _fastcall hook::H_Register_DrawCode(DWORD thisc, int Seat, int a3, int a4,
#endif
//buff换装
//强化系统
#ifdef NEWUPGRADE_SWITCH
if (GameStr.find("LenheartUpgrade") != std::string::npos)
{
@@ -733,6 +734,7 @@ int _fastcall newsub11A8F60(DWORD a1, DWORD Seat, int a2, int a3, int a4)
#endif
#ifdef DRAWITEM
static bool OpenSw = false;
if (!OpenSw)
{
@@ -745,31 +747,32 @@ int _fastcall newsub11A8F60(DWORD a1, DWORD Seat, int a2, int a3, int a4)
}
else
{
uint32_t v = GetSqVm();
SQPushRootTable(v);
SQPushString(v, L"Sq_DrawItemBack", -1);
SQ_Get(v, -2);
SQPushRootTable(v);
SQPushInt(v, a2);
SQPushInt(v, a3);
SQPushInt(v, a4);
SQ_Call(v, 4, 0, 1);
SQPop(v, 2);
//uint32_t v = GetSqVm();
//SQPushRootTable(v);
//SQPushString(v, L"Sq_DrawItemBack", -1);
//SQ_Get(v, -2);
//SQPushRootTable(v);
//SQPushInt(v, a2);
//SQPushInt(v, a3);
//SQPushInt(v, a4);
//SQ_Call(v, 4, 0, 1);
//SQPop(v, 2);
int ret = sub11A8F60(a1, 0, a2, a3, a4);
SQPushRootTable(v);
SQPushString(v, L"Sq_DrawItemFront", -1);
SQ_Get(v, -2);
SQPushRootTable(v);
SQPushInt(v, a2);
SQPushInt(v, a3);
SQPushInt(v, a4);
SQ_Call(v, 4, 0, 1);
SQPop(v, 2);
//SQPushRootTable(v);
//SQPushString(v, L"Sq_DrawItemFront", -1);
//SQ_Get(v, -2);
//SQPushRootTable(v);
//SQPushInt(v, a2);
//SQPushInt(v, a3);
//SQPushInt(v, a4);
//SQ_Call(v, 4, 0, 1);
//SQPop(v, 2);
return ret;
}
#endif
}
#endif
@@ -989,6 +992,7 @@ DWORD** _fastcall NewEvent(DWORD thisc, DWORD Seat, DWORD a2, DWORD** a3, char a
a2 += 167;
a3 = (DWORD**)527;
}
return OldEvent(thisc, Seat, a2, a3, a4);
}
@@ -1064,9 +1068,28 @@ DWORD _fastcall New11A8F60(DWORD thisc, DWORD Seat, DWORD a1, DWORD a2, DWORD a3
}
#endif
typedef DWORD(_fastcall _11816B0)(DWORD thisc, DWORD Seat, DWORD* a2, int a3);
static _11816B0* Old11816B0;
//绘图HOOK
DWORD _fastcall New11816B0(DWORD thisc, DWORD Seat, DWORD* a2, int a3)
{
wchar_t* str = (wchar_t*)a3;
char* OutPutText = DNFTOOL::SquirrelU2W(str);
std::string B = OutPutText;
std::cout << B << std::endl;
delete[]OutPutText;
return Old11816B0(thisc, Seat, a2, a3);
}
int hook::RegisterHook()
{
MH_Initialize();
//MH_CreateHook((void*)0x9D2300, &New_9D2300, reinterpret_cast<void**>(&Old_9D2300));
@@ -1094,7 +1117,7 @@ int hook::RegisterHook()
//HookNut函数注册
MH_CreateHook((void*)INIT_NUT_ADDRESS, &H_Register_Nut, reinterpret_cast<void**>(&MLnewclosure));
MH_EnableHook((void*)INIT_NUT_ADDRESS);
//Hook绘制字符
MH_CreateHook((void*)INIT_NUT_DRAWCODE, &H_Register_DrawCode, reinterpret_cast<void**>(&DrawCodeF));
MH_EnableHook((void*)INIT_NUT_DRAWCODE);
@@ -1192,8 +1215,8 @@ int hook::RegisterHook()
//MH_EnableHook((void*)0x5A4BE0);
//MH_CreateHook((void*)0x1358A60, &NewSqPushStringFunc, reinterpret_cast<void**>(&OldSQPushString));
//MH_EnableHook((void*)0x1358A60);
//MH_CreateHook((void*)0x11816B0, &New11816B0, reinterpret_cast<void**>(&Old11816B0));
//MH_EnableHook((void*)0x11816B0);
// HOOK exe 调用文本进 松鼠虚拟机