Results 1 to 3 of 3
  1. #1
    yodaliketaco's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    winsock.dll
    Posts
    645
    Reputation
    45
    Thanks
    514
    My Mood
    Tired

    Finding memory ranges of self--process

    I can't think of a way to do this without a windows API providing the information. Does such an API exist?

    I am trying to code a function for a hack that will find an address given a pattern of bytes starting at that address -- I know this already exists, but I want to find out how by myself.

    Thanks.

  2. #2
    Fovea's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    325
    Reputation
    101
    Thanks
    411
    My Mood
    Amused
    For external processes, you need VirtualQuery and ReadProcessMemory. If you are searching for something within your own memory space (same process), you just need VirtualQuery and the rest is possible by casting.

  3. The Following User Says Thank You to Fovea For This Useful Post:

    yodaliketaco (07-08-2011)

  4. #3
    yodaliketaco's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    winsock.dll
    Posts
    645
    Reputation
    45
    Thanks
    514
    My Mood
    Tired
    Quote Originally Posted by Fovea View Post
    For external processes, you need VirtualQuery and ReadProcessMemory. If you are searching for something within your own memory space (same process), you just need VirtualQuery and the rest is possible by casting.
    KK. Using that, I came up with this for the function:

    Code:
    bool matchPattern(PBYTE address, BYTE bytes)
    {
    	if(*address == bytes) return true;
    	else return false;
    }
    DWORD* scanAdd(BYTE bytes)
    {
    	VirtualQuery(NULL, &procMem, sizeof(procMem));
    	int n;
    	VOID *currentaddress;
    	for(n = 0; n < procMem.RegionSize; n++)
    	{
    		currentaddress = ((PBYTE)procMem.BaseAddress + n);
    		if(matchPattern((PBYTE)currentaddress, bytes)) return (DWORD*)currentaddress;
    	}
    	return 0;
    }
    Now it's time for me to see if it works.

Similar Threads

  1. Replies: 2
    Last Post: 07-13-2010, 08:53 AM
  2. finding memory addresses
    By plan in forum Suggestions, Requests & General Help
    Replies: 1
    Last Post: 05-30-2010, 12:12 PM
  3. ******* is now officially hacked find out for your self
    By alx.dodge in forum Spammers Corner
    Replies: 2
    Last Post: 01-24-2010, 01:48 PM
  4. where can i find memory hacking software?
    By headsup in forum General Hacking
    Replies: 4
    Last Post: 06-22-2009, 09:57 AM
  5. Finding Memory Values
    By [code] in forum Visual Basic Programming
    Replies: 4
    Last Post: 06-22-2009, 05:09 AM