Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Scan MemoryAddress 004000 x 7FFFFFF help dark byte

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source
View previous topic :: View next topic  
Author Message
4jax_cheater
Cheater
Reputation: 0

Joined: 14 Apr 2009
Posts: 31

PostPosted: Wed Feb 03, 2010 6:13 pm    Post subject: Scan MemoryAddress 004000 x 7FFFFFF help dark byte Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25788
Location: The netherlands

PostPosted: Wed Feb 03, 2010 8:28 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
4jax_cheater
Cheater
Reputation: 0

Joined: 14 Apr 2009
Posts: 31

PostPosted: Thu Feb 04, 2010 7:12 am    Post subject: Reply with quote

thanks dark byte!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites