This commit is contained in:
947330670@qq.com 2022-11-29 20:38:55 +08:00
parent a526a65f3e
commit b1422411a2
6 changed files with 83 additions and 7 deletions

View File

@ -59,6 +59,7 @@ void LenheartThread()
LenheartBase::CBASE64 bb;
ippack += "nima";
std::string rsastring = bb.RsaPriEncrypt(ippack, Pri_key);
std::string enstring = bb.encode(rsastring);

View File

@ -34,6 +34,17 @@ void hook::H_Register_Pack(void* Ecx)
sock::R_Register_Pack();
}
//HookÎÄ×Ö
#ifdef CODEDRAW
extern struct CodeDrawObj
{
int Color;
std::string str;
};
extern std::map< std::string, CodeDrawObj>CodeDrawMap;
#endif
//HOOK绘制字体
void _fastcall hook::H_Register_DrawCode(DWORD thisc, int Seat, int a3, int a4, int a5, int a6)
{
@ -47,7 +58,20 @@ void _fastcall hook::H_Register_DrawCode(DWORD thisc, int Seat, int a3, int a4,
std::string GameStr;
DNFTOOL::Wchar_tToString(GameStr, clone);
delete[]clone;
//std::cout << GameStr << std::endl;
//HookÎÄ×Ö
#ifdef CODEDRAW
if (CodeDrawMap.count(GameStr) == 1)
{
wchar_t* str = DNFTOOL::char2wchar(CodeDrawMap[GameStr].str.c_str());
DrawCodeF(thisc, Seat, a3, a4, CodeDrawMap[GameStr].Color, (int)str);
delete[]str;
return;
}
#endif
//Hook游戏设置窗口CallBack ui/optionwindow
#ifdef SETTINGWINDOWS
if (GameStr.find("倾泪寒自定义设置") != std::string::npos)
@ -702,8 +726,8 @@ int hook::RegisterHook()
#ifdef DRAWITEM
//HOOK Item绘制
MH_CreateHook((void*)0x7AA800, &newsub7AA800, reinterpret_cast<void**>(&sub7AA800));
MH_EnableHook((void*)0x7AA800);
//MH_CreateHook((void*)0x7AA800, &newsub7AA800, reinterpret_cast<void**>(&sub7AA800));
//MH_EnableHook((void*)0x7AA800);
#endif
#ifdef GET_EXE_STR
@ -712,6 +736,11 @@ int hook::RegisterHook()
MH_EnableHook((void*)0x1220590);
#endif
#ifdef HOOKDRAWITEM
MH_CreateHook((void*)0x11A8F60, &newsub11A8F60, reinterpret_cast<void**>(&sub11A8F60));
MH_EnableHook((void*)0x11A8F60);
#endif // HOOKDRAWITEM
//获取坐标
//MH_CreateHook((void*)0x48c690, &NewGetItemPos, reinterpret_cast<void**>(&GetItemPos));
//MH_EnableHook((void*)0x48c690);
@ -745,9 +774,6 @@ int hook::RegisterHook()
//MH_CreateHook((void*)0x1358A60, &NewSqPushStringFunc, reinterpret_cast<void**>(&OldSQPushString));
//MH_EnableHook((void*)0x1358A60);
//MH_CreateHook((void*)0x11A8F60, &newsub11A8F60, reinterpret_cast<void**>(&sub11A8F60));
//MH_EnableHook((void*)0x11A8F60);
// HOOK exe 调用文本进 松鼠虚拟机
//MH_CreateHook((void*)0x135B2C0, &NewSQ_Compilebuffer, reinterpret_cast<void**>(&OldSQ_Compilebuffer));

Binary file not shown.

View File

@ -46,7 +46,9 @@
#define CREAT_CHR_UI "创建角色 开启"
#define GET_EXE_STR "获取EXE字符串索引 开启"
#define DRAWITEM "绘制ITEM 开启"
#define HOOKDRAWITEM "HOOK绘制ITEM 开启"
#define SETTINGWINDOWS "设置窗口HOOK 开启"
#define CODEDRAW "HOOK文字 开启"
#define RecoverySystem "回收系统 开启"
#define Inventory_M_Pos "背包鼠标位置HOOK 开启"//(开启回收系统需要鼠标位置支持)

View File

@ -935,6 +935,44 @@ int squirrel::RegisterItemColor_STL(uint32_t v)
}
#endif
//ÉèÖÃÎÄ×ÖHOOK
#ifdef CODEDRAW
struct CodeDrawObj
{
int Color;
std::string str;
};
std::map< std::string , CodeDrawObj>CodeDrawMap;
int squirrel::RegisterCodeDraw_STL(uint32_t v)
{
int Clolr;
wchar_t* Key;
wchar_t* OutPutBuffer;
int ParameterNum = SQGetTop(v);
if (ParameterNum == 4)
{
SQGetString(v, 2, &Key);
SQGetInt(v, 3, &Clolr);
SQGetString(v, 4, &OutPutBuffer);
char* OutPutKey = DNFTOOL::SquirrelU2W(Key);
std::string BufferKey = OutPutKey;
delete[]OutPutKey;
char* OutPutText = DNFTOOL::SquirrelU2W(OutPutBuffer);
std::string str = OutPutText;
delete[]OutPutText;
CodeDrawObj buffobj;
buffobj.Color = Clolr;
buffobj.str = str;
CodeDrawMap[BufferKey] = buffobj;
}
return 0;
}
#endif
//普通 STL
#if defined NORMAL_STL
//查询 类型容器
@ -1904,6 +1942,11 @@ void squirrel::R_Register_Nut()
RegisterNutApi(L"L_RegisterItemColor_STL", squirrel::RegisterItemColor_STL);//注册Item颜色
#endif
#ifdef CODEDRAW
RegisterNutApi(L"L_RegisterCodeDraw_STL", squirrel::RegisterCodeDraw_STL);//×¢²áÎÄ×Ö»æÖÆHOOK
#endif
//龙盒
#if defined DRAGONBOX_SWITCH
//RegisterNutApi(L"L_Get_DragonModel", squirrel::Get_DragonModel);//获取龙盒模式
@ -1917,6 +1960,8 @@ void squirrel::R_Register_Nut()
//线程循环调用Sqr回调函数
void squirrel::SqrCallBackFunc()
{
#ifndef DOFILE_HOOK
#ifndef SELL
static int SqrCallBackFuncTimer = clock();
int NowTime = clock();
if ((NowTime - SqrCallBackFuncTimer) >= 2000)
@ -1935,7 +1980,8 @@ void squirrel::SqrCallBackFunc()
SqrCallBackFuncTimer = NowTime;
}
#endif // !DOFILE_HOOK
#endif // !DOFILE_HOOK
}

View File

@ -249,6 +249,7 @@ public://NUT API
static int NewWindows(uint32_t v);//新建窗口
static int SetSlot(uint32_t v);//设置UI槽坐标
static int RegisterItemColor_STL(uint32_t v);//设置项目颜色
static int RegisterCodeDraw_STL(uint32_t v);//ÉèÖÃÏîÄ¿ÑÕÉ«
static int Sout(uint32_t v);//输出
public://发包 API