This commit is contained in:
Lenheart 2022-04-21 12:56:05 +08:00
parent d2fb2a75d2
commit 064b8c309f
3 changed files with 90 additions and 9 deletions

View File

@ -83,7 +83,7 @@ public:
static void WindowsNotice(char* str, int type = 0x10d, int b = 0x0); static void WindowsNotice(char* str, int type = 0x10d, int b = 0x0);
//GM公告 //GM公告
static void GMNotice(char* str, int type, int color); static void GMNotice(char* str, int type, int color);
//<EFBFBD>IP //获取腾讯文档IP
static std::string GetIP(); static std::string GetIP();
}; };

View File

@ -9,12 +9,7 @@
#if defined LOCALHOSTS_SWITCH
void testcall()
{
}
void LenheartThread(void) void LenheartThread(void)
{ {
// 下方写全局变量 // 下方写全局变量
@ -36,7 +31,6 @@ void LenheartThread(void)
if (DNFTOOL::GetExeNutWrtNum(0) == 666) if (DNFTOOL::GetExeNutWrtNum(0) == 666)
{ {
std::cout << u8"写成功" << std::endl;; std::cout << u8"写成功" << std::endl;;
testcall();
DNFTOOL::SetExeNutWrtNum(0, 0); DNFTOOL::SetExeNutWrtNum(0, 0);
DNFTOOL::SetNutArrNum(Nut头地址 , 20, 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() __declspec(dllexport) void Lenheart()
{ {

View File

@ -28,7 +28,7 @@
#define LOCALHOSTS_SWITCH "本地免验证 开启"