| 
									
										
										
										
											2022-02-03 19:20:05 +08:00
										 |  |  |  | // dllmain.cpp : 定义 DLL 应用程序的入口点。
 | 
					
						
							| 
									
										
										
										
											2022-09-06 00:08:26 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-03 19:20:05 +08:00
										 |  |  |  | #include "pch.h"
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-03 22:25:03 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-06 11:33:52 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-21 12:56:05 +08:00
										 |  |  |  | void LenheartThread() | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     while (true) | 
					
						
							|  |  |  |  |     { | 
					
						
							| 
									
										
										
										
											2022-06-20 03:10:33 +08:00
										 |  |  |  |         Sleep(10); | 
					
						
							| 
									
										
										
										
											2022-05-23 21:37:38 +08:00
										 |  |  |  |         static int 可开始执行判断; | 
					
						
							| 
									
										
										
										
											2022-09-06 00:08:26 +08:00
										 |  |  |  |         if (DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+") == 6) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             //imguiC* ImguiObj = new imguiC();
 | 
					
						
							|  |  |  |  |             //ImguiObj->Run();
 | 
					
						
							|  |  |  |  |             可开始执行判断 = 1; | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-04-21 12:56:05 +08:00
										 |  |  |  |         if (可开始执行判断 == 1) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-05-23 21:37:38 +08:00
										 |  |  |  |             //获取验证服务器ip
 | 
					
						
							|  |  |  |  |             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
 | 
					
						
							| 
									
										
										
										
											2022-04-21 12:56:05 +08:00
										 |  |  |  |             std::string ippack; | 
					
						
							| 
									
										
										
										
											2022-05-23 21:37:38 +08:00
										 |  |  |  |             //获取ExeIP
 | 
					
						
							| 
									
										
										
										
											2022-04-21 12:56:05 +08:00
										 |  |  |  |             int gameip = *(int*)0x1AE9CEC; | 
					
						
							| 
									
										
										
										
											2022-05-23 21:37:38 +08:00
										 |  |  |  |             //如果ExeIP 等于 192.168.200.131
 | 
					
						
							| 
									
										
										
										
											2022-04-21 12:56:05 +08:00
										 |  |  |  |             if (gameip == 3735601) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 ippack = MyIp; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 wchar_t* wgameip = (wchar_t*)0x1AE9CEC; | 
					
						
							| 
									
										
										
										
											2022-04-21 13:02:35 +08:00
										 |  |  |  |                 DNFTOOL::Wchar_tToString(ippack, wgameip); | 
					
						
							| 
									
										
										
										
											2022-04-21 12:56:05 +08:00
										 |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2022-05-23 21:37:38 +08:00
										 |  |  |  |             //std::cout << "验证IP:" << ippack << std::endl;
 | 
					
						
							|  |  |  |  |             //已经获取了要发送的验证IP
 | 
					
						
							| 
									
										
										
										
											2022-04-21 12:56:05 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |             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 对象
 | 
					
						
							| 
									
										
										
										
											2022-05-07 14:31:17 +08:00
										 |  |  |  |             ParamsObj.emplace("ip", enstring.c_str());//加入账号数据进数据包
 | 
					
						
							|  |  |  |  |             auto res = CliObj->Post("/yz", ParamsObj); | 
					
						
							| 
									
										
										
										
											2022-04-21 12:56:05 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |             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); | 
					
						
							|  |  |  |  |                 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) | 
					
						
							|  |  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2022-11-06 23:12:18 +08:00
										 |  |  |  | #ifdef SELL
 | 
					
						
							|  |  |  |  |                     auto res = CliObj->Post("/transfer/getscript", ParamsObj); | 
					
						
							|  |  |  |  |                     if (res->status == 200)//如果返回包正常
 | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         std::string date = res->body;//取得date
 | 
					
						
							|  |  |  |  |                         //std::cout << date << std::endl;
 | 
					
						
							|  |  |  |  |                         if (!date.empty()) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             rapidjson::Document Dom; | 
					
						
							|  |  |  |  |                             Dom.Parse(date.c_str());//加载 字符串
 | 
					
						
							|  |  |  |  |                             int Size = Dom["size"].GetInt();//判断类型
 | 
					
						
							|  |  |  |  |                             for (int i = 0; i < Size; i++) | 
					
						
							|  |  |  |  |                             { | 
					
						
							|  |  |  |  |                                 std::string filename = Dom["list"].GetArray()[i].GetArray()[0].GetString(); | 
					
						
							|  |  |  |  |                                 std::string str = Dom["list"].GetArray()[i].GetArray()[1].GetString(); | 
					
						
							|  |  |  |  |                                 //std::cout << "当前文件个数: " << i << std::endl << "当前文件名 :" << filename << std::endl << "当前文件内容  :"<< str << std::endl;
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                                 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);//解密
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                                 wchar_t* sfile = DNFTOOL::charTowchar_t((char*)filename.c_str()); | 
					
						
							|  |  |  |  |                                 wchar_t* ss = DNFTOOL::charTowchar_t((char*)nutstr); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                                 //wprintf(L"Function:%s \n", sfile);
 | 
					
						
							|  |  |  |  |                                 uint32_t v = GetSqVm(); | 
					
						
							|  |  |  |  |                                 squirrel::SQdofileBuffer(v, sfile, ss); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                             } | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | #endif // SELL
 | 
					
						
							| 
									
										
										
										
											2022-05-23 21:37:38 +08:00
										 |  |  |  |                     return; | 
					
						
							| 
									
										
										
										
											2022-04-21 12:56:05 +08:00
										 |  |  |  |                 } | 
					
						
							|  |  |  |  |                 else | 
					
						
							|  |  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2022-06-20 03:10:33 +08:00
										 |  |  |  |                     ExitProcess(0); | 
					
						
							| 
									
										
										
										
											2022-04-21 12:56:05 +08:00
										 |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2022-06-20 03:10:33 +08:00
										 |  |  |  |                 ExitProcess(0); | 
					
						
							| 
									
										
										
										
											2022-04-21 12:56:05 +08:00
										 |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-06 20:11:13 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-03 19:20:05 +08:00
										 |  |  |  | __declspec(dllexport) void Lenheart() | 
					
						
							|  |  |  |  | { | 
					
						
							| 
									
										
										
										
											2022-09-06 00:08:26 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-03 19:20:05 +08:00
										 |  |  |  |     DWORD threadID; | 
					
						
							| 
									
										
										
										
											2022-06-20 03:10:33 +08:00
										 |  |  |  |     HANDLE Thand = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)LenheartThread, NULL, 0, &threadID); | 
					
						
							| 
									
										
										
										
											2022-09-06 00:08:26 +08:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-03 19:20:05 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | BOOL APIENTRY DllMain( HMODULE hModule, | 
					
						
							|  |  |  |  |                        DWORD  ul_reason_for_call, | 
					
						
							|  |  |  |  |                        LPVOID lpReserved | 
					
						
							|  |  |  |  |                      ) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     switch (ul_reason_for_call) | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |     case DLL_PROCESS_ATTACH: | 
					
						
							| 
									
										
										
										
											2022-05-07 14:31:17 +08:00
										 |  |  |  |          | 
					
						
							| 
									
										
										
										
											2022-09-06 00:08:26 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-08 07:29:20 +08:00
										 |  |  |  | #if defined COUTWINDOWS_SWITCH
 | 
					
						
							| 
									
										
										
										
											2022-11-06 23:12:18 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-07 14:31:17 +08:00
										 |  |  |  |         AllocConsole(); | 
					
						
							|  |  |  |  |         freopen(("CONOUT$"), ("w"), stdout); | 
					
						
							|  |  |  |  |         freopen(("CONOUT$"), ("w"), stderr); | 
					
						
							|  |  |  |  |         freopen(("CONIN$"), ("r"), stdin); | 
					
						
							| 
									
										
										
										
											2022-11-06 23:12:18 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-07 14:31:17 +08:00
										 |  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2022-09-06 00:08:26 +08:00
										 |  |  |  |         //getchar();
 | 
					
						
							| 
									
										
										
										
											2022-03-08 12:57:35 +08:00
										 |  |  |  |         hook::RegisterHook(); | 
					
						
							| 
									
										
										
										
											2022-02-03 19:20:05 +08:00
										 |  |  |  |         Lenheart(); | 
					
						
							| 
									
										
										
										
											2022-09-06 00:08:26 +08:00
										 |  |  |  |         //::CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)InitD3d, NULL, NULL, NULL);
 | 
					
						
							| 
									
										
										
										
											2022-02-10 14:14:08 +08:00
										 |  |  |  |         break; | 
					
						
							| 
									
										
										
										
											2022-02-03 19:20:05 +08:00
										 |  |  |  |     case DLL_THREAD_ATTACH: | 
					
						
							|  |  |  |  |     case DLL_THREAD_DETACH: | 
					
						
							|  |  |  |  |     case DLL_PROCESS_DETACH: | 
					
						
							|  |  |  |  |         break; | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  |     return TRUE; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 |