221 lines
		
	
	
		
			5.9 KiB
		
	
	
	
		
			C++
		
	
	
	
			
		
		
	
	
			221 lines
		
	
	
		
			5.9 KiB
		
	
	
	
		
			C++
		
	
	
	
| // dllmain.cpp : 定义 DLL 应用程序的入口点。
 | |
| 
 | |
| 
 | |
| #include "pch.h"
 | |
| 
 | |
| 
 | |
| 
 | |
| int LbState = 0;
 | |
| int RbState = 0;
 | |
| int MbState = 0;
 | |
| 
 | |
| 
 | |
| void LenheartThread()
 | |
| {
 | |
|     while (true)
 | |
|     {
 | |
|         Sleep(10);
 | |
|         static int 可开始执行判断;
 | |
|         if (DNFTOOL::GetHook(0x1A5FB4C, "0x14+0x28+") == 6)
 | |
|         {
 | |
|             //imguiC* ImguiObj = new imguiC();
 | |
|             //ImguiObj->Run();
 | |
|             可开始执行判断 = 1;
 | |
|         }
 | |
|         if (可开始执行判断 == 1)
 | |
|         {
 | |
|             //获取验证服务器ip
 | |
|             std::string Rqip = DNFTOOL::GetIP();
 | |
|             //std::string Rqip = "192.168.200.13";
 | |
|             //std::cout << "验证服务器IP:" << Rqip << std::endl;
 | |
| 
 | |
|             //获取用户IP
 | |
|             std::string ippack = DNFTOOL::GetUserIp();
 | |
|             //std::cout << "验证IP:" << ippack << std::endl;
 | |
| 
 | |
|             //验证并请求加载脚本
 | |
|             DNFTOOL::ReqIpLicense(ippack, Rqip);
 | |
| 
 | |
|             return;
 | |
|         }
 | |
|     }
 | |
| }
 | |
| 
 | |
| 
 | |
| 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
 | |
|                      )
 | |
| {
 | |
| 
 | |
|     switch (ul_reason_for_call)
 | |
|     {
 | |
|     case DLL_PROCESS_ATTACH:
 | |
|         
 | |
| 
 | |
| #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();
 | |
| 
 | |
|         break;
 | |
|     case DLL_THREAD_ATTACH:
 | |
|     case DLL_THREAD_DETACH:
 | |
|     case DLL_PROCESS_DETACH:
 | |
|         break;
 | |
|     }
 | |
|     return TRUE;
 | |
| }
 | |
| 
 |