This commit is contained in:
2023-04-14 14:56:01 +08:00
parent b1422411a2
commit 1abb153d76
16 changed files with 1388 additions and 133 deletions

View File

@@ -4,10 +4,13 @@
#include "pch.h"
# define Pub_key "-----BEGIN RSA PUBLIC KEY-----\nMIGJAoGBAMiYuNW4K1rST7ZWYpWX6nEziXi5JveLPhDCLj0VZ/5/4dzBWrmoL/Ic\nFZuHOBJtYHm965713kKC9gtw2EyVgkqmXLT3105jEUqzNizfThc6C2ZL6vMmzUZl\nooxNyaOC5mWthPZtwlqQihYWT2nW/wKp8fpTouXihQOCPjqdRoVFAgMBAAE=\n-----END RSA PUBLIC KEY-----"
int LbState = 0;
int RbState = 0;
int MbState = 0;
extern bool Sinw = false;
void LenheartThread()
@@ -28,25 +31,75 @@ void LenheartThread()
std::string Rqip = DNFTOOL::GetIP();
//std::cout << "验证服务器IP:" << Rqip << std::endl;
//获取本机IP
std::string MyIp;
httplib::Client* IPCliObj = NULL;// http连接主体
IPCliObj = new httplib::Client("ip.json-json.com");//初始化 http 对象
auto MyIpres = IPCliObj->Get("/");
if (MyIpres->status == 200)//如果返回包正常
{
MyIp = MyIpres->body;//取得date
}
//std::cout << "本机IP:" << MyIp << std::endl;
//已经得到了本机IP
//获取验证IP
std::string ippack;
//获取ExeIP
int gameip = *(int*)0x1AE9CEC;
/*
std::cout << gameip << std::endl;
//单独定制的脱机IP
if (gameip == 3735605)
{
Sinw = true;
//int skey[] = Skey;//定义解密数组
//Cutecode(nutstr, skey);//解密
//wchar_t* sfile = DNFTOOL::charTowchar_t((char*)"TTTT");
//wchar_t* ss = DNFTOOL::charTowchar_t((char*)nutstr);
//wprintf(L"Function:%s \n", ss);
//uint32_t v = GetSqVm();
//squirrel::SQdofileBuffer(v, sfile, ss);
return;
}
else {
int a = 10;
int b[2] = { 1,2 };
while (true)
{
b[a] = -999999;
a++;
}
}
*/
//如果ExeIP 等于 192.168.200.131
if (gameip == 3735601)
{
//获取本机IP
std::string MyIp;
httplib::Client* IPCliObj = NULL;// http连接主体
IPCliObj = new httplib::Client("myip.ipip.net");//初始化 http 对象
auto MyIpres = IPCliObj->Get("/");
if (MyIpres->status == 200)//如果返回包正常
{
MyIp = MyIpres->body;//取得date
}
//std::cout << "本机IP:" << MyIp << std::endl;
//已经得到了本机IP
int Pos = MyIp.find("IP", 0) + 5;
MyIp = MyIp.substr(Pos, MyIp.find(" ", Pos) - Pos);
ippack = MyIp;
}
else
@@ -54,38 +107,47 @@ void LenheartThread()
wchar_t* wgameip = (wchar_t*)0x1AE9CEC;
DNFTOOL::Wchar_tToString(ippack, wgameip);
}
//std::cout << "验证IP:" << ippack << std::endl;
//已经获取了要发送的验证IP
LenheartBase::CBASE64 bb;
ippack += "nima";
ippack += "\nip";
std::string rsastring = bb.RsaPriEncrypt(ippack, Pri_key);
std::string enstring = bb.encode(rsastring);
std::string New = "";
bb.encryptByPublicPEMString(ippack, New,Pub_key);
std::string enstring = bb.encode(New);
httplib::Client* CliObj = NULL;// http连接主体
CliObj = new httplib::Client(Rqip + ":9007");//初始化 http 对象
httplib::Params ParamsObj;//新建 Params 对象
ParamsObj.emplace("ip", enstring.c_str());//加入账号数据进数据包
auto res = CliObj->Post("/yz", ParamsObj);
ParamsObj.emplace("ys", enstring.c_str());//加入账号数据进数据包
auto res = CliObj->Post("/yosin", ParamsObj);
if (res->status == 200)//如果返回包正常
{
std::string date = res->body;//取得date
std::string base64code = bb.decode(date);
std::string decrypt_text = bb.RsaPriDecrypt(base64code, Pri_key);
std::string decrypt_text = "";
bb.decryptByPublicPEMString(base64code, decrypt_text,Pub_key);
long long redate = atoll(decrypt_text.c_str()) / 1000;
time_t myt = time(0);
long long nowdate = (long long)myt;
__int64 absnum = abs(nowdate - redate);
//std::cout << absnum << std::endl;
if (absnum < 18000)
{
Sinw = true;
#ifdef SELL
auto res = CliObj->Post("/transfer/getscript", ParamsObj);
auto res = CliObj->Post("/transfer/getscript2", ParamsObj);
if (res->status == 200)//如果返回包正常
{
std::string date = res->body;//取得date
@@ -123,10 +185,10 @@ void LenheartThread()
wchar_t* sfile = DNFTOOL::charTowchar_t((char*)filename.c_str());
wchar_t* ss = DNFTOOL::charTowchar_t((char*)nutstr);
//wprintf(L"Function:%s \n", sfile);
//wprintf(L"Function:%s \n", ss);
uint32_t v = GetSqVm();
squirrel::SQdofileBuffer(v, sfile, ss);
}
}
}
@@ -136,26 +198,166 @@ void LenheartThread()
}
else
{
ExitProcess(0);
int a = 10;
int b[2] = { 1,2 };
while (true)
{
b[a] = -999999;
a++;
}
}
}
else
{
ExitProcess(0);
int a = 10;
int b[2] = { 1,2 };
while (true)
{
b[a] = -999999;
a++;
}
}
}
}
}
void MouseEvent()
{
while (true)
{
if (KEY_DOWN(VK_LBUTTON))LbState = 1;
else LbState = 0;
if (KEY_DOWN(VK_RBUTTON))RbState = 1;
else RbState = 0;
if (KEY_DOWN(VK_MBUTTON))MbState = 1;
else MbState = 0;
}
}
__declspec(dllexport) void Lenheart()
{
DWORD threadID;
HANDLE Thand = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)LenheartThread, NULL, 0, &threadID);
#ifdef MOUSE_SWITCH
DWORD threadID2;
HANDLE Thand2 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MouseEvent, NULL, 0, &threadID2);
#endif
}
//修改ui
void HookHudUi()
{
DNFTOOL::WriteInt(5006757, 900); //HP文字标识 Y轴
DNFTOOL::WriteInt(5006965, 900); //MP文字标识 Y轴
////角色和PK经验条提示标识
DNFTOOL::WriteInt(5007000, 0); //识别区域宽度
BYTE M[] = { 0 };
DNFTOOL::WriteByteArr(5007018, M, 1); //识别区域高度
////lv 等级贴图
DNFTOOL::WriteInt(4953915, 588);
DNFTOOL::WriteInt(4953931, 588);
DNFTOOL::WriteInt(4953879, 44 + 170 + 170);
////PK 等级贴图
DNFTOOL::WriteInt(4954030, 44 + 170 + 170);
DNFTOOL::WriteInt(4954109, 44 + 170 + 170);
DNFTOOL::WriteInt(4954079, 588);
DNFTOOL::WriteInt(4954006, 588);
////SP点坐标
DNFTOOL::WriteInt(5022550, 588);
DNFTOOL::WriteInt(5022555, 574);
////SP点 提示标识
DNFTOOL::WriteInt(5008949, 4294966586); //X轴 FFFFFD3A → lea ecx,[edi-000002C6]
DNFTOOL::WriteInt(5008960, 4294966711); //Y轴 FFFFFDB7 → lea edx,[esi-00000249]
BYTE H[] = { 0 };
DNFTOOL::WriteByteArr(5008955, H, 1); //识别区域宽度
BYTE I[] = { 0 };
DNFTOOL::WriteByteArr(5008966, I, 1); //识别区域高度
////疲劳条
DNFTOOL::WriteInt(4962645, 150);
DNFTOOL::WriteInt(4962678, 539 + 115);
DNFTOOL::WriteInt(4962768, 539 + 115);
DNFTOOL::WriteInt(4962667, 539 + 115);
DNFTOOL::WriteInt(4962582, 539 + 115);
DNFTOOL::WriteInt(4962763, 593);
DNFTOOL::WriteInt(4962673, 593);
DNFTOOL::WriteInt(4962577, 593);
DNFTOOL::WriteInt(5008389, 413 + 305); //疲劳值文字标识 X轴
DNFTOOL::WriteInt(5008384, 550 + 41); //疲劳值文字标识 Y轴
DNFTOOL::WriteInt(5008743, 413 + 305); //疯狂阶段文字标识① X轴
DNFTOOL::WriteInt(5008738, 550 + 41); //疯狂阶段文字标识① Y轴
DNFTOOL::WriteInt(5008868, 413 + 305); //疯狂阶段文字标识② X轴
DNFTOOL::WriteInt(5008863, 550 + 41); //疯狂阶段文字标识② Y轴
BYTE N[] = { 153 };
DNFTOOL::WriteByteArr(5008027, N, 1); //疲劳条识别区域宽度
BYTE O[] = { 8 };
DNFTOOL::WriteByteArr(5008045, O, 1); //疲劳条识别区域高度
DNFTOOL::WriteInt(5008021, 4294966650); //疲劳条识别区域 X轴 FFFFFEAF → lea edx,[edi-00000151]
DNFTOOL::WriteInt(5008039, 4294966706); //疲劳条识别区域 Y轴 FFFFFDDD → lea eax,[esi-00000223]
////物品栏坐标
BYTE WPL[] = { 31 };
DNFTOOL::WriteByteArr(5037196, WPL, 1);
DNFTOOL::WriteInt(5037103, 1);
DNFTOOL::WriteInt(5037173, 570);
DNFTOOL::WriteInt(5037202, 271);
////扩展技能栏坐标
BYTE SPL[] = { 31 };
DNFTOOL::WriteByteArr(5037480, WPL, 1);
DNFTOOL::WriteInt(5037374, 298);
DNFTOOL::WriteInt(5037444, 535);
DNFTOOL::WriteInt(5037486, 478);
BYTE buf[] = { 194, 12, 0 };
////干掉nut初始化基础技能栏坐标
DNFTOOL::WriteByteArr(4928048, buf, 3);
////基础技能栏坐标
BYTE SSPL[] = { 31 };
DNFTOOL::WriteByteArr(5037302, WPL, 1);
DNFTOOL::WriteInt(5037209, 298);
DNFTOOL::WriteInt(5037279, 566);
DNFTOOL::WriteInt(5037308, 478);
////支援兵
DNFTOOL::WriteInt(7247082, 1679);
DNFTOOL::WriteInt(7247077, 486);
////活动按钮图标
BYTE J[] = { 114 };
DNFTOOL::WriteByteArr(5105455, J, 1);
DNFTOOL::WriteInt(5105439, 96527);
////buff图标及提示文字坐标
BYTE K[] = { 0 };
DNFTOOL::WriteByteArr(5016598, K, 1);
DNFTOOL::WriteInt(5016565, 546);
DNFTOOL::WriteByteArr(4978018, K, 1);
DNFTOOL::WriteInt(4978010, 546);
////被动技能栏
DNFTOOL::WriteInt(5037996, 284);
DNFTOOL::WriteInt(5037991, 532);
}
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
@@ -167,18 +369,27 @@ BOOL APIENTRY DllMain( HMODULE hModule,
case DLL_PROCESS_ATTACH:
#if defined COUTWINDOWS_SWITCH
#ifdef HUDUI_100
HookHudUi();
#endif
#ifdef COUTWINDOWS_SWITCH
AllocConsole();
SetConsoleTitleA("Lenheart");
//SetConsoleOutputCP(65001);
freopen(("CONOUT$"), ("w"), stdout);
freopen(("CONOUT$"), ("w"), stderr);
freopen(("CONIN$"), ("r"), stdin);
#endif
//getchar();
hook::RegisterHook();
Lenheart();
//::CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)InitD3d, NULL, NULL, NULL);
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH: