美文网首页
读取指定进程内存,成功读取目标4字节信息

读取指定进程内存,成功读取目标4字节信息

作者: f675b1a02698 | 来源:发表于2017-09-14 16:14 被阅读0次

如图

源码

#include

#include

int main(int argc, PCHAR argv[]){

HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, 23548);

if (handle == NULL){

printf("打开进程失败\n");

}

printf("打开进程成功,句柄为:%p\n", handle);

LPSTR buffer;

DWORD i = 0;

DWORD newprot, oldprot;

VirtualProtectEx(handle, (LPVOID)0x0040008, 4, PAGE_EXECUTE_READWRITE, &oldprot);

if (!ReadProcessMemory(handle, (LPVOID)0x0040008, &buffer, 4, &i)){

printf("读取进程内存失败 %d %d\n", GetLastError(), i);

}

VirtualProtectEx(handle, (LPVOID)0x0040008, 4, oldprot, &newprot);

printf("读取到的进程内存信息为: %p 读取数量 %d\n", buffer, i);

CloseHandle(handle);

getchar();

return 0;

}

相关文章

网友评论

      本文标题:读取指定进程内存,成功读取目标4字节信息

      本文链接:https://www.haomeiwen.com/subject/rfgqsxtx.html