#include <windows.h>
#include <stdio.h>
#include<iostream>
#include <string.h>
#include "strsafe.h"
#include <WinInet.h>
#include<tchar.h>
#include<StrSafe.h>
using namespace std;
typedef struct {
//region information
PVOID pvRgnBaseAddress;
DWORD dwRgnProtection;
SIZE_T RgnSize;
DWORD dwRgnStorage;
DWORD dwRgnBlocks;
DWORD dwRgnGuardBlks;//if > 0 ,region contains thread stack
BOOL bRgnIsAStack;//True if region contains thread stack
//BLOCK Information
PVOID pvBlkBaseAddress;
DWORD dwBlkProtection;
SIZE_T BlkSize;
DWORD dwBlkStorage;
}VMQUERY, *PVMQUERY;
typedef struct {
SIZE_T RgnSize;
DWORD dwRgnStorage;
DWORD dwRgnBlock;
DWORD dwRgnGuardBlks;
BOOL bRgnIsAStack;
}VMQUERY_HELP;
static DWORD gs_dwAllocGran = 0;
static BOOL VMQueryHelp(HANDLE hProcess, LPCVOID pvAddress, VMQUERY_HELP *pVMQHelp)
{
ZeroMemory(pVMQHelp, sizeof(*pVMQHelp));
//get address of region containing passed memory address
MEMORY_BASIC_INFORMATION mbi;
BOOL bOk = (VirtualQueryEx(hProcess, pvAddress, &mbi, sizeof(mbi)) == sizeof(mbi));
if (!bOk)
{
return (bOk);
}
//walk starting at the region's base address(which never changes)
PV
window 核心编程 14.4 查看虚拟地址 比较全的用户自定义函数
最新推荐文章于 2021-10-15 17:28:14 发布
本文详细介绍了在Windows环境中如何查看和理解虚拟地址。通过深入探讨用户自定义函数,揭示了虚拟地址在进程内存管理中的作用,为学习者提供了一个全面的理解窗口。
摘要由CSDN通过智能技术生成