diff --git a/test/DNFTOOL.cpp b/test/DNFTOOL.cpp index adb4310..2730ff5 100644 --- a/test/DNFTOOL.cpp +++ b/test/DNFTOOL.cpp @@ -351,9 +351,10 @@ void DNFTOOL::GMNotice(char* str, int type, int color) #else std::string DNFTOOL::GetIP() { - httplib::SSLClient Tencword("gitee.com"); + //std::cout << "获取Ip" << std::endl; + httplib::SSLClient Tencword("yosin-team.coding.net"); std::string body; - auto res = Tencword.Get("/yosin_team/request-ip/raw/master/README.md", + auto res = Tencword.Get("/p/huoqushuju/d/GetIp/git/raw/master/ip.txt?download=false", [&](const char* data, size_t data_length) { body.append(data, data_length); return true; diff --git a/test/Main.h b/test/Main.h new file mode 100644 index 0000000..b0e4690 --- /dev/null +++ b/test/Main.h @@ -0,0 +1,16 @@ +#pragma once +class Main +{ + +public: + Main(); + + + void OpenConsole();//开启控制台 + void Validation();//验证 + + + + void Run(); +}; + diff --git a/test/RSAC.cpp b/test/RSAC.cpp index 435527b..8af7f7c 100644 --- a/test/RSAC.cpp +++ b/test/RSAC.cpp @@ -1,24 +1,15 @@ #pragma once #include "pch.h" -//单个字符异或运算 -char MakecodeChar(char c, int key) { - return c = c ^ key; -} + //单个字符解密 -char CutcodeChar(char c, int key) { - return c ^ key; -} -//加密 -void Makecode(char* pstr, int* pkey) { - int len = strlen(pstr);//获取长度 - for (int i = 0; i < len; i++) - *(pstr + i) = MakecodeChar(*(pstr + i), pkey[i % 5]); +char CutcodeChar(char c, int key, int key2) { + return (((c - 1) ^ key) ^ key2) - key; } //解密 void Cutecode(char* pstr, int* pkey) { int len = strlen(pstr); for (int i = 0; i < len; i++) - *(pstr + i) = CutcodeChar(*(pstr + i), pkey[i % 5]); + *(pstr + i) = CutcodeChar(*(pstr + i), pkey[i % 5], pkey[(i + 18) % 5]); } \ No newline at end of file diff --git a/test/dllmain.cpp b/test/dllmain.cpp index abcb642..6a95518 100644 --- a/test/dllmain.cpp +++ b/test/dllmain.cpp @@ -8,46 +8,15 @@ - -#if defined LOCALHOSTS_SWITCH -void LenheartThread(void) -{ - // 涓嬫柟鍐欏叏灞鍙橀噺 - static int Nut澶村湴鍧; - static int 灞炴уご鍦板潃; - static int 鍙紑濮嬫墽琛屽垽鏂; - while (true) - { - Sleep(10); - if (DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+") == 6)鍙紑濮嬫墽琛屽垽鏂 = 1; - if (鍙紑濮嬫墽琛屽垽鏂 == 1)//閫夐閬撶晫闈 娓告垙鍒濆鍖栧畬姣 - { - //hook::InitGameScript(); - while (true) - { - Sleep(10); - if (DNFTOOL::GetExeNutWrtNum(61) != 0 && Nut澶村湴鍧 == 0)Nut澶村湴鍧 = DNFTOOL::GetExeNutWrtNum(61); - //if (GetExeNutWrtNum(61 != 0))灞炴уご鍦板潃 = GetExeNutWrtNum(61); - if (DNFTOOL::GetExeNutWrtNum(0) == 666) - { - std::cout << "鍐欐垚鍔" << std::endl;; - DNFTOOL::SetExeNutWrtNum(0, 0); - DNFTOOL::SetNutArrNum(Nut澶村湴鍧 , 20, 0); - } - } - } - } -} -#else void LenheartThread() { while (true) { + Sleep(10); static int 鍙紑濮嬫墽琛屽垽鏂; if (DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+") == 6)鍙紑濮嬫墽琛屽垽鏂 = 1; if (鍙紑濮嬫墽琛屽垽鏂 == 1) { - Sleep(3000); //鑾峰彇楠岃瘉鏈嶅姟鍣╥p std::string Rqip = DNFTOOL::GetIP(); //std::cout << "楠岃瘉鏈嶅姟鍣↖P:" << Rqip << std::endl; @@ -81,7 +50,6 @@ void LenheartThread() //std::cout << "楠岃瘉IP:" << ippack << std::endl; //宸茬粡鑾峰彇浜嗚鍙戦佺殑楠岃瘉IP - LenheartBase::CBASE64 bb; ippack += "nima"; std::string rsastring = bb.RsaPriEncrypt(ippack, Pri_key); @@ -108,30 +76,30 @@ void LenheartThread() __int64 absnum = abs(nowdate - redate); if (absnum < 18000) { - hook::InitGameScript(); return; + Sleep(300000); } else { - //ExitProcess(0); + ExitProcess(0); } } else { - //ExitProcess(0); + ExitProcess(0); } - return; } } } -#endif __declspec(dllexport) void Lenheart() { DWORD threadID; - CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)LenheartThread, NULL, 0, &threadID); - + HANDLE Thand = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)LenheartThread, NULL, 0, &threadID); + //Sleep(300000); + //CloseHandle(Thand);//閿姣佺嚎绋 + //return Lenheart(); } @@ -145,7 +113,6 @@ BOOL APIENTRY DllMain( HMODULE hModule, { case DLL_PROCESS_ATTACH: - #if defined COUTWINDOWS_SWITCH AllocConsole(); freopen(("CONOUT$"), ("w"), stdout); diff --git a/test/framework.h b/test/framework.h index 68330bf..92e7544 100644 --- a/test/framework.h +++ b/test/framework.h @@ -27,7 +27,10 @@ //#define LOCALHOSTS_SWITCH "鏈湴鍏嶉獙璇 寮鍚" + #define COUTWINDOWS_SWITCH "杈撳嚭绐楀彛 寮鍚" +#define GOLD_LIGHT "鏇欏厜 寮鍚" +#define MONSTER_BLOOD_UI "琛妲戒慨鏀 寮鍚" @@ -65,9 +68,12 @@ #include "httplib.h" #endif - - +#if defined GOLD_LIGHT +# define Skey {5,1,9,1,2} +#else # define Skey {5,2,7,7,0} +#endif + # define Pri_key "-----BEGIN PRIVATE KEY-----\n"\ "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDFRCM7WMVgU81p\n"\ "JXGmH7nxun7IaXiERWtegwJ7WsV6I4D+K4TMHkm5LVgnsQnFWluJhNkpO7iMR7mA\n"\ diff --git a/test/hook.cpp b/test/hook.cpp index e1e9920..8c9bc02 100644 --- a/test/hook.cpp +++ b/test/hook.cpp @@ -38,16 +38,18 @@ void _fastcall hook::H_Register_DrawCode(DWORD thisc, int Seat, int a3, int a4, //特殊 if (a3 == 9999 && a4 == 9998) { - uint32_t v = GetSqVm(); SQPushRootTable(v); SQPushString(v, L"DrawMainMaxLayerCustomUI", -1); SQ_Get(v, -2); SQPushRootTable(v); SQPushString(v, L"Lenheart", -1); - SQ_Call(v, 2, 1, 0); + SQ_Call(v, 2, 0, 0); SQPop(v, 2); - + + //int num = SQGetTop(v); + //std::cout << num << std::endl; + for (DrawCodestruct iter : DrawCodeT2_STL) { //wchar_t* str = DNFTOOL::charTowchar_t((char*)iter.str.c_str()); @@ -58,16 +60,36 @@ void _fastcall hook::H_Register_DrawCode(DWORD thisc, int Seat, int a3, int a4, //选角色 if (a3 == 9999 && a4 == 9489) { + static bool Init = false; + if (!Init) + { + InitGameScript();//调用初始化程序 + Init = true; + } + uint32_t v = GetSqVm(); SQPushRootTable(v); SQPushString(v, L"InitLenheartClass", -1); SQ_Get(v, -2); SQPushRootTable(v); SQPushString(v, L"Lenheart", -1); - SQ_Call(v, 2, 1, 0); + SQ_Call(v, 2, 0, 0); SQPop(v, 2); } +#if defined MONSTER_BLOOD_UI + if (a4 == 100 || a4 == 107 || a4 == 99) + { + //if (a3 == 37 || a3 == 100 || a3 == 74 || a3 == 70) + //{ + a3 = 5000; + a4 = 5000; + //} + } +#endif + + //std::cout << "xPos:" << a3 << "yPos:" << a4 <= 0 && Op <= 10)Json_STL["DragonBox"] = Buffer; @@ -26,8 +37,6 @@ void sock::Pack_Control(int idx, int code, void* p3, void* p4) if (Op >= 10 && Op <= 20)Json_STL["WorldBoss"] = Buffer; #endif - - #if defined LOCALHOSTS_SWITCH std::cout << "130号收包成功" << std::endl; std::cout << "包内容" << Buffer << std::endl; diff --git a/test/squirrel.cpp b/test/squirrel.cpp index bc72192..9be89ca 100644 --- a/test/squirrel.cpp +++ b/test/squirrel.cpp @@ -868,13 +868,16 @@ int squirrel::New_STL(uint32_t v) //时间 STL #if defined TIME_STL +extern std::mapTime_STL; //时间容器线程 void TimeSTL(LPVOID lpParam) { TimeSTLStruct *pack = (TimeSTLStruct*)lpParam;//得到传递的包 + std::wcout << "线程启动:" << pack->Name << std::endl; Time_STL[pack->Name].Static_Time = (int)GetTickCount64();//设置时间容器的基准时间 while (true)//线程循环 { + Sleep(10); int N_Time = (int)GetTickCount64() - Time_STL[pack->Name].Static_Time;//得到现在的时间 if (N_Time < Time_STL[pack->Name].Max_Time)//如果还没到 设定新的now时间 { @@ -905,7 +908,7 @@ int squirrel::Timer_STL(uint32_t v) switch (Type) { - case 0: {//设置时间容器 + case 0: //设置时间容器 if (Time_STL.count(Name) != 0)//如果这个标识容器存在 就返回 否则创建 { SQPushBool(v, false); @@ -918,24 +921,25 @@ int squirrel::Timer_STL(uint32_t v) pack.Static_Time = 0;//设置 基础时间(用于运算) pack.Thand = NULL;//设置句柄为空 Time_STL[Name] = pack;//设置包给标识时间容器 - break; } - case 1: {//启动时间容器 + break; + case 1: //启动时间容器 if (Time_STL[Name].Thand == NULL)//只有句柄为空的时候new线程 { DWORD threadID;//线程ID Time_STL[Name].Now_Time = 0;//设置当前容器时间 Time_STL[Name].Thand = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)TimeSTL, &Time_STL[Name], 0, &threadID);//创建一个新线程 开始计算时间 并把线程赋予给容器 } - break; } + break; case 2://获取时间容器 SQPushInt(v, Time_STL[Name].Now_Time);//返回当前容器时间 return 1; break; case 3://重置时间容器 - SuspendThread(Time_STL[Name].Thand);//挂起线程 + //SuspendThread(Time_STL[Name].Thand);//挂起线程 + CloseHandle(Time_STL[Name].Thand);//销毁线程 Time_STL[Name].Static_Time = 0;//基准时间设置为0 Time_STL[Name].Thand = NULL; - ResumeThread(Time_STL[Name].Thand);//启动线程 + //ResumeThread(Time_STL[Name].Thand);//启动线程 break; case 4://暂停时间容器 SuspendThread(Time_STL[Name].Thand);//挂起线程 @@ -1284,6 +1288,34 @@ int squirrel::Jsoner_STL(uint32_t v) Json_STL[Name] = jsonBuffer.GetString(); SQPushBool(v, true); } + else if (ParameterNum == 5) + { + //获取容器名字 + SQGetString(v, 2, &WName); + char* CName = DNFTOOL::wchar_tTochar(WName); + std::string Name = CName; + + //获取Str 的内容 + wchar_t* str; + SQGetString(v, 3, &str); + //转化为可用内容 + char* Jso = DNFTOOL::wchar_tTochar(str); + + //获取类型 + int Type; + SQGetInt(v, 4, &Type); + switch (Type) + { + case 0: + Json_STL[Name] = Jso; + break; + case 1: + if(Json_STL[Name].empty())Json_STL[Name] = Jso; + break; + default: + break; + } + } else { SQPushBool(v, false); diff --git a/test/test.vcxproj b/test/test.vcxproj index b5fcbc2..ea9600e 100644 --- a/test/test.vcxproj +++ b/test/test.vcxproj @@ -78,7 +78,7 @@ false - Y:\DOF\DOF-Lenheart\Plugins\ + Y:\DOF\D&F-鏇欏厜 - 鍗曟満\Plugins E:\openssl\lib;E:\Testnixiang\test\test\OpenSSL-Win32\lib;E:\Testnixiang\test\test\OpenSSL-Win32\lib\VC;$(LibraryPath) E:\openssl\include;$(IncludePath)