基本信息
源码名称:c++ 寻找基址
源码大小:31.22M
文件格式:.rar
开发语言:C/C++
更新时间:2024-07-03
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
// ConsoleApplication1.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include "标头.h" DWORD R4(LPCSTR strName , LPCSTR strNameClass,UINT_PTR 内存地址) { HWND fff = FindWindowA(strNameClass,strName); DWORD pid, tid; tid = GetWindowThreadProcessId(fff, &pid); HANDLE 进程句柄 = OpenProcess(PROCESS_ALL_ACCESS, 0, pid); DWORD fanhui = 0; ReadProcessMemory(进程句柄, (LPCVOID)内存地址, &fanhui, 4, 0); CloseHandle(进程句柄); return fanhui; } void W4(LPCSTR strName, LPCSTR strNameClass, UINT_PTR 内存地址,DWORD fanhui) { HWND fff = FindWindowA(strNameClass, strName); DWORD pid, tid; tid = GetWindowThreadProcessId(fff, &pid); HANDLE 进程句柄 = OpenProcess(PROCESS_ALL_ACCESS, 0, pid); WriteProcessMemory(进程句柄, (LPVOID)内存地址, &fanhui, 4, 0); CloseHandle(进程句柄); } char* UnicodeToUtf8(wchar_t* lpszStr) { char* lpUtf8; int nLen; if (NULL == lpszStr) return NULL; nLen = ::WideCharToMultiByte(CP_UTF8, 0, lpszStr, -1, NULL, 0, NULL, NULL); if (0 == nLen) return NULL; lpUtf8 = new char[nLen 1]; if (NULL == lpUtf8) return NULL; memset(lpUtf8, 0, nLen 1); nLen = ::WideCharToMultiByte(CP_UTF8, 0, lpszStr, -1, lpUtf8, nLen, NULL, NULL); if (0 == nLen) { delete[]lpUtf8; return NULL; } return lpUtf8; } int main() { LPCSTR strName = "植物大战僵尸中文版"; LPCSTR strNameClass = "MainWindow"; //HMODULE F=GetModuleHandle((LPCWSTR)"PlantsVsZombies.exe"); int Yngt= R4(strName, strNameClass, R4(strName, strNameClass, R4(strName, strNameClass,0x6A9EC0) 0x768) 0x5560); printf("%d\n", Yngt); UINT_PTR YngtK = R4(strName, strNameClass, R4(strName, strNameClass, 0x6A9EC0) 0x768) 0x5560; W4(strName, strNameClass, YngtK,(DWORD)3333); Yngt = R4(strName, strNameClass, R4(strName, strNameClass, R4(strName, strNameClass, 0x6A9EC0) 0x768) 0x24); printf("%d\n", Yngt); //mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, 500, 500, 0, 0); ////1、这里是鼠标左键按下和松开两个事件的组合即一次单击: //mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); ////2、模拟鼠标右键单击事件: //mouse_event(MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0); ////3、两次连续的鼠标左键单击事件 构成一次鼠标双击事件: //mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); //mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); ////4、使用绝对坐标 // //MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, 500, 500, 0, 0 __asm { } std::cout << "Hello World!\n"; }