C++用指针+偏移量读取内存地址
C++ read memory address with pointer+offset
我正在尝试读取一个应该是数字 20 的进程地址。我确定这个地址位于 dll 基址偏移量 + 一个偏移量为 10 的数字。我正在使用
ReadProcessMemory(phandle, (void*)address, &number, sizeof(number), 0);
读取特定地址。我的问题是如何正确搜索位于“57B86F68”+ 10 偏移量的地址?
如果您的 phandle
是一个进程句柄并授予 PROCESS_VM_READ 访问权限,您可以从句柄读取数据:
ReadProcessMemory(phandle, (void*)(0x57B86F68 + 0x10), &number, sizeof(number), 0);
要获得进程句柄的正确访问权限,请检查您的 OpenProcess
标志,PROCESS_VM_READ
应该在那里。
如果它仍然无法正常工作,事情就会复杂得多。你应该翻译你的 virtual address to physical address and after that get direct access to the memory via kernel mode.
我正在尝试读取一个应该是数字 20 的进程地址。我确定这个地址位于 dll 基址偏移量 + 一个偏移量为 10 的数字。我正在使用
ReadProcessMemory(phandle, (void*)address, &number, sizeof(number), 0);
读取特定地址。我的问题是如何正确搜索位于“57B86F68”+ 10 偏移量的地址?
如果您的 phandle
是一个进程句柄并授予 PROCESS_VM_READ 访问权限,您可以从句柄读取数据:
ReadProcessMemory(phandle, (void*)(0x57B86F68 + 0x10), &number, sizeof(number), 0);
要获得进程句柄的正确访问权限,请检查您的 OpenProcess
标志,PROCESS_VM_READ
应该在那里。
如果它仍然无法正常工作,事情就会复杂得多。你应该翻译你的 virtual address to physical address and after that get direct access to the memory via kernel mode.