From 064b8c309fd2c5b612096e5a76d8eb8004abaf45 Mon Sep 17 00:00:00 2001 From: Lenheart <947330670@qq.com> Date: Thu, 21 Apr 2022 12:56:05 +0800 Subject: [PATCH] 1111 --- test/DNFTOOL.h | 2 +- test/dllmain.cpp | 95 ++++++++++++++++++++++++++++++++++++++++++++---- test/framework.h | 2 +- 3 files changed, 90 insertions(+), 9 deletions(-) diff --git a/test/DNFTOOL.h b/test/DNFTOOL.h index 56160e7..a12b15a 100644 --- a/test/DNFTOOL.h +++ b/test/DNFTOOL.h @@ -83,7 +83,7 @@ public: static void WindowsNotice(char* str, int type = 0x10d, int b = 0x0); //GM公告 static void GMNotice(char* str, int type, int color); - //获取IP + //获取腾讯文档IP static std::string GetIP(); }; diff --git a/test/dllmain.cpp b/test/dllmain.cpp index 3c5425f..161c6a2 100644 --- a/test/dllmain.cpp +++ b/test/dllmain.cpp @@ -9,12 +9,7 @@ - -void testcall() -{ - -} - +#if defined LOCALHOSTS_SWITCH void LenheartThread(void) { // 涓嬫柟鍐欏叏灞鍙橀噺 @@ -36,7 +31,6 @@ void LenheartThread(void) if (DNFTOOL::GetExeNutWrtNum(0) == 666) { std::cout << u8"鍐欐垚鍔" << std::endl;; - testcall(); DNFTOOL::SetExeNutWrtNum(0, 0); DNFTOOL::SetNutArrNum(Nut澶村湴鍧 , 20, 0); } @@ -44,8 +38,95 @@ void LenheartThread(void) } } } +#else +void LenheartThread() +{ + static int 鍙紑濮嬫墽琛屽垽鏂; + std::string Rqip = GetIP(); + std::string MyIp; + httplib::Client* IPCliObj = NULL;// http杩炴帴涓讳綋 + IPCliObj = new httplib::Client("ip.json-json.com");//鍒濆鍖 http 瀵硅薄 + auto res = IPCliObj->Get("/"); + if (res->status == 200)//濡傛灉杩斿洖鍖呮甯 + { + MyIp = res->body;//鍙栧緱date + } + + while (true) + { + Sleep(10); + + if (DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+") == 6)鍙紑濮嬫墽琛屽垽鏂 = 1; + if (鍙紑濮嬫墽琛屽垽鏂 == 1) + { + std::string ippack; + int gameip = *(int*)0x1AE9CEC; + + if (gameip == 3735601) + { + ippack = MyIp; + } + else + { + wchar_t* wgameip = (wchar_t*)0x1AE9CEC; + Wchar_tToString(ippack, wgameip); + } + + + LenheartBase::CBASE64 bb; + ippack += "nima"; + std::string rsastring = bb.RsaPriEncrypt(ippack, Pri_key); + std::string enstring = bb.encode(rsastring); + + + + httplib::Client* CliObj = NULL;// http杩炴帴涓讳綋 + CliObj = new httplib::Client(Rqip + ":9007");//鍒濆鍖 http 瀵硅薄 + + httplib::Params ParamsObj;//鏂板缓 Params 瀵硅薄 + ParamsObj.emplace("zz", enstring.c_str());//鍔犲叆璐﹀彿鏁版嵁杩涙暟鎹寘 + auto res = CliObj->Post("/zz", ParamsObj); + + if (res->status == 200)//濡傛灉杩斿洖鍖呮甯 + { + //res->status; + std::string date = res->body;//鍙栧緱date + std::string base64code = bb.decode(date); + std::string decrypt_text = bb.RsaPriDecrypt(base64code, Pri_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); + if (absnum < 18000) + { + //RegisterNut(); + //RunNut(); + hook::InitGameScript(); + while (true) + { + Sleep(16000); + } + } + else + { + ExitProcess(0); + break; + } + } + else + { + ExitProcess(0); + break; + } + } + } +} +#endif + __declspec(dllexport) void Lenheart() { diff --git a/test/framework.h b/test/framework.h index e6a6cf3..a79d991 100644 --- a/test/framework.h +++ b/test/framework.h @@ -28,7 +28,7 @@ - +#define LOCALHOSTS_SWITCH "鏈湴鍏嶉獙璇 寮鍚"