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 


About ReadProcessMemory...

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
JWP Programs
Newbie cheater
Reputation: 0

Joined: 19 Dec 2011
Posts: 23

PostPosted: Mon Jan 23, 2012 7:30 am    Post subject: About ReadProcessMemory... Reply with quote

Before write this,
I can't speak english very well. so
please understand well.
--------------------------
Hi. I am a person to wonder readprocessmemory.
I tried to read a chunk(like 0x00001000) memory region. so...

var Address:DWORD;
Value:Array[$0..$FFF] of Byte;
BytesRead:DWORD;
begin
Address:=$00400000
ReadProcessMemory(GetCurrentProcess, Pointer(Address), @Value, $1000, BytesRead);
end;

so It was successful. :D
but...

var Address:DWORD;
Value:Array[$0..$FFF] of DWORD;
BytesRead:DWORD;
begin
Address:=$00400000
ReadProcessMemory(GetCurrentProcess, Pointer(Address), @Value, 4*$1000, BytesRead);
end;

It wasn't successful. :x
To read Byte, and Read DWORD...
To read byte read values -> +$1.
To read dword read values -> +$4.
but I wanted it to read values +$1.
also I know that bytes of DWORD is 4. but I want read values +$1...

To Read Byte,
$00400000->$00400001

To Read DWORD,
$00400000->$00400004

but some people said 'use Repeat',
like this

var
Address, Value, BytesRead:DWORD;
begin
for Address:=$00400000 to $00401000 do
begin
ReadProcessMemory(GetCurrentProcess, Pointer(Address), @Value, 4, BytesRead);
end;
end;

but It was slow(In use thread..)
so how to read the chunk region(0x00001000) In Once By 4 Bytes??

Thanks for reading
Please answer to me.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

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

PostPosted: Mon Jan 23, 2012 7:41 am    Post subject: Reply with quote

Not sure what you wish to do, but if the byte method works for you use that

also, I'd recommend to code it like this:
Code:

ReadProcessMemory(GetCurrentProcess, Pointer(Address), @Value[0], $1000, BytesRead);

so you don't overwrite the pointer to the array

and you can use a pdword type to point to a location in the byte array and interpret it as a dword.
e.g: pdword(@value[8])^ returns the dword at offset 8

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping


Last edited by Dark Byte on Wed Jan 25, 2012 3:24 am; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
JWP Programs
Newbie cheater
Reputation: 0

Joined: 19 Dec 2011
Posts: 23

PostPosted: Mon Jan 23, 2012 6:19 pm    Post subject: thanks!! Reply with quote

Thanks for the answer!!
have a good year
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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