111
This commit is contained in:
parent
a1b9f7a32d
commit
a08eb9c220
101
test/DNFTOOL.cpp
101
test/DNFTOOL.cpp
|
|
@ -64,16 +64,59 @@ std::string DNFTOOL::GetUserIp()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wchar_t* wgameip = (wchar_t*)0x1AE9CEC;
|
//wchar_t* wgameip = (wchar_t*)0x1AE9CEC;
|
||||||
|
wchar_t* wgameip = (wchar_t*)0x15A73A4;
|
||||||
DNFTOOL::Wchar_tToString(ippack, wgameip);
|
DNFTOOL::Wchar_tToString(ippack, wgameip);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ippack;
|
return ippack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//std::string basejiaoben;
|
//std::string basejiaoben;
|
||||||
bool jiaoben = false;
|
bool jiaoben = false;
|
||||||
std::vector<std::string> BaseData;
|
std::vector<std::string> BaseData;
|
||||||
|
|
||||||
|
|
||||||
|
void Unski(std::string Body) {
|
||||||
|
std::vector<std::string> BaseDataBuffer;
|
||||||
|
DNFTOOL::Split(Body, BaseDataBuffer, "$$$$$");
|
||||||
|
|
||||||
|
size_t Ds = BaseDataBuffer.size();
|
||||||
|
|
||||||
|
for (size_t i = 0; i < Ds; i++)
|
||||||
|
{
|
||||||
|
std::string filename = "BaseData" + std::to_string(i);
|
||||||
|
std::string str = BaseDataBuffer[i];
|
||||||
|
|
||||||
|
str = str.substr(str.find("[") + 1, str.length() - 2);
|
||||||
|
|
||||||
|
std::vector<std::string> Data;
|
||||||
|
DNFTOOL::Split(str, Data, ", ");
|
||||||
|
size_t Ds = Data.size();
|
||||||
|
|
||||||
|
char* nutstr = new char[Ds + 1];
|
||||||
|
|
||||||
|
|
||||||
|
for (size_t s = 0; s < Ds; s++)
|
||||||
|
{
|
||||||
|
nutstr[s] = char(atoi(Data[s].c_str()));
|
||||||
|
}
|
||||||
|
nutstr[Ds] = '\0';
|
||||||
|
|
||||||
|
int skey[] = Skey;//定义解密数组
|
||||||
|
Cutecode(nutstr, skey);//解密
|
||||||
|
|
||||||
|
BaseData.push_back(nutstr);
|
||||||
|
}
|
||||||
|
|
||||||
|
jiaoben = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool DNFTOOL::ReqIpLicense(std::string ippack,std::string Rqip)
|
bool DNFTOOL::ReqIpLicense(std::string ippack,std::string Rqip)
|
||||||
{
|
{
|
||||||
LenheartBase::CBASE64 bb;
|
LenheartBase::CBASE64 bb;
|
||||||
|
|
@ -119,8 +162,7 @@ bool DNFTOOL::ReqIpLicense(std::string ippack,std::string Rqip)
|
||||||
|
|
||||||
if (nres->status == 200)//Èç¹û·µ»Ø°üÕý³£
|
if (nres->status == 200)//Èç¹û·µ»Ø°üÕý³£
|
||||||
{
|
{
|
||||||
DNFTOOL::Split(nres->body, BaseData, "$$$$$");
|
Unski(nres->body);
|
||||||
jiaoben = true;
|
|
||||||
}
|
}
|
||||||
#endif // SELL
|
#endif // SELL
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -344,13 +386,13 @@ int DNFTOOL::GetEquAddr(int addr)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 13:
|
case 13://帽子
|
||||||
return 0x3010;
|
return 0x3010;
|
||||||
break;
|
break;
|
||||||
case 14:
|
case 14://头部
|
||||||
return 0x3014;
|
return 0x3014;
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15://脸
|
||||||
return 0x3018;
|
return 0x3018;
|
||||||
break;
|
break;
|
||||||
case 16:
|
case 16:
|
||||||
|
|
@ -576,25 +618,23 @@ std::string DNFTOOL::ReplaceAllword(const std::string& resources, const std::str
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined LOCALHOSTS_SWITCH
|
|
||||||
|
|
||||||
#else
|
|
||||||
std::string BAKIP()
|
std::string BAKIP()
|
||||||
{
|
{
|
||||||
//std::cout << "»ñÈ¡Ip" << std::endl;
|
////std::cout << "获取Ip" << std::endl;
|
||||||
httplib::SSLClient Tencword("gitee.com");
|
//httplib::SSLClient Tencword("gitee.com");
|
||||||
std::string body;
|
//std::string body;
|
||||||
auto res = Tencword.Get("/yosin_team/request-ip/raw/master/README.md",
|
//auto res = Tencword.Get("/yosin_team/request-ip/raw/master/README.md",
|
||||||
[&](const char* data, size_t data_length) {
|
// [&](const char* data, size_t data_length) {
|
||||||
body.append(data, data_length);
|
// body.append(data, data_length);
|
||||||
return true;
|
// return true;
|
||||||
});
|
// });
|
||||||
if (!body.empty())
|
//if (!body.empty())
|
||||||
{
|
//{
|
||||||
return body;
|
// return body;
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
return DNFTOOL::GetIP();
|
// return DNFTOOL::GetIP();
|
||||||
}
|
}
|
||||||
std::string DNFTOOL::GetIP()
|
std::string DNFTOOL::GetIP()
|
||||||
{
|
{
|
||||||
|
|
@ -626,24 +666,9 @@ std::string DNFTOOL::GetIP()
|
||||||
|
|
||||||
Ip = uncode;
|
Ip = uncode;
|
||||||
//std::cout << "»ñÈ¡Ip" << std::endl;
|
//std::cout << "»ñÈ¡Ip" << std::endl;
|
||||||
/*
|
|
||||||
httplib::SSLClient Tencword("raw.codehub.cn");
|
|
||||||
std::string body;
|
|
||||||
auto res = Tencword.Get("/p/huoqushuju/d/GetIp/git/raw/master/ip.txt?token=9iylYXiVKiGH3OK2szhpCK1hbvKI7e98Q1JuKpSu4r",
|
|
||||||
[&](const char* data, size_t data_length) {
|
|
||||||
body.append(data, data_length);
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
if (!body.empty())
|
|
||||||
{
|
|
||||||
return body;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return BAKIP();
|
|
||||||
*/
|
|
||||||
return Ip;
|
return Ip;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
DWORD DNFTOOL::Motify_memory_attributes(int address, DWORD attributes)
|
DWORD DNFTOOL::Motify_memory_attributes(int address, DWORD attributes)
|
||||||
|
|
|
||||||
|
|
@ -150,3 +150,20 @@ public:
|
||||||
static DWORD Motify_memory_attributes(int address, DWORD attributes = PAGE_EXECUTE_READWRITE);
|
static DWORD Motify_memory_attributes(int address, DWORD attributes = PAGE_EXECUTE_READWRITE);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static char* GBKTOUTF8(std::string& strGBK)//תÂë GBK±àÂëת³ÉUTF8±àÂë
|
||||||
|
{
|
||||||
|
int len = MultiByteToWideChar(CP_ACP, 0, strGBK.c_str(), -1, NULL, 0);
|
||||||
|
wchar_t* wszUtf8 = new wchar_t[len];
|
||||||
|
memset(wszUtf8, 0, len);
|
||||||
|
MultiByteToWideChar(CP_ACP, 0, strGBK.c_str(), -1, wszUtf8, len);
|
||||||
|
len = WideCharToMultiByte(CP_UTF8, 0, wszUtf8, -1, NULL, 0, NULL, NULL);
|
||||||
|
char* szUtf8 = new char[len + 1];
|
||||||
|
memset(szUtf8, 0, len + 1);
|
||||||
|
WideCharToMultiByte(CP_UTF8, 0, wszUtf8, -1, szUtf8, len, NULL, NULL);
|
||||||
|
strGBK = szUtf8;
|
||||||
|
delete[] szUtf8;
|
||||||
|
delete[] wszUtf8;
|
||||||
|
return (char*)strGBK.c_str();
|
||||||
|
}
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
|
static int awqs = 0;
|
||||||
//单个字符解密
|
//单个字符解密
|
||||||
char CutcodeChar(char c, int key, int key2) {
|
char CutcodeChar(char c, int key, int key2) {
|
||||||
return (((c - 1) ^ key) ^ key2) - key;
|
awqs++;
|
||||||
|
char a = (((c - 1) ^ key) ^ key2) - key;
|
||||||
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
//解密
|
//解密
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
void Makecode(char* pstr, int* pkey);
|
void Makecode(char* pstr, int* pkey);
|
||||||
void Cutecode(char* pstr, int* pkey);
|
void Cutecode(char* pstr, int* pkey);
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
#include "pch.h"
|
||||||
|
|
@ -106,12 +106,14 @@ void LenheartThread()
|
||||||
//验证并请求加载脚本
|
//验证并请求加载脚本
|
||||||
std::string Iname = *it;
|
std::string Iname = *it;
|
||||||
bool In = DNFTOOL::ReqIpLicense(ippack, Iname);
|
bool In = DNFTOOL::ReqIpLicense(ippack, Iname);
|
||||||
|
//std::cout << Iname << "连接状态:" << In << std::endl;
|
||||||
if (In)return;
|
if (In)return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -132,7 +134,9 @@ void MouseEvent()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__declspec(dllexport) void Lenheart()
|
|
||||||
|
|
||||||
|
__declspec(dllexport) void _cdecl Lenheart()
|
||||||
{
|
{
|
||||||
|
|
||||||
DWORD threadID;
|
DWORD threadID;
|
||||||
|
|
@ -143,6 +147,7 @@ __declspec(dllexport) void Lenheart()
|
||||||
HANDLE Thand2 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MouseEvent, NULL, 0, &threadID2);
|
HANDLE Thand2 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MouseEvent, NULL, 0, &threadID2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -256,6 +261,44 @@ void HookHudUi()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
LRESULT CALLBACK LenheartCode(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
case WM_IME_COMPOSITION:
|
||||||
|
{
|
||||||
|
if (lParam & GCS_RESULTSTR) // 检查是否有最终字符串结果
|
||||||
|
{
|
||||||
|
HIMC hIMC = ImmGetContext(hwnd); // 获取输入上下文句柄
|
||||||
|
if (hIMC)
|
||||||
|
{
|
||||||
|
DWORD dwSize = ImmGetCompositionString(hIMC, GCS_RESULTSTR, NULL, 0);
|
||||||
|
TCHAR* pszCompStr = new TCHAR[dwSize / sizeof(TCHAR) + 1];
|
||||||
|
ImmGetCompositionString(hIMC, GCS_RESULTSTR, pszCompStr, dwSize);
|
||||||
|
pszCompStr[dwSize / sizeof(TCHAR)] = '\0';
|
||||||
|
|
||||||
|
std::wcout << pszCompStr << std::endl;
|
||||||
|
// 此时pszCompStr包含了输入法输入的字符串,你可以根据需要使用它
|
||||||
|
// 例如,将其显示到窗口或编辑控件中
|
||||||
|
|
||||||
|
delete[] pszCompStr; // 使用完毕后记得释放内存
|
||||||
|
ImmReleaseContext(hwnd, hIMC); // 释放输入上下文句柄
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 其他消息处理...
|
||||||
|
}
|
||||||
|
return DefWindowProc(hwnd, message, wParam, lParam);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOL APIENTRY DllMain(HINSTANCE hModule,
|
BOOL APIENTRY DllMain(HINSTANCE hModule,
|
||||||
DWORD ul_reason_for_call,
|
DWORD ul_reason_for_call,
|
||||||
LPVOID lpReserved
|
LPVOID lpReserved
|
||||||
|
|
@ -268,6 +311,7 @@ BOOL APIENTRY DllMain(HINSTANCE hModule,
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//LoadLibrary(L"ksfp.dll");
|
//LoadLibrary(L"ksfp.dll");
|
||||||
//memcpy((void*)0x00F4AA66, "\xE9\xFA\x02\x00\x00\x90", 6);
|
//memcpy((void*)0x00F4AA66, "\xE9\xFA\x02\x00\x00\x90", 6);
|
||||||
FILE* file = fopen("ImagePacks2/!HUD_Yosin百级UI.NPK", "rb");
|
FILE* file = fopen("ImagePacks2/!HUD_Yosin百级UI.NPK", "rb");
|
||||||
|
|
@ -276,12 +320,23 @@ BOOL APIENTRY DllMain(HINSTANCE hModule,
|
||||||
HookHudUi();
|
HookHudUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FILE* file2 = fopen("Xuefeng2_bConsole", "rb");
|
||||||
|
if (file2)
|
||||||
|
{
|
||||||
|
AllocConsole();
|
||||||
|
SetConsoleTitleA("Lenheart");
|
||||||
|
//SetConsoleOutputCP(65001);
|
||||||
|
freopen(("CONOUT$"), ("w"), stdout);
|
||||||
|
freopen(("CONOUT$"), ("w"), stderr);
|
||||||
|
freopen(("CONIN$"), ("r"), stdin);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//是否开启控制台
|
//是否开启控制台
|
||||||
#ifdef COUTWINDOWS_SWITCH
|
#ifdef COUTWINDOWS_SWITCH
|
||||||
AllocConsole();
|
AllocConsole();
|
||||||
SetConsoleTitleA("Lenheart");
|
SetConsoleTitle(L"Lenheart");
|
||||||
//SetConsoleOutputCP(65001);
|
//SetConsoleOutputCP(65001);
|
||||||
freopen(("CONOUT$"), ("w"), stdout);
|
freopen(("CONOUT$"), ("w"), stdout);
|
||||||
freopen(("CONOUT$"), ("w"), stderr);
|
freopen(("CONOUT$"), ("w"), stderr);
|
||||||
|
|
@ -299,6 +354,7 @@ BOOL APIENTRY DllMain(HINSTANCE hModule,
|
||||||
hook::RegisterHook();
|
hook::RegisterHook();
|
||||||
Lenheart();
|
Lenheart();
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
339
test/hook.cpp
339
test/hook.cpp
|
|
@ -36,7 +36,9 @@ uint32_t __cdecl hook::H_Register_Nut(uint32_t v, void* f, int freeVarsCnt)
|
||||||
uint32_t v = GetSqVm();
|
uint32_t v = GetSqVm();
|
||||||
std::string BaseFile = "YosinBaseC";
|
std::string BaseFile = "YosinBaseC";
|
||||||
//std::string Base = "function Sq_Get_Ex_LevelData(a,b,c) {return 0;} function Sq_Get_Ex_IntData(a,b,c) {return 0;} function Sq_Get_Ex_SkillCoolTime(a,b,c) {return 0;} function Lenheart(pack) {} function Sq_DrawMainMaxLayerCustomUI(pack) { } function Sq_DrawMainTopLayerCustomUI(pack) {} function Sq_SelectCharacter(Chunk){} function Sq_SendPackType_Event(Chunk){} function Sq_SendPackByte_Event(Chunk){} function Sq_SendPackWord_Event(Chunk){} function Sq_SendPackDWord_Event(Chunk){} function Sq_SendPackChar_Event(Chunk){} function Sq_SendPack_Event(Chunk){} function Sq_Pack_Control(Chunk){} ";
|
//std::string Base = "function Sq_Get_Ex_LevelData(a,b,c) {return 0;} function Sq_Get_Ex_IntData(a,b,c) {return 0;} function Sq_Get_Ex_SkillCoolTime(a,b,c) {return 0;} function Lenheart(pack) {} function Sq_DrawMainMaxLayerCustomUI(pack) { } function Sq_DrawMainTopLayerCustomUI(pack) {} function Sq_SelectCharacter(Chunk){} function Sq_SendPackType_Event(Chunk){} function Sq_SendPackByte_Event(Chunk){} function Sq_SendPackWord_Event(Chunk){} function Sq_SendPackDWord_Event(Chunk){} function Sq_SendPackChar_Event(Chunk){} function Sq_SendPack_Event(Chunk){} function Sq_Pack_Control(Chunk){} ";
|
||||||
std::string Base = R"(function Sq_L_Medal (x,y) {}
|
std::string Base = R"(
|
||||||
|
Lenheart_P_Update <- true;
|
||||||
|
function Sq_L_Medal (x,y) {}
|
||||||
function Sq_SettingWindowCallBack (x,y) {}
|
function Sq_SettingWindowCallBack (x,y) {}
|
||||||
function Sq_BuffSwitchingCallBack (x,y) {}
|
function Sq_BuffSwitchingCallBack (x,y) {}
|
||||||
function Sq_SwitchingCallBack (x,y) {}
|
function Sq_SwitchingCallBack (x,y) {}
|
||||||
|
|
@ -72,6 +74,11 @@ function Sq_MessageWindowDraw (a,c) {}
|
||||||
function Sq_Get_Event_Pos (a) {return 1;}
|
function Sq_Get_Event_Pos (a) {return 1;}
|
||||||
function Sq_L_OtherPlayerInfo (x, y, Type, Value, ImgBuf) {local str = Value.tostring(); local lenght = LenheartTextClass.GetStringLength(str); L_sq_DrawImg(ImgBuf, x + 70 - lenght, y + 5); return Value;}
|
function Sq_L_OtherPlayerInfo (x, y, Type, Value, ImgBuf) {local str = Value.tostring(); local lenght = LenheartTextClass.GetStringLength(str); L_sq_DrawImg(ImgBuf, x + 70 - lenght, y + 5); return Value;}
|
||||||
function Sq_DrawMiniMapUI (a) {}
|
function Sq_DrawMiniMapUI (a) {}
|
||||||
|
function Sq_CompleteTask(a1,a2,a3){}
|
||||||
|
function L_drawMainCustomUI_All(){}
|
||||||
|
function L_MouseCallBack(a, b, c,d) {}
|
||||||
|
function L_DrawWindow_A() {}
|
||||||
|
function L_DrawWindow_B() {}
|
||||||
)";
|
)";
|
||||||
wchar_t* sfile = DNFTOOL::charTowchar_t((char*)BaseFile.c_str());
|
wchar_t* sfile = DNFTOOL::charTowchar_t((char*)BaseFile.c_str());
|
||||||
wchar_t* ss = DNFTOOL::charTowchar_t((char*)Base.c_str());
|
wchar_t* ss = DNFTOOL::charTowchar_t((char*)Base.c_str());
|
||||||
|
|
@ -111,7 +118,7 @@ uint32_t __cdecl LMySqPushString(uint32_t v, const wchar_t* s, uint32_t l)
|
||||||
|
|
||||||
//drawmain drawMainCustomUI_ATFighter(obj)
|
//drawmain drawMainCustomUI_ATFighter(obj)
|
||||||
//if (wcsstr(s, L"drawMainCustomUI_")) {
|
//if (wcsstr(s, L"drawMainCustomUI_")) {
|
||||||
// return LrealSqPushString(v, L"L_drawMainCustomUI_All", l);
|
// std::cout << 11 << std::endl;
|
||||||
//}
|
//}
|
||||||
//compilestring
|
//compilestring
|
||||||
|
|
||||||
|
|
@ -159,9 +166,6 @@ void _fastcall hook::H_Register_DrawCode(DWORD thisc, int Seat, int a3, int a4,
|
||||||
DNFTOOL::Wchar_tToString(GameStr, clone);
|
DNFTOOL::Wchar_tToString(GameStr, clone);
|
||||||
delete[]clone;
|
delete[]clone;
|
||||||
|
|
||||||
//if (GameStr.find("快捷键") != std::string::npos) {
|
|
||||||
// std::cout << 121231 << std::endl;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//他人信息描述HOOK
|
//他人信息描述HOOK
|
||||||
if (OtherPlayerInfoType != 0) {
|
if (OtherPlayerInfoType != 0) {
|
||||||
|
|
@ -216,6 +220,14 @@ void _fastcall hook::H_Register_DrawCode(DWORD thisc, int Seat, int a3, int a4,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+") == 6) {
|
||||||
|
if (GameStr.find("ch20.天帷巨兽") != std::string::npos)
|
||||||
|
{
|
||||||
|
wchar_t* nclone = L"超时空之战-团本区域";
|
||||||
|
return DrawCodeF(thisc, Seat, a3, a4, a5, (int)nclone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//if (GameStr.find("天界地区") != std::string::npos)
|
//if (GameStr.find("天界地区") != std::string::npos)
|
||||||
//{
|
//{
|
||||||
// std::cout << GameStr << std::endl;
|
// std::cout << GameStr << std::endl;
|
||||||
|
|
@ -1488,8 +1500,8 @@ typedef int(_fastcall _Get_Img)(int thisc, void*, int a2);
|
||||||
static _Get_Img* OldGet_Img;
|
static _Get_Img* OldGet_Img;
|
||||||
int _fastcall NewGet_Img(int thisc, void*, int a2) {
|
int _fastcall NewGet_Img(int thisc, void*, int a2) {
|
||||||
|
|
||||||
if (a2 == 6) {
|
if (a2 == 239) {
|
||||||
//std::cout << 12123123 << std::endl;
|
std::cout << 12123123 << std::endl;
|
||||||
}
|
}
|
||||||
return OldGet_Img(thisc, 0, a2);
|
return OldGet_Img(thisc, 0, a2);
|
||||||
}
|
}
|
||||||
|
|
@ -1506,9 +1518,16 @@ int _fastcall New11C0410(int* thisc, void*, int a2, wchar_t* a3)
|
||||||
//}
|
//}
|
||||||
|
|
||||||
char* OutPutText = DNFTOOL::wchar_tTochar(str);
|
char* OutPutText = DNFTOOL::wchar_tTochar(str);
|
||||||
|
static std::map<std::string, bool> UNN;
|
||||||
std::string B = OutPutText;
|
std::string B = OutPutText;
|
||||||
//std::cout << B << std::endl;
|
if(B.find(".img") != std::string::npos )
|
||||||
|
{
|
||||||
|
if (!UNN[B]) {
|
||||||
|
UNN[B] = true;
|
||||||
|
std::cout << B << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//if (B.find("extrafeature") != std::string::npos) {
|
//if (B.find("extrafeature") != std::string::npos) {
|
||||||
// std::cout << B << std::endl;
|
// std::cout << B << std::endl;
|
||||||
|
|
@ -1806,6 +1825,10 @@ void __declspec(naked)TestJmp3() {
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef DWORD(_fastcall _4C61F0)(DWORD thisc, DWORD Seat);
|
typedef DWORD(_fastcall _4C61F0)(DWORD thisc, DWORD Seat);
|
||||||
static _4C61F0* Old4C61F0;
|
static _4C61F0* Old4C61F0;
|
||||||
|
|
||||||
|
|
@ -1816,52 +1839,49 @@ extern std::vector<std::string> BaseData;
|
||||||
|
|
||||||
#include<fstream>
|
#include<fstream>
|
||||||
#include <dinput.h>
|
#include <dinput.h>
|
||||||
|
|
||||||
|
void outputWcharToFile(const wchar_t* str, const wchar_t* filename) {
|
||||||
|
std::wofstream file(filename);
|
||||||
|
if (file.is_open()) {
|
||||||
|
file << str;
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
std::wcerr << L"Error: Unable to open file " << filename << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Suxn() {
|
||||||
|
size_t Ds = BaseData.size();
|
||||||
|
|
||||||
|
for (size_t i = 0; i < Ds; i++)
|
||||||
|
{
|
||||||
|
std::string filename = "BaseData" + std::to_string(i);
|
||||||
|
std::string str = BaseData[i];
|
||||||
|
|
||||||
|
|
||||||
|
//std::cout << nutstr << std::endl;
|
||||||
|
wchar_t* sfile = DNFTOOL::charTowchar_t((char*)filename.c_str());
|
||||||
|
wchar_t* ss = DNFTOOL::charTowchar_t((char*)str.c_str());
|
||||||
|
|
||||||
|
//outputWcharToFile(ss, sfile);
|
||||||
|
//wprintf(L"Function:%s \n", ss);
|
||||||
|
//std::cout << i << std::endl;
|
||||||
|
uint32_t v = GetSqVm();
|
||||||
|
squirrel::SQdofileBuffer(v, sfile, ss);
|
||||||
|
}
|
||||||
|
|
||||||
|
BaseData.clear();
|
||||||
|
jiaoben = false;
|
||||||
|
}
|
||||||
|
|
||||||
//DrawMain HOOK
|
//DrawMain HOOK
|
||||||
DWORD _fastcall New4C61F0(DWORD thisc, DWORD Seat)
|
DWORD _fastcall New4C61F0(DWORD thisc, DWORD Seat)
|
||||||
{
|
{
|
||||||
static bool Init = false;
|
static bool Init = false;
|
||||||
|
|
||||||
if (BaseData.size() > 0 && jiaoben == true && DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+") == 1) {
|
if (BaseData.size() > 0 && jiaoben == true && DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+") == 1) {
|
||||||
|
Suxn();
|
||||||
|
|
||||||
|
|
||||||
size_t Ds = BaseData.size();
|
|
||||||
|
|
||||||
for (size_t i = 0; i < Ds; i++)
|
|
||||||
{
|
|
||||||
std::string filename = "BaseData" + std::to_string(i);
|
|
||||||
std::string str = BaseData[i];
|
|
||||||
|
|
||||||
str = str.substr(str.find("[") + 1, str.length() - 2);
|
|
||||||
|
|
||||||
std::vector<std::string> Data;
|
|
||||||
DNFTOOL::Split(str, Data, ", ");
|
|
||||||
size_t Ds = Data.size();
|
|
||||||
|
|
||||||
char* nutstr = new char[Ds + 1];
|
|
||||||
|
|
||||||
|
|
||||||
for (size_t s = 0; s < Ds; s++)
|
|
||||||
{
|
|
||||||
nutstr[s] = char(atoi(Data[s].c_str()));
|
|
||||||
}
|
|
||||||
nutstr[Ds] = '\0';
|
|
||||||
|
|
||||||
int skey[] = Skey;//定义解密数组
|
|
||||||
Cutecode(nutstr, skey);//解密
|
|
||||||
|
|
||||||
//std::cout << nutstr << std::endl;
|
|
||||||
wchar_t* sfile = DNFTOOL::charTowchar_t((char*)filename.c_str());
|
|
||||||
wchar_t* ss = DNFTOOL::charTowchar_t((char*)nutstr);
|
|
||||||
|
|
||||||
//wprintf(L"Function:%s \n", sfile);
|
|
||||||
//std::cout << i << std::endl;
|
|
||||||
uint32_t v = GetSqVm();
|
|
||||||
squirrel::SQdofileBuffer(v, sfile, ss);
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseData.clear();
|
|
||||||
jiaoben = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1876,6 +1896,13 @@ DWORD _fastcall New4C61F0(DWORD thisc, DWORD Seat)
|
||||||
SQPushInt(v, 111);
|
SQPushInt(v, 111);
|
||||||
SQ_Call(v, 2, 0, 1);
|
SQ_Call(v, 2, 0, 1);
|
||||||
SQPop(v, 2);
|
SQPop(v, 2);
|
||||||
|
|
||||||
|
SQPushRootTable(v);
|
||||||
|
SQPushString(v, L"L_DrawWindow_A", -1);
|
||||||
|
SQ_Get(v, -2);
|
||||||
|
SQPushRootTable(v);
|
||||||
|
SQ_Call(v, 1, 0, 1);
|
||||||
|
SQPop(v, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2172,6 +2199,188 @@ int _fastcall New1030C30(int a1, int a2, BYTE* a3)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
typedef int(_fastcall _8EE1E0)(DWORD thisc,DWORD Seat, int a2, char a3,char a4);
|
||||||
|
static _8EE1E0* Old8EE1E0;
|
||||||
|
int _fastcall New8EE1E0(DWORD thisc, DWORD Seat, int a2, char a3, char a4)
|
||||||
|
{
|
||||||
|
int ret = Old8EE1E0(thisc, Seat,a2, a3,a4);
|
||||||
|
|
||||||
|
uint32_t v = GetSqVm();
|
||||||
|
SQPushRootTable(v);
|
||||||
|
SQPushString(v, L"Sq_CompleteTask", -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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef int(_fastcall _674030)(wchar_t* thisc, DWORD Seat, int a2, int a3);
|
||||||
|
static _674030* Old674030;
|
||||||
|
int _fastcall New674030(wchar_t* thisc, DWORD Seat, int a2, int a3)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
wchar_t* strbuffer = (wchar_t*)a2;
|
||||||
|
wchar_t* clone = new wchar_t[wcslen(strbuffer) + 2];
|
||||||
|
wcscpy(clone, strbuffer);
|
||||||
|
|
||||||
|
std::string GameStr;
|
||||||
|
DNFTOOL::Wchar_tToString(GameStr, clone);
|
||||||
|
delete[]clone;
|
||||||
|
|
||||||
|
|
||||||
|
int ret = Old674030(thisc, Seat, a2, a3);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (GameStr.find("drawMainCustomUI_") != std::string::npos) {
|
||||||
|
uint32_t v = GetSqVm();
|
||||||
|
SQPushRootTable(v);
|
||||||
|
SQPushString(v, L"L_drawMainCustomUI_All", -1);
|
||||||
|
SQ_Get(v, -2);
|
||||||
|
SQPushRootTable(v);
|
||||||
|
SQ_Call(v, 1, 0, 1);
|
||||||
|
SQPop(v, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int AByteLittleToInt(unsigned char* Count)
|
||||||
|
{
|
||||||
|
int int1 = Count[0] & 0xff;
|
||||||
|
int int2 = (Count[1] & 0xff) << 8;
|
||||||
|
int int3 = (Count[2] & 0xff) << 16;
|
||||||
|
int int4 = (Count[3] & 0xff) << 24;
|
||||||
|
|
||||||
|
return int1 | int2 | int3 | int4;
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef int(_fastcall _6FE1D0)(DWORD* thisc, DWORD Seat, int a2, int a3);
|
||||||
|
static _6FE1D0* Old6FE1D0;
|
||||||
|
int _fastcall New6FE1D0(DWORD* thisc, DWORD Seat, int a2, int a3)
|
||||||
|
{
|
||||||
|
|
||||||
|
std::cout << "类型为: " << (int)*(unsigned __int16*)(a2 + 1) << std::endl;
|
||||||
|
if (a2) {
|
||||||
|
|
||||||
|
|
||||||
|
//std::cout << "地址为:" << std::hex << a2 << std::endl;
|
||||||
|
|
||||||
|
// 假设你有一个地址的指针,比如:
|
||||||
|
char* address = (char*)a2; // 假设地址是0x1234
|
||||||
|
|
||||||
|
// 读取两个字节并转换为int
|
||||||
|
unsigned char byte1 = address[0];
|
||||||
|
unsigned char byte2 = address[1];
|
||||||
|
|
||||||
|
// 输出转换后的小端序int
|
||||||
|
//std::cout << "转换后的小端序int第一位为:" << (int)byte1 << std::endl;
|
||||||
|
//std::cout << "转换后的小端序int第二位为:" << (int)byte2 << std::endl << std::endl << std::endl;
|
||||||
|
|
||||||
|
if ((int)byte2 == 23) {
|
||||||
|
for (size_t i = 0; i < 0x1f; i++)
|
||||||
|
{
|
||||||
|
std::cout << (int)address[i] << " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << std::endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//std::cout << (*(BYTE*)(a2)) << std::endl;
|
||||||
|
//std::cout << (*(BYTE*)(a2+1)) << std::endl;
|
||||||
|
//std::cout << (*(BYTE*)(a2+2)) << std::endl;
|
||||||
|
//std::cout << (*(BYTE*)(a2+3)) << std::endl;
|
||||||
|
|
||||||
|
int ret = Old6FE1D0(thisc, 0, a2, a3);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//鼠标事件
|
||||||
|
typedef void( _11BDC90)(int a1, unsigned int a2, int a3);
|
||||||
|
static _11BDC90* Old11BDC90;
|
||||||
|
void New11BDC90(int a1, unsigned int a2, int a3) {
|
||||||
|
|
||||||
|
static bool Init = false;
|
||||||
|
if (DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+") == 0) {
|
||||||
|
if (!Init)
|
||||||
|
{
|
||||||
|
Init = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Init) {
|
||||||
|
int X = *(int*)0x1B4686C;
|
||||||
|
int Y = *(int*)0x1B46870;
|
||||||
|
if ((X | Y) >= 0) {
|
||||||
|
uint32_t v = GetSqVm();
|
||||||
|
DWORD VmTop = SQGetTop(v);
|
||||||
|
|
||||||
|
SQPushRootTable(v);
|
||||||
|
SQPushString(v, L"L_MouseCallBack", -1);
|
||||||
|
SQ_Get(v, -2);
|
||||||
|
SQPushRootTable(v);
|
||||||
|
SQPushInt(v, a1);
|
||||||
|
SQPushInt(v, a2);
|
||||||
|
sq_pushinteger((HSQUIRRELVM)v, X);
|
||||||
|
sq_pushinteger((HSQUIRRELVM)v, Y);
|
||||||
|
SQ_Call(v, 5, 0, 1);
|
||||||
|
SQPop(v, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Old11BDC90(a1, a2, a3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef int (_fastcall _1183720)(DWORD thisc, DWORD Seat,int a2);
|
||||||
|
static _1183720* Old1183720;
|
||||||
|
int _fastcall New1183720(DWORD thisc, DWORD Seat, int a2)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
int ret = Old1183720(thisc, 0,a2);
|
||||||
|
|
||||||
|
static bool Init = false;
|
||||||
|
if (DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+") == 0) {
|
||||||
|
if (!Init)
|
||||||
|
{
|
||||||
|
Init = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Init) {
|
||||||
|
if (a2 == 0x1a500f0) {
|
||||||
|
uint32_t v = GetSqVm();
|
||||||
|
|
||||||
|
SQPushRootTable(v);
|
||||||
|
SQPushString(v, L"L_DrawWindow_B", -1);
|
||||||
|
SQ_Get(v, -2);
|
||||||
|
SQPushRootTable(v);
|
||||||
|
SQ_Call(v, 1, 0, 1);
|
||||||
|
SQPop(v, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "inlinehook.h"
|
#include "inlinehook.h"
|
||||||
int hook::RegisterHook()
|
int hook::RegisterHook()
|
||||||
|
|
@ -2183,6 +2392,9 @@ int hook::RegisterHook()
|
||||||
inlinehook MMM(0x011BDE05, (int)&MouseWheelUp);
|
inlinehook MMM(0x011BDE05, (int)&MouseWheelUp);
|
||||||
MMM.Motify_address();
|
MMM.Motify_address();
|
||||||
|
|
||||||
|
//inlinehook QQQ(0x049DEDB, (int)&TestDDraw);
|
||||||
|
//QQQ.Motify_address();
|
||||||
|
|
||||||
|
|
||||||
//个人信息
|
//个人信息
|
||||||
//inlinehook WWW(0xEDE6C5, (int)&PlayerInfo);
|
//inlinehook WWW(0xEDE6C5, (int)&PlayerInfo);
|
||||||
|
|
@ -2195,10 +2407,30 @@ int hook::RegisterHook()
|
||||||
|
|
||||||
MH_Initialize();
|
MH_Initialize();
|
||||||
|
|
||||||
|
|
||||||
|
//窗口绘制HOOK
|
||||||
|
MH_CreateHook((void*)0x1183720, &New1183720, reinterpret_cast<void**>(&Old1183720));
|
||||||
|
MH_EnableHook((void*)0x1183720);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//鼠标事件HOOK
|
||||||
|
MH_CreateHook((void*)0x11BDC90, &New11BDC90, reinterpret_cast<void**>(&Old11BDC90));
|
||||||
|
MH_EnableHook((void*)0x11BDC90);
|
||||||
|
|
||||||
|
|
||||||
//N键大地图
|
//N键大地图
|
||||||
MH_CreateHook((void*)0x1030C30, &New1030C30, reinterpret_cast<void**>(&Old1030C30));
|
MH_CreateHook((void*)0x1030C30, &New1030C30, reinterpret_cast<void**>(&Old1030C30));
|
||||||
MH_EnableHook((void*)0x1030C30);
|
MH_EnableHook((void*)0x1030C30);
|
||||||
|
|
||||||
|
//完成任务HOOK
|
||||||
|
MH_CreateHook((void*)0x8EE1E0, &New8EE1E0, reinterpret_cast<void**>(&Old8EE1E0));
|
||||||
|
MH_EnableHook((void*)0x8EE1E0);
|
||||||
|
|
||||||
|
//官方的组合NutHook
|
||||||
|
MH_CreateHook((void*)0x674030, &New674030, reinterpret_cast<void**>(&Old674030));
|
||||||
|
MH_EnableHook((void*)0x674030);
|
||||||
|
|
||||||
//MH_CreateHook((void*)0x909D70, &New909D70, reinterpret_cast<void**>(&Old909D70));
|
//MH_CreateHook((void*)0x909D70, &New909D70, reinterpret_cast<void**>(&Old909D70));
|
||||||
//MH_EnableHook((void*)0x909D70);
|
//MH_EnableHook((void*)0x909D70);
|
||||||
|
|
||||||
|
|
@ -2231,7 +2463,6 @@ int hook::RegisterHook()
|
||||||
MH_CreateHook((void*)0x4C61F0, &New4C61F0, reinterpret_cast<void**>(&Old4C61F0));
|
MH_CreateHook((void*)0x4C61F0, &New4C61F0, reinterpret_cast<void**>(&Old4C61F0));
|
||||||
MH_EnableHook((void*)0x4C61F0);
|
MH_EnableHook((void*)0x4C61F0);
|
||||||
|
|
||||||
|
|
||||||
#ifdef FONT_BANK_SYSTEM
|
#ifdef FONT_BANK_SYSTEM
|
||||||
//伤害字体 HOOK
|
//伤害字体 HOOK
|
||||||
MH_CreateHook((void*)0x7EEED0, &New7EEED0, reinterpret_cast<void**>(&Old7EEED0));
|
MH_CreateHook((void*)0x7EEED0, &New7EEED0, reinterpret_cast<void**>(&Old7EEED0));
|
||||||
|
|
@ -2258,6 +2489,8 @@ int hook::RegisterHook()
|
||||||
//Hook收包
|
//Hook收包
|
||||||
MH_CreateHook((void*)INIT_PACK_ADDRESS, &H_Register_Pack, reinterpret_cast<void**>(&Lpfn_Init));
|
MH_CreateHook((void*)INIT_PACK_ADDRESS, &H_Register_Pack, reinterpret_cast<void**>(&Lpfn_Init));
|
||||||
MH_EnableHook((void*)INIT_PACK_ADDRESS);
|
MH_EnableHook((void*)INIT_PACK_ADDRESS);
|
||||||
|
|
||||||
|
|
||||||
//HookNut函数注册
|
//HookNut函数注册
|
||||||
MH_CreateHook((void*)INIT_NUT_ADDRESS, &H_Register_Nut, reinterpret_cast<void**>(&MLnewclosure));
|
MH_CreateHook((void*)INIT_NUT_ADDRESS, &H_Register_Nut, reinterpret_cast<void**>(&MLnewclosure));
|
||||||
MH_EnableHook((void*)INIT_NUT_ADDRESS);
|
MH_EnableHook((void*)INIT_NUT_ADDRESS);
|
||||||
|
|
@ -2409,5 +2642,11 @@ int hook::RegisterHook()
|
||||||
// HOOK exe 调用文本进 松鼠虚拟机
|
// HOOK exe 调用文本进 松鼠虚拟机
|
||||||
//MH_CreateHook((void*)0x135B2C0, &NewSQ_Compilebuffer, reinterpret_cast<void**>(&OldSQ_Compilebuffer));
|
//MH_CreateHook((void*)0x135B2C0, &NewSQ_Compilebuffer, reinterpret_cast<void**>(&OldSQ_Compilebuffer));
|
||||||
//MH_EnableHook((void*)0x135B2C0);
|
//MH_EnableHook((void*)0x135B2C0);
|
||||||
|
|
||||||
|
//收包HOOK
|
||||||
|
//MH_CreateHook((void*)0x06FE1D0, &New6FE1D0, reinterpret_cast<void**>(&Old6FE1D0));
|
||||||
|
//MH_EnableHook((void*)0x06FE1D0);
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
19
test/pch.h
19
test/pch.h
|
|
@ -11,7 +11,7 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include "include/squirrel.h"
|
||||||
|
|
||||||
|
|
||||||
#include "rapidjson/document.h"
|
#include "rapidjson/document.h"
|
||||||
|
|
@ -26,6 +26,11 @@
|
||||||
|
|
||||||
#include "Helpers.h"
|
#include "Helpers.h"
|
||||||
|
|
||||||
|
//#define CPPHTTPLIB_OPENSSL_SUPPORT
|
||||||
|
//#include "framework.h"
|
||||||
|
#include "RSAC.h"
|
||||||
|
#include "BASE64.h"
|
||||||
|
#include "httplib.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -60,7 +65,7 @@
|
||||||
#define MOUSE_SWITCH "鼠标回调 开启"
|
#define MOUSE_SWITCH "鼠标回调 开启"
|
||||||
#define SENDPACKHOOK "发包Hook 开启"
|
#define SENDPACKHOOK "发包Hook 开启"
|
||||||
#define COPY_MESSAGE "消息框黏贴HOOK 开启"
|
#define COPY_MESSAGE "消息框黏贴HOOK 开启"
|
||||||
#define SENDPACKHOOK_EX "发包HookEX 开启"
|
//#define SENDPACKHOOK_EX "发包HookEX 开启"
|
||||||
|
|
||||||
|
|
||||||
#define CHRATRBT_SWITCH "人物或装备属性 查看 修改 开启"
|
#define CHRATRBT_SWITCH "人物或装备属性 查看 修改 开启"
|
||||||
|
|
@ -106,18 +111,10 @@
|
||||||
#define CODE_STL "字符_STL 开启"
|
#define CODE_STL "字符_STL 开启"
|
||||||
|
|
||||||
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
|
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
|
||||||
|
#define SHIWORD(l) ((short)((long)(l) >> 16))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined LOCALHOSTS_SWITCH
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define CPPHTTPLIB_OPENSSL_SUPPORT
|
|
||||||
//#include "framework.h"
|
|
||||||
#include "RSAC.h"
|
|
||||||
#include "BASE64.h"
|
|
||||||
#include "httplib.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined GOLD_LIGHT
|
#if defined GOLD_LIGHT
|
||||||
# define Skey {5,1,9,1,2}
|
# define Skey {5,1,9,1,2}
|
||||||
|
|
|
||||||
|
|
@ -344,6 +344,7 @@ static NNoticeTCall _ANoticeTcall = (NNoticeTCall)0xE6E070;
|
||||||
//打开特殊窗口
|
//打开特殊窗口
|
||||||
typedef void(_fastcall _Open_ExWindow)(int thisc, void*, int a2, char a3, char a4);
|
typedef void(_fastcall _Open_ExWindow)(int thisc, void*, int a2, char a3, char a4);
|
||||||
static _Open_ExWindow* Open_ExWindow = (_Open_ExWindow*)0xE718A0;
|
static _Open_ExWindow* Open_ExWindow = (_Open_ExWindow*)0xE718A0;
|
||||||
|
static _Open_ExWindow* Open_ExWindow2 = (_Open_ExWindow*)0xE6E070;
|
||||||
int sq_Open_ExWindow(uint32_t v) {
|
int sq_Open_ExWindow(uint32_t v) {
|
||||||
int a1, a2, a3, a4;
|
int a1, a2, a3, a4;
|
||||||
|
|
||||||
|
|
@ -355,7 +356,17 @@ int sq_Open_ExWindow(uint32_t v) {
|
||||||
Open_ExWindow(a1,0,a2,a3,a4);
|
Open_ExWindow(a1,0,a2,a3,a4);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
int sq_Open_ExWindow2(uint32_t v) {
|
||||||
|
int a1, a2, a3, a4;
|
||||||
|
|
||||||
|
SQGetInt(v, 2, &a1);
|
||||||
|
SQGetInt(v, 3, &a2);
|
||||||
|
SQGetInt(v, 4, &a3);
|
||||||
|
SQGetInt(v, 5, &a4);
|
||||||
|
|
||||||
|
Open_ExWindow2(a1, 0, a2, a3, a4);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef int(_cdecl _sub7AAB60)(int a1);
|
typedef int(_cdecl _sub7AAB60)(int a1);
|
||||||
|
|
@ -494,81 +505,231 @@ int sq_Select_MiniMap_Index(uint32_t v) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct InputWindowInfoS {
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
std::string str;
|
||||||
|
};
|
||||||
|
LRESULT CALLBACK LenheartCode(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
HDC hdc;
|
||||||
|
PAINTSTRUCT ps;
|
||||||
|
RECT rect;
|
||||||
|
static int mX, mY;
|
||||||
|
static HWND hwndButton;
|
||||||
|
static HWND hwndEditbox;
|
||||||
|
std::string strXy;
|
||||||
|
const int IDcmdButton = 1;
|
||||||
|
const int IDeditBox = 2;
|
||||||
|
static InputWindowInfoS* WInfo;
|
||||||
|
|
||||||
|
|
||||||
|
switch (message) {
|
||||||
|
case WM_CREATE:
|
||||||
|
{
|
||||||
|
RECT rect;
|
||||||
|
GetWindowRect(hwnd, &rect); // 获取窗口的矩形区域
|
||||||
|
|
||||||
|
// 获取传递的参数
|
||||||
|
CREATESTRUCT* pCreate = (CREATESTRUCT*)lParam;
|
||||||
|
WInfo = (InputWindowInfoS*)pCreate->lpCreateParams;
|
||||||
|
|
||||||
|
hwndEditbox = CreateWindowA("edit", NULL,
|
||||||
|
WS_CHILD | WS_VISIBLE | WS_BORDER | ES_MULTILINE,
|
||||||
|
0, 0,
|
||||||
|
WInfo->width, WInfo->height,
|
||||||
|
hwnd, (HMENU)IDeditBox, NULL, NULL);
|
||||||
|
|
||||||
|
ShowWindow(hwndEditbox, SW_SHOW);
|
||||||
|
UpdateWindow(hwndEditbox);
|
||||||
|
|
||||||
|
|
||||||
|
HFONT hFont = CreateFont(13.5, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
|
||||||
|
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, TEXT("Fonts\\msjh.ttf"));
|
||||||
|
SendMessage(hwndEditbox, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
|
||||||
|
SetForegroundWindow(hwndEditbox);
|
||||||
|
|
||||||
|
//如果有字先写进去
|
||||||
|
if (WInfo->str.length() > 0)SetWindowTextA(hwndEditbox, WInfo->str.c_str());
|
||||||
|
// 获取当前文本长度
|
||||||
|
int length = GetWindowTextLengthA(hwndEditbox);
|
||||||
|
|
||||||
|
// 将光标移动到文本末尾
|
||||||
|
SendMessage(hwndEditbox, EM_SETSEL, length, length);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
case WM_CTLCOLOREDIT:
|
||||||
|
{
|
||||||
|
HDC ahdc = (HDC)wParam;
|
||||||
|
SetTextColor(ahdc, RGB(0, 0, 0));
|
||||||
|
//SetTextColor(ahdc, RGB(255, 255, 255));
|
||||||
|
SetBkMode(ahdc, TRANSPARENT); // 设置背景透明
|
||||||
|
return (INT_PTR)GetStockObject(NULL_BRUSH); // 返回空画刷
|
||||||
|
//return 0; //返回句柄画刷时,背景颜色变为对应的背景颜色
|
||||||
|
}
|
||||||
|
case WM_PAINT:
|
||||||
|
{
|
||||||
|
hdc = BeginPaint(hwnd, &ps);
|
||||||
|
EndPaint(hwnd, &ps);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
case WM_SIZE:
|
||||||
|
{
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
case WM_COMMAND:
|
||||||
|
switch (LOWORD(wParam)) {
|
||||||
|
case 0:
|
||||||
|
PostQuitMessage(0);
|
||||||
|
break;
|
||||||
|
case IDeditBox:
|
||||||
|
if (HIWORD(wParam) == EN_CHANGE) {
|
||||||
|
char strbuf[256];
|
||||||
|
// 编辑框内容发生变化
|
||||||
|
GetWindowTextA(hwndEditbox, strbuf, 256);
|
||||||
|
//std::cout << strbuf << std::endl;
|
||||||
|
WInfo->str = strbuf;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (HIWORD(wParam) == EN_SETFOCUS) {
|
||||||
|
}
|
||||||
|
else if (HIWORD(wParam) == EN_KILLFOCUS) {
|
||||||
|
DestroyWindow(hwnd); //销毁窗口
|
||||||
|
WInfo->str = "LenheartNULL";
|
||||||
|
//CREATESTRUCT* pCreate = (CREATESTRUCT*)lParam;
|
||||||
|
//delete[](InputWindowInfoS*)pCreate->lpCreateParams;
|
||||||
|
//pCreate->lpCreateParams = NULL;
|
||||||
|
//exit(0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
case WM_MOUSEACTIVATE:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_CLOSE:
|
||||||
|
DestroyWindow(hwnd); //销毁窗口
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
case WM_DESTROY:
|
||||||
|
PostQuitMessage(0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return DefWindowProc(hwnd, message, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LenheartWindows(LPVOID lpParam) {
|
||||||
|
|
||||||
|
HWND DNFW = FindWindow(L"DNF Taiwan", L"DNF Taiwan"); // 替换"Window Title"为你要查找的窗口标题
|
||||||
|
RECT rect;
|
||||||
|
GetWindowRect(DNFW, &rect); // 获取窗口的矩形区域
|
||||||
|
|
||||||
|
InputWindowInfoS* WInfo = (InputWindowInfoS*)lpParam;
|
||||||
|
|
||||||
|
const wchar_t* className = L"myInputBoxClass";
|
||||||
|
HINSTANCE hInstance = GetModuleHandle(NULL);
|
||||||
|
|
||||||
|
WNDCLASS wc = {};
|
||||||
|
wc.lpfnWndProc = LenheartCode;
|
||||||
|
wc.hInstance = hInstance;
|
||||||
|
wc.lpszClassName = className;
|
||||||
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
|
wc.hbrBackground = CreateSolidBrush(RGB(0, 0, 0));
|
||||||
|
//wc.hbrBackground = NULL;
|
||||||
|
|
||||||
|
RegisterClass(&wc);
|
||||||
|
|
||||||
|
// 创建输入框
|
||||||
|
HWND hwnd = CreateWindowEx(
|
||||||
|
0, className, L"Input Box",
|
||||||
|
WS_POPUP | WS_EX_TOOLWINDOW,
|
||||||
|
rect.left + WInfo->x, rect.top + WInfo->y, WInfo->width, WInfo->height,
|
||||||
|
NULL, NULL, hInstance, lpParam);
|
||||||
|
|
||||||
|
|
||||||
|
SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED | WS_EX_TOOLWINDOW);
|
||||||
|
SetLayeredWindowAttributes(hwnd, 0, 0, LWA_ALPHA);
|
||||||
|
|
||||||
|
|
||||||
|
ShowWindow(hwnd, SW_SHOW);
|
||||||
|
|
||||||
|
MSG msg;
|
||||||
|
while (GetMessage(&msg, NULL, 0, 0))
|
||||||
|
{
|
||||||
|
TranslateMessage(&msg);
|
||||||
|
DispatchMessage(&msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int sq_NewInputBox(uint32_t v)
|
||||||
|
{
|
||||||
|
InputWindowInfoS* WInfo = new InputWindowInfoS();
|
||||||
|
SQGetInt(v, 2, &WInfo->x);
|
||||||
|
SQGetInt(v, 3, &WInfo->y);
|
||||||
|
SQGetInt(v, 4, &WInfo->width);
|
||||||
|
SQGetInt(v, 5, &WInfo->height);
|
||||||
|
wchar_t* Str;
|
||||||
|
SQGetString(v, 6, &Str);
|
||||||
|
char* OutPutText = DNFTOOL::SquirrelU2W(Str);
|
||||||
|
std::string RealStr = OutPutText;
|
||||||
|
delete[]OutPutText;
|
||||||
|
WInfo->str = RealStr;
|
||||||
|
|
||||||
|
|
||||||
|
DWORD threadID3;
|
||||||
|
HANDLE Thand3 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)LenheartWindows, WInfo, 0, &threadID3);
|
||||||
|
|
||||||
|
SQPushInt(v, (int)WInfo);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int sq_GetInputBoxStr(uint32_t v)
|
||||||
|
{
|
||||||
|
int Addr;
|
||||||
|
SQGetInt(v, 2, &Addr);
|
||||||
|
InputWindowInfoS* WInfo = (InputWindowInfoS*)Addr;
|
||||||
|
|
||||||
|
std::string str = WInfo->str;
|
||||||
|
char* ss = GBKTOUTF8(str);
|
||||||
|
//wchar_t* name = DNFTOOL::charTowchar_t((char*)Buf.c_str());
|
||||||
|
|
||||||
|
wchar_t* aa = DNFTOOL::charTowchar_t(ss);
|
||||||
|
SQPushString(v, aa, -1);
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int sq_SetInputBoxStr(uint32_t v)
|
||||||
|
{
|
||||||
|
int Addr;
|
||||||
|
SQGetInt(v, 2, &Addr);
|
||||||
|
wchar_t* Str;
|
||||||
|
SQGetString(v, 3, &Str);
|
||||||
|
char* OutPutText = DNFTOOL::SquirrelU2W(Str);
|
||||||
|
std::string RealStr = OutPutText;
|
||||||
|
delete[]OutPutText;
|
||||||
|
|
||||||
|
InputWindowInfoS* WInfo = (InputWindowInfoS*)Addr;
|
||||||
|
WInfo->str = RealStr;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int squirrel::sq_Test(uint32_t v)
|
int squirrel::sq_Test(uint32_t v)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
//int ReIndex;
|
|
||||||
//SQGetInt(v, 2, &ReIndex);
|
|
||||||
|
|
||||||
|
|
||||||
//static int dnf_103E030 = 0x103E030;
|
|
||||||
//static int dnf_287FA88 = 0x287FA88;
|
|
||||||
//static int dnf_103DCD0 = 0x103DCD0;
|
|
||||||
//static int dnf_103B240 = 0x103B240;
|
|
||||||
//static int dnf_2878D95 = 0x2878D95;
|
|
||||||
//static int dnf_1194FC0 = 0x1194FC0;
|
|
||||||
//static int dnf_410230 = 0x410230;
|
|
||||||
//static int dnf_102F4D0 = 0x102F4D0;
|
|
||||||
|
|
||||||
//_asm
|
|
||||||
//{
|
|
||||||
//
|
|
||||||
// mov ecx, dword ptr ds :[0x1A5FB20]
|
|
||||||
// mov esi, dword ptr ds :[ecx+0x42DC]
|
|
||||||
// push ReIndex
|
|
||||||
// call dnf_103E030
|
|
||||||
// mov ecx,eax
|
|
||||||
// call dnf_287FA88
|
|
||||||
// push ReIndex
|
|
||||||
// call dnf_103E030
|
|
||||||
// mov ecx,eax
|
|
||||||
// call dnf_103DCD0
|
|
||||||
// mov ecx,eax
|
|
||||||
// mov dword ptr ds:[esi+0x24],eax
|
|
||||||
// call dnf_103B240
|
|
||||||
// mov ecx,dword ptr ds:[esi+0x24]
|
|
||||||
// call dnf_2878D95
|
|
||||||
// push 0x1556138
|
|
||||||
// call dnf_1194FC0
|
|
||||||
// mov ecx,eax
|
|
||||||
// add esp,4
|
|
||||||
// lea edi,dword ptr ds:[ecx+2]
|
|
||||||
// dnf_1031651:
|
|
||||||
// mov dx,word ptr ds:[ecx]
|
|
||||||
// add ecx,2
|
|
||||||
// test dx,dx
|
|
||||||
// jne dnf_1031651
|
|
||||||
// sub ecx,edi
|
|
||||||
// sar ecx,1
|
|
||||||
// push ecx
|
|
||||||
// push eax
|
|
||||||
// lea ecx,dword ptr ds:[esi+0x144]
|
|
||||||
// call dnf_410230
|
|
||||||
// mov ecx,esi
|
|
||||||
// mov dword ptr ds:[esi+0x28],14
|
|
||||||
// call dnf_102F4D0
|
|
||||||
//}
|
|
||||||
//int ObjectAddress;
|
|
||||||
//int SkillId;
|
|
||||||
//SQGetInt(v, 2, &ObjectAddress);
|
|
||||||
//SQGetInt(v, 3, &SkillId);
|
|
||||||
//Test(ObjectAddress, 0, SkillId);
|
|
||||||
|
|
||||||
//TestB(ObjectAddress, 0, SkillId);
|
|
||||||
|
|
||||||
//std::cout << ret << std::endl;
|
|
||||||
|
|
||||||
int objaddress;
|
|
||||||
|
|
||||||
int Key_Value;
|
|
||||||
SQGetInt(v, 2, &objaddress);
|
|
||||||
SQGetInt(v, 3, &Key_Value);
|
|
||||||
|
|
||||||
Test(objaddress,0, Key_Value);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -870,23 +1031,6 @@ int sq_GetStringDrawLength(uint32_t v) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char* GBKTOUTF8(std::string& strGBK)//转码 GBK编码转成UTF8编码
|
|
||||||
{
|
|
||||||
int len = MultiByteToWideChar(CP_ACP, 0, strGBK.c_str(), -1, NULL, 0);
|
|
||||||
wchar_t* wszUtf8 = new wchar_t[len];
|
|
||||||
memset(wszUtf8, 0, len);
|
|
||||||
MultiByteToWideChar(CP_ACP, 0, strGBK.c_str(), -1, wszUtf8, len);
|
|
||||||
len = WideCharToMultiByte(CP_UTF8, 0, wszUtf8, -1, NULL, 0, NULL, NULL);
|
|
||||||
char* szUtf8 = new char[len + 1];
|
|
||||||
memset(szUtf8, 0, len + 1);
|
|
||||||
WideCharToMultiByte(CP_UTF8, 0, wszUtf8, -1, szUtf8, len, NULL, NULL);
|
|
||||||
strGBK = szUtf8;
|
|
||||||
delete[] szUtf8;
|
|
||||||
delete[] wszUtf8;
|
|
||||||
return (char*)strGBK.c_str();
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "include/squirrel.h"
|
|
||||||
int sq_GetStringDrawArray(uint32_t v) {
|
int sq_GetStringDrawArray(uint32_t v) {
|
||||||
|
|
||||||
wchar_t* Str;
|
wchar_t* Str;
|
||||||
|
|
@ -1175,6 +1319,12 @@ int sq_DrawButton(uint32_t v)
|
||||||
SQGetString(v, 5, &File);
|
SQGetString(v, 5, &File);
|
||||||
int StartIdx;
|
int StartIdx;
|
||||||
SQGetInt(v, 6, &StartIdx);
|
SQGetInt(v, 6, &StartIdx);
|
||||||
|
//填充宽度
|
||||||
|
int FillWidth;
|
||||||
|
SQGetInt(v, 7, &FillWidth);
|
||||||
|
//首节宽度
|
||||||
|
int FirstWidth;
|
||||||
|
SQGetInt(v, 8, &FirstWidth);
|
||||||
|
|
||||||
int widthCount = round(WindowWidth / 2);
|
int widthCount = round(WindowWidth / 2);
|
||||||
|
|
||||||
|
|
@ -1184,15 +1334,13 @@ int sq_DrawButton(uint32_t v)
|
||||||
int rightFrame = Get_Img(npkbuf, 0, 2 + StartIdx);
|
int rightFrame = Get_Img(npkbuf, 0, 2 + StartIdx);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Draw_Img(*(int*)0x1B45B94, 0, X, Y, leftFrame);
|
Draw_Img(*(int*)0x1B45B94, 0, X, Y, leftFrame);
|
||||||
|
|
||||||
for (int i = 0; i < widthCount; i++) {
|
for (int i = 0; i < widthCount; i++) {
|
||||||
Draw_Img(*(int*)0x1B45B94, 0, X + 28 + 2 * i, Y, CenterFrame);
|
Draw_Img(*(int*)0x1B45B94, 0, X + FirstWidth + FillWidth * i, Y, CenterFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw_Img(*(int*)0x1B45B94, 0, X + 28 + 2 * widthCount, Y, rightFrame);
|
Draw_Img(*(int*)0x1B45B94, 0, X + FirstWidth + FillWidth * widthCount, Y, rightFrame);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -1362,6 +1510,7 @@ std::string EncodeTABLE(HSQUIRRELVM v,std::string Jso) {
|
||||||
std::string str = OutPutText;
|
std::string str = OutPutText;
|
||||||
delete[]OutPutText;
|
delete[]OutPutText;
|
||||||
|
|
||||||
|
|
||||||
Jso += "\"";
|
Jso += "\"";
|
||||||
Jso += str;
|
Jso += str;
|
||||||
Jso += "\"";
|
Jso += "\"";
|
||||||
|
|
@ -1452,6 +1601,20 @@ int EncondeJson(uint32_t v) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int sq_IsKeyDown(uint32_t v) {
|
||||||
|
|
||||||
|
int KeyCode;
|
||||||
|
SQGetInt(v, 2, &KeyCode);
|
||||||
|
|
||||||
|
if (KEY_DOWN(KeyCode)) {
|
||||||
|
SQPushBool(v, true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SQPushBool(v, false);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//加载IMG帧
|
//加载IMG帧
|
||||||
//preloadnpk(*(int*)0x1b4684c,img,0)
|
//preloadnpk(*(int*)0x1b4684c,img,0)
|
||||||
|
|
@ -2140,14 +2303,54 @@ int squirrel::LReadAddress(uint32_t v)
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
//读内存
|
||||||
|
int LReadAddressB(uint32_t v)
|
||||||
|
{
|
||||||
|
//内存地址 int型
|
||||||
|
int Address;
|
||||||
|
|
||||||
|
//获取参数个数
|
||||||
|
int ParameterNum = SQGetTop(v);
|
||||||
|
//1个参数时
|
||||||
|
if (ParameterNum == 2)
|
||||||
|
{
|
||||||
|
//获取地址
|
||||||
|
SQGetInt(v, 2, &Address);
|
||||||
|
int Value = *(BYTE*)Address;
|
||||||
|
SQPushInt(v, Value);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (ParameterNum == 3)
|
||||||
|
{
|
||||||
|
////地址
|
||||||
|
//int Address;
|
||||||
|
////偏移
|
||||||
|
//wchar_t* offset;
|
||||||
|
|
||||||
|
//SQGetInt(v, 2, &Address);
|
||||||
|
//SQGetString(v, 3, &offset);
|
||||||
|
|
||||||
|
//int Value = DNFTOOL::GetHook(Address, DNFTOOL::wchar_tTochar(offset));
|
||||||
|
//SQPushInt(v, Value);
|
||||||
|
std::cout << "未完成" << std::endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SQPushBool(v, false);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
//写内存
|
//写内存
|
||||||
int LWriteAddressB(uint32_t v)
|
int LWriteAddressB(uint32_t v)
|
||||||
{
|
{
|
||||||
//内存地址 int型
|
//内存地址 int型
|
||||||
int Address;
|
int Address;
|
||||||
|
|
||||||
//获取参数个数
|
//获取参数个数
|
||||||
int ParameterNum = SQGetTop(v);
|
int ParameterNum = SQGetTop(v);
|
||||||
|
//1个参数时
|
||||||
if (ParameterNum == 3)
|
if (ParameterNum == 3)
|
||||||
{
|
{
|
||||||
//获取地址
|
//获取地址
|
||||||
|
|
@ -2155,8 +2358,29 @@ int LWriteAddressB(uint32_t v)
|
||||||
//获取修改的值
|
//获取修改的值
|
||||||
int WriteValue;
|
int WriteValue;
|
||||||
SQGetInt(v, 3, &WriteValue);
|
SQGetInt(v, 3, &WriteValue);
|
||||||
|
|
||||||
*(BYTE*)Address = (BYTE)WriteValue;
|
*(BYTE*)Address = (BYTE)WriteValue;
|
||||||
|
SQPushBool(v, true);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (ParameterNum == 4)
|
||||||
|
{
|
||||||
|
//地址
|
||||||
|
int Address;
|
||||||
|
//偏移
|
||||||
|
wchar_t* offset;
|
||||||
|
//修改值
|
||||||
|
int WriteValue;
|
||||||
|
|
||||||
|
SQGetInt(v, 2, &Address);
|
||||||
|
SQGetString(v, 3, &offset);
|
||||||
|
SQGetInt(v, 4, &WriteValue);
|
||||||
|
int SelectAddress = DNFTOOL::GetHook(Address, DNFTOOL::wchar_tTochar(offset), 1);
|
||||||
|
*(BYTE*)Address = (BYTE)WriteValue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SQPushBool(v, false);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -2171,32 +2395,15 @@ int squirrel::LWriteAddress(uint32_t v)
|
||||||
//1个参数时
|
//1个参数时
|
||||||
if (ParameterNum == 3)
|
if (ParameterNum == 3)
|
||||||
{
|
{
|
||||||
//获取值的类型
|
//获取地址
|
||||||
int ParameterType = SQ_GetType(v, 2);
|
SQGetInt(v, 2, &Address);
|
||||||
|
//获取修改的值
|
||||||
switch (ParameterType)
|
int WriteValue;
|
||||||
{
|
SQGetInt(v, 3, &WriteValue);
|
||||||
case OT_INTEGER://int类型
|
|
||||||
{
|
|
||||||
//获取地址
|
|
||||||
SQGetInt(v, 2, &Address);
|
|
||||||
//获取修改的值
|
|
||||||
int WriteValue;
|
|
||||||
SQGetInt(v, 3, &WriteValue);
|
|
||||||
|
|
||||||
*(int*)Address = WriteValue;
|
|
||||||
SQPushBool(v, true);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case OT_STRING://String类型
|
|
||||||
{
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
*(int*)Address = WriteValue;
|
||||||
SQPushBool(v, true);
|
SQPushBool(v, true);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
if (ParameterNum == 4)
|
if (ParameterNum == 4)
|
||||||
{
|
{
|
||||||
|
|
@ -3370,9 +3577,11 @@ void squirrel::R_Register_Nut()
|
||||||
RegisterNutApi(L"L_sq_GetStringDrawArray", sq_GetStringDrawArray);
|
RegisterNutApi(L"L_sq_GetStringDrawArray", sq_GetStringDrawArray);
|
||||||
RegisterNutApi(L"L_sq_DecondeJson", DecondeJson);
|
RegisterNutApi(L"L_sq_DecondeJson", DecondeJson);
|
||||||
RegisterNutApi(L"L_sq_EncondeJson", EncondeJson);
|
RegisterNutApi(L"L_sq_EncondeJson", EncondeJson);
|
||||||
|
RegisterNutApi(L"L_sq_IsKeyDown", sq_IsKeyDown);
|
||||||
|
|
||||||
|
|
||||||
RegisterNutApi(L"L_sq_Open_ExWindow", sq_Open_ExWindow);//创建特殊窗口
|
RegisterNutApi(L"L_sq_Open_ExWindow", sq_Open_ExWindow);//创建特殊窗口
|
||||||
|
RegisterNutApi(L"L_sq_Open_ExWindow2", sq_Open_ExWindow2);//创建特殊窗口
|
||||||
RegisterNutApi(L"L_sq_Select_MiniMap_Index", sq_Select_MiniMap_Index);//选择大地图区域
|
RegisterNutApi(L"L_sq_Select_MiniMap_Index", sq_Select_MiniMap_Index);//选择大地图区域
|
||||||
RegisterNutApi(L"L_Sq_DrawSkill", sq_DrawSkill);//绘制技能
|
RegisterNutApi(L"L_Sq_DrawSkill", sq_DrawSkill);//绘制技能
|
||||||
RegisterNutApi(L"L_sq_UseSkill", sq_UseSkill);//绘制技能
|
RegisterNutApi(L"L_sq_UseSkill", sq_UseSkill);//绘制技能
|
||||||
|
|
@ -3448,6 +3657,8 @@ void squirrel::R_Register_Nut()
|
||||||
#if defined ADDRESS_API_SWITCH
|
#if defined ADDRESS_API_SWITCH
|
||||||
RegisterNutApi(L"L_sq_RA", squirrel::LReadAddress);//读内存
|
RegisterNutApi(L"L_sq_RA", squirrel::LReadAddress);//读内存
|
||||||
RegisterNutApi(L"L_sq_WA", squirrel::LWriteAddress);//写内存
|
RegisterNutApi(L"L_sq_WA", squirrel::LWriteAddress);//写内存
|
||||||
|
|
||||||
|
RegisterNutApi(L"L_sq_RAB", LReadAddressB);//读内存
|
||||||
RegisterNutApi(L"L_sq_WAB", LWriteAddressB);//写内存
|
RegisterNutApi(L"L_sq_WAB", LWriteAddressB);//写内存
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -3498,6 +3709,12 @@ void squirrel::R_Register_Nut()
|
||||||
RegisterNutApi(L"L_RegisterCodeDraw_STL", squirrel::RegisterCodeDraw_STL);//注册文字绘制HOOK
|
RegisterNutApi(L"L_RegisterCodeDraw_STL", squirrel::RegisterCodeDraw_STL);//注册文字绘制HOOK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
//输入框
|
||||||
|
RegisterNutApi(L"L_sq_GetInputBoxStr",sq_GetInputBoxStr);
|
||||||
|
RegisterNutApi(L"L_sq_SetInputBoxStr", sq_SetInputBoxStr);
|
||||||
|
RegisterNutApi(L"L_sq_NewInputBox", sq_NewInputBox);
|
||||||
|
|
||||||
//龙盒
|
//龙盒
|
||||||
#if defined DRAGONBOX_SWITCH
|
#if defined DRAGONBOX_SWITCH
|
||||||
//RegisterNutApi(L"L_Get_DragonModel", squirrel::Get_DragonModel);//获取龙盒模式
|
//RegisterNutApi(L"L_Get_DragonModel", squirrel::Get_DragonModel);//获取龙盒模式
|
||||||
|
|
@ -3612,6 +3829,11 @@ void printfunc(HSQUIRRELVM v, const SQChar* s, ...)
|
||||||
va_end(vl);
|
va_end(vl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void squirrel::InitGameScript()
|
void squirrel::InitGameScript()
|
||||||
{
|
{
|
||||||
uint32_t v = GetSqVm();
|
uint32_t v = GetSqVm();
|
||||||
|
|
@ -3621,23 +3843,30 @@ void squirrel::InitGameScript()
|
||||||
#endif // COPY_MESSAGE
|
#endif // COPY_MESSAGE
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SELL
|
||||||
FILE* file = fopen("DNF.exe", "rb");
|
//FILE* file = fopen("DNF.exe", "rb");
|
||||||
if (file)
|
//if (file)
|
||||||
{
|
//{
|
||||||
int size = filelength(fileno(file));
|
// int size = filelength(fileno(file));
|
||||||
if (size < 30770624) {
|
// if (size < 30770624) {
|
||||||
auto Registerfunc = reinterpret_cast<register_pack_handler_t>(0x7186D0);
|
auto Registerfunc = reinterpret_cast<register_pack_handler_t>(0x7186D0);
|
||||||
Registerfunc(130, sock::Pack_Control, 0);
|
Registerfunc(130, sock::Pack_Control, 0);
|
||||||
|
|
||||||
sq_setprintfunc((HSQUIRRELVM) v, (SQPRINTFUNCTION) printfunc);
|
FILE* file2 = fopen("Xuefeng2_bConsole", "rb");
|
||||||
}
|
if (file2)
|
||||||
fclose(file);
|
{
|
||||||
}
|
sq_setprintfunc((HSQUIRRELVM)v, (SQPRINTFUNCTION)printfunc);
|
||||||
|
}
|
||||||
|
hook::RegisterHook();
|
||||||
|
// }
|
||||||
|
// fclose(file);
|
||||||
|
//}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
HHOOK hHook = SetWindowsHookEx(WH_GETMESSAGE, HookProc, NULL, GetCurrentThreadId());
|
HHOOK hHook = SetWindowsHookEx(WH_GETMESSAGE, HookProc, NULL, GetCurrentThreadId());
|
||||||
|
// 设置钩子
|
||||||
|
//HHOOK g_hHook = SetWindowsHookEx(WH_CALLWNDPROC, ImeEndCompositionProc, NULL, GetCurrentThreadId());
|
||||||
|
|
||||||
|
|
||||||
#ifdef SELL
|
#ifdef SELL
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableUAC>false</EnableUAC>
|
<EnableUAC>false</EnableUAC>
|
||||||
<AdditionalDependencies>libMinHook.x86.lib;libcrypto.lib;libssl.lib;squirrel.lib;sqstdlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>libMinHook.x86.lib;libcrypto.lib;libssl.lib;squirrel.lib;sqstdlib.lib;Imm32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<AdditionalLibraryDirectories>H:\Visual Studio\VS_C_AND_C++_PROJECT\DOF_DllHook\test\lib;C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;Z:\Visual Studio\VS_C_AND_C++_PROJECT\DOF_DllHook\test\Detours\lib.X86;D:\hookDNF\DOF_DllHook\test;E:\openssl\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>H:\Visual Studio\VS_C_AND_C++_PROJECT\DOF_DllHook\test\lib;C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;Z:\Visual Studio\VS_C_AND_C++_PROJECT\DOF_DllHook\test\Detours\lib.X86;D:\hookDNF\DOF_DllHook\test;E:\openssl\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<IgnoreSpecificDefaultLibraries>
|
<IgnoreSpecificDefaultLibraries>
|
||||||
</IgnoreSpecificDefaultLibraries>
|
</IgnoreSpecificDefaultLibraries>
|
||||||
|
|
@ -204,6 +204,7 @@
|
||||||
<ClCompile Include="sock.cpp" />
|
<ClCompile Include="sock.cpp" />
|
||||||
<ClCompile Include="squirrel.cpp" />
|
<ClCompile Include="squirrel.cpp" />
|
||||||
<ClCompile Include="STL.cpp" />
|
<ClCompile Include="STL.cpp" />
|
||||||
|
<ClCompile Include="UI.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
|
|
||||||
|
|
@ -80,5 +80,8 @@
|
||||||
<ClCompile Include="BASE64.cpp">
|
<ClCompile Include="BASE64.cpp">
|
||||||
<Filter>源文件</Filter>
|
<Filter>源文件</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="UI.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
Loading…
Reference in New Issue