用易语言或者python怎么写exe基址
用易语言或者python怎么写exe基址,如图是基址和三个偏移,如何写这种带有exe基址,求大佬给个教程 https://www.52pojie.cn/thread-912306-1-1.html你可以参考一下这个文章 也许可以帮助到你 不明觉厉。。。 本帖最后由 古月不傲 于 2020-3-10 18:59 编辑#include <iostream>
#include <Windows.h>
typedef enum _Address
{
baseAddress = 0x007794F8,
oneOffset = 0x868,
twoOffset = 0x5578,
}Address;
//读取指定进程的内存
BOOL ReadProcessMem(
_In_ HANDLE hProcess,
_In_ PDWORD pBaseAddress,
_In_ DWORD dwLayerOfOffset,
_In_ PDWORD pOffsetBuffer,
_In_ DWORD dwReadSize,
_Out_ PVOID pReturnValue)
{
if (hProcess == NULL || pBaseAddress == NULL || dwLayerOfOffset < 0) {
return FALSE;
}
if (dwLayerOfOffset >= 1 && pOffsetBuffer == NULL) {
return FALSE;
}
//没有偏移地址直接读取基地址返回
if (dwLayerOfOffset == 0)
{
//读取基地址
if (!ReadProcessMemory(hProcess, pBaseAddress, pReturnValue, dwReadSize, NULL)) {
return FALSE;
}
}
//有偏移地址的情况
else
{
//读取基地址
if (!ReadProcessMemory(hProcess, pBaseAddress, pReturnValue, sizeof(DWORD), NULL)) {
return FALSE;
}
PVOID pAddress = NULL;
//读取偏移
for (DWORD dwCount = 0; dwCount < dwLayerOfOffset - 1; dwCount++)
{
pAddress = (PVOID)((*(PDWORD)pReturnValue) + pOffsetBuffer);
if (!ReadProcessMemory(hProcess, pAddress, pReturnValue, sizeof(DWORD), NULL)) {
return FALSE;
}
}
pAddress = (PVOID)((*(PDWORD)pReturnValue) + pOffsetBuffer);
//读取最后偏移的值
if (!ReadProcessMemory(hProcess, pAddress, pReturnValue, dwReadSize, NULL)) {
return FALSE;
}
}
return TRUE;
}
int main(void)
{
DWORD processId = 0;
HWND hWnd = FindWindow(NULL, TEXT("Plants vs. Zombies 1.2.0.1073 RELEASE"));
GetWindowThreadProcessId(hWnd, &processId);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processId);
DWORD uOffsetBuffer = { oneOffset, twoOffset };
DWORD dwReturnValue = 0;
if (ReadProcessMem(hProcess, (PDWORD)baseAddress, 2, uOffsetBuffer, 4, &dwReturnValue)) {
printf("当前阳光值:%d\n", dwReturnValue);
}
system("pause");
return 0;
}
页:
[1]