Click to See Complete Forum and Search --> : Get process memory location


Guidosoft
March 27th, 2006, 01:03 PM
Is thee a way top find out where a process is in memory?

Siddhartha
March 27th, 2006, 01:14 PM
Where?

What do you want to achieve?

philkr
March 27th, 2006, 02:32 PM
You can use GetModuleHandle() to get the base address of a module in the current process(EXE or DLL).
Note that windows uses virtual address spaces: Every process has its own memory address space. Only the OS (and device drivers) have access to the physical memory.

Guidosoft
March 27th, 2006, 02:47 PM
I want to find where the variables, heaps, and virtaul alloc places are so I can scan for changing variables and make a gameshark for windows all by myself and not download any existing products.

philkr
March 27th, 2006, 02:59 PM
OK, now I know what you want to do.
You can enumerate the running modules/processes using CreateToolhelpSnapshot32() and then Module32First() and Module32Next() / Process32First() and Process32Next().
Retrieve information about memory blocks using VirtualQueryEx() (http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base/virtualqueryex.asp)
To manipulate memory use ReadProcessMemory() and WriteProcessMemory().