View previous topic :: View next topic |
Author |
Message |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Wed Nov 18, 2009 8:56 pm Post subject: [Help] Fast method to scan through addresses |
|
|
What I usually do is make a dll, and typecast and dereference addresses starting from the base address to the end region (7FFFFFFF). Each address I find, if the address is a BYTE and its value is my desired value, I return the address and put it on my .exe listbox.
Can you help me make a faster method to scan through the addresses?
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Thu Nov 19, 2009 9:08 am Post subject: |
|
|
first off, don't put it into a listbox, way to slow (store it in a memory buffer or file on the disk and only display the parts visible based on the scrollposition)
Unless you intend on only getting a few results (e.g less than 100)
Quote: |
if the address is a BYTE
|
All addresses are bytes, or do you mean if it's a readable byte?
If so, I recommend using VirtualQuery to get a list of readable memory addresses instead instead of relying on isbadreadptr or even worse, try/except
Of course, in case you do get an exception (e.g another thread freed a region) you can increase the readpointer to at least the next page (4kb) instead of going address+1 each time. Better yet, use virtualquery again to find the next readable region
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Thu Nov 19, 2009 6:43 pm Post subject: |
|
|
Yes I mean if its a readable byte.
Also, I know that listbox is slow but I need a C++ itembox component to use, listview maybe? I read the cheat engine source and found that you used listview for listing your addresses.
Also, can you give me an example of how to use VirtualQuery to find the readable regions...
See what I usually do is:
Code: |
DWORD ReadByte(BYTE Value)
{
DWORD FirstRegion = 0x00400000;
DWORD SecondRegion = 0x7FFFFFFF;
do
{
VirtualProtect((LPVOID) FirstRegion, 4, PAGE_EXECUTE_READWRITE);
DWORD Address = FirstRegion;
BYTE Found = *(BYTE*) Address;
if (Found == Value)
{
listbox1->items->add(FirstRegion);
}
++FirstRegion;
} while (FirstRegion <= SecondRegion);
}
|
|
|
Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Sat Nov 28, 2009 1:05 pm Post subject: |
|
|
Still waiting..
|
|
Back to top |
|
 |
haha01haha01 Grandmaster Cheater Supreme
Reputation: 0
Joined: 15 Jun 2007 Posts: 1233 Location: http://www.SaviourFagFails.com/
|
Posted: Sat Nov 28, 2009 2:19 pm Post subject: |
|
|
iPromise wrote: | Yes I mean if its a readable byte.
Also, I know that listbox is slow but I need a C++ itembox component to use, listview maybe? I read the cheat engine source and found that you used listview for listing your addresses. | It's not the control itself that is slow, it's the way you use it (adding all addresses into the list vs saving them on memory and only putting a little amount)
iPromise wrote: | Also, can you give me an example of how to use VirtualQuery to find the readable regions...
See what I usually do is:
Code: |
DWORD ReadByte(BYTE Value)
{
DWORD FirstRegion = 0x00400000;
DWORD SecondRegion = 0x7FFFFFFF;
do
{
VirtualProtect((LPVOID) FirstRegion, 4, PAGE_EXECUTE_READWRITE);
DWORD Address = FirstRegion;
BYTE Found = *(BYTE*) Address;
if (Found == Value)
{
listbox1->items->add(FirstRegion);
}
++FirstRegion;
} while (FirstRegion <= SecondRegion);
}
|
| That's a very slow way. I believe the MSDN manual for VirtualQuery is not very hard to understand, as it only has 3 parameters.
|
|
Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Sat Nov 28, 2009 2:59 pm Post subject: |
|
|
Yes, but I dont get the API and how it would help me scan through my addresses faster. Is it globally or locally hooked on GameGuard, too, because I heard it was hooked.
|
|
Back to top |
|
 |
haha01haha01 Grandmaster Cheater Supreme
Reputation: 0
Joined: 15 Jun 2007 Posts: 1233 Location: http://www.SaviourFagFails.com/
|
Posted: Sat Nov 28, 2009 3:03 pm Post subject: |
|
|
iPromise wrote: | Yes, but I dont get the API and how it would help me scan through my addresses faster. Is it globally or locally hooked on GameGuard, too, because I heard it was hooked. | because obviously querying all the memory to get a list of allocated addresses is faster than going on every address, one by one, and using VirtualProtect on each one of them.
No idea about the hooking thing, though.
|
|
Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Sat Nov 28, 2009 3:06 pm Post subject: |
|
|
Can you show me an example code to find all the allocated addresses?
|
|
Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sat Nov 28, 2009 5:21 pm Post subject: |
|
|
Stop asking for source codes and start learning. Try and use that function and if you get stuck come back and ask, showing us your attempt.
|
|
Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Sun Nov 29, 2009 9:17 am Post subject: |
|
|
Okay, this is what i'm guessing, but I dont see how it would fasten it up.
Code: |
DWORD Address = 0x00400000;
DWORD Limit = 0x7FFFFFFF;
do
{
MEMORY_BASIC_INFORMATION MBI;
VirtualQueryEx(hProcess, Address, &MBI, sizeof(MEMORY_BASIC_INFORMATION));
++Address;
} while (Address <= Limit); |
|
|
Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sun Nov 29, 2009 9:33 am Post subject: |
|
|
iPromise wrote: | Okay, this is what i'm guessing, but I dont see how it would fasten it up.
Code: |
DWORD Address = 0x00400000;
DWORD Limit = 0x7FFFFFFF;
do
{
MEMORY_BASIC_INFORMATION MBI;
VirtualQueryEx(hProcess, Address, &MBI, sizeof(MEMORY_BASIC_INFORMATION));
++Address;
} while (Address <= Limit); |
|
Where in that code are you checking the mbi structure for the memory protections associated with a particular region ? Also since VirtualQueryEx returns information about an area of memory you can read off the base address and the size of that piece of memory and in the next call to VirtualQueryEx you can skip all those addresses in-between
|
|
Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Mon Nov 30, 2009 6:23 pm Post subject: |
|
|
Thats the thing I dont know, what should I check and how would I find all the allocated addresses?
|
|
Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Mon Nov 30, 2009 6:28 pm Post subject: |
|
|
By checking the MEMORY_BASIC_INFORMATION structure. Look at its members. All 3 of the things I mentioned are stored within that structure
|
|
Back to top |
|
 |
Bswap Newbie cheater
Reputation: 0
Joined: 18 Aug 2009 Posts: 21
|
Posted: Tue Dec 01, 2009 1:39 am Post subject: re: |
|
|
|
|
Back to top |
|
 |
|