 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
4jax_cheater Cheater
Reputation: 0
Joined: 14 Apr 2009 Posts: 31
|
Posted: Wed Feb 03, 2010 6:13 pm Post subject: Scan MemoryAddress 004000 x 7FFFFFF help dark byte |
|
|
dark byte hello, I'm making a memory editor and found a code in the programming of cheatengine here ... it is possible to scan in memoryaddress 00400000 x 7FFFFFFFF?real values!
with this code? :
Quote: | var
canberead:MEMORY_BASIC_INFORMATION;
SystemInfo: SYSTEM_INFO;
startaddress,endaddress,eaddress:dword;
PageSize:cardinal;
temp:dword;
data:Array[0..004000] of dword;
scan:integer;
PidHandle:Thandle;
begin
if GetProcessID(ProgramName, PidId) then
begin
startaddress:=($00400000);
endaddress:=($7FFFFFFF);
eaddress:=startaddress;
GetSystemInfo(SystemInfo);
PageSize:=Systeminfo.dwPageSize;
scan:=0;
PidHandle := OpenProcess(PROCESS_ALL_ACCESS,False,PidId);
repeat
if ReadProcessMemory(PidHandle, Pointer(eaddress),@data,PageSize,temp)=false then
begin
Virtualqueryex(PidHandle,pointer(eaddress),canberead,PageSize);
ReadProcessMemory(PidHandle, Pointer(canberead.BaseAddress),@data,canberead.RegionSize,temp);
end;
repeat
if data[scan]=strtoint(Edit1.Text) then
begin
ValueListEditor1.InsertRow(inttostr(scan+eaddress),Edit1.Text,true);
end;
scan:=scan+1;
until scan=PageSize+1;
until eaddress=endaddress+1;
end;
end; |
thanks...
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25788 Location: The netherlands
|
Posted: Wed Feb 03, 2010 8:28 pm Post subject: |
|
|
No, you'll get into a problem with canberead.RegionSize and a static array
VirtualQueryEx can put a value bigger than 16004 bytes into canberead.RegionSize, so you're going to cause a big memory problem.
I recommend a dynamic array you change after each call to virtualqueryex to take on the biggest size, or enumerate all the regions before calling and then find the biggest region
also, your compare routine is slow, it calls strtoint for every address, I bet you can store the result of that inside a variable
and you're initializing scan to 0 at the wrong spot, do it after the first repeat statement
and, just for neatness: Virtualqueryex needs the size of the memory_basic_information structure
_________________
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 |
|
 |
4jax_cheater Cheater
Reputation: 0
Joined: 14 Apr 2009 Posts: 31
|
Posted: Thu Feb 04, 2010 7:12 am Post subject: |
|
|
thanks dark byte!
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|