Re: [ctypes-users] How come this is different?
Brought to you by:
theller
From: eryk s. <er...@gm...> - 2016-12-10 21:26:36
|
On Sat, Dec 10, 2016 at 7:52 PM, Michael C <mys...@gm...> wrote: > Shouldn't I use VirtualQueryEX to find out these values? > > ph = kernel32.GetCurrentProcess() > source_array = (wintypes.DWORD * 10)(*range(10)) > base_address = ctypes.addressof(source_array) > block_size = ctypes.sizeof(source_array) VirtualQueryEx is used to query for information about a memory block (e.g. the allocation base address, region size, and protection). You would call it to get the base address and size if you wanted to read an entire allocated region, which would typically be a block of memory that's managed by a heap or some other allocator (e.g. Python's small-object allocator). |