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 


[C#] Reading other process pointer value

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Dami
Master Cheater
Reputation: 0

Joined: 23 Oct 2006
Posts: 336

PostPosted: Fri Oct 10, 2008 8:30 am    Post subject: [C#] Reading other process pointer value Reply with quote

Can you read other processes pointer values on c#?
i tried someways with "ReadProcessMemory" but didnt get anything smart out of it :/
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Fri Oct 10, 2008 9:37 am    Post subject: Reply with quote

Do you know how pointers work?
Read base address value and then read the address of that value + offset.
Back to top
View user's profile Send private message
Dami
Master Cheater
Reputation: 0

Joined: 23 Oct 2006
Posts: 336

PostPosted: Fri Oct 10, 2008 10:47 am    Post subject: Reply with quote

Symbol wrote:
Do you know how pointers work?
Read base address value and then read the address of that value + offset.


Yeah i did so...
I think i have a small problem in the code or something
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Oct 10, 2008 12:27 pm    Post subject: Reply with quote

Well, post the source
Back to top
View user's profile Send private message
Dami
Master Cheater
Reputation: 0

Joined: 23 Oct 2006
Posts: 336

PostPosted: Fri Oct 10, 2008 4:52 pm    Post subject: Reply with quote

I was succesful on reading normal address value...
How can i get the pointer address out of the mem address?


Code:
            IntPtr MEC = (IntPtr)0x00803428;

            int hahmoA = BitConverter.ToInt32(pKernel.ReadProcessMemory(MEC, 4), 0);
            int ihahmo = hahmoA + 0x10;
//Then read value of ihahmo ?
            Value.Text = hahmoA.ToString();
//


What should i use to get the pointer address ?
Example if the pointer is
00803428 + 10

Edit: How should i even read the address?
Int is no good, and i didnt find a trace of dword Sad


Last edited by Dami on Fri Oct 10, 2008 5:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Oct 10, 2008 5:05 pm    Post subject: Reply with quote

I guess you're using some kind of wrapper class for the memory stuff?

Read the base, the value you get from that address is what you want, then add the offset. Repeat until done.

Yes, read from 'ihahmo', and so forth.
Back to top
View user's profile Send private message
Dami
Master Cheater
Reputation: 0

Joined: 23 Oct 2006
Posts: 336

PostPosted: Fri Oct 10, 2008 5:13 pm    Post subject: Reply with quote

slovach wrote:
I guess you're using some kind of wrapper class for the memory stuff?

Read the base, the value you get from that address is what you want, then add the offset. Repeat until done.

Yes, read from 'ihahmo', and so forth.


Thanks, really...
I had my code problem solved yesterday already, but because i was so angry and sleepy when i got nothing done (4am) i didnt see a small problem at...

Code:
            IntPtr CHARACTERADDRESS = (IntPtr)0x00803428;

            int hahmoA = BitConverter.ToInt32(pKernel.ReadProcessMemory(CHARACTERADDRESS, 4), 0);
            int ihahmo = hahmoA + 0x10;
            IntPtr CharX = (IntPtr)ihahmo;
            int hahmoB = BitConverter.ToInt32(pKernel.ReadProcessMemory(CharX, 4), 0);
            CharXvalue.Text = hahmoB.ToString(); <-- This was CharX, it was meant to be hahmoB, like it is now :)
            CharYvalue.Text = hahmoA.ToString();


Edit: do i have something i shouldnt have there?

Code:
            IntPtr CHARACTERADDRESS = (IntPtr)0x00803f94;

            int hahmoA = BitConverter.ToInt32(pKernel.ReadProcessMemory(CHARACTERADDRESS, 4), 0);
            int ihahmox = hahmoA + 0x638;
            IntPtr CharX = (IntPtr)ihahmox;
            int hahmoB = BitConverter.ToInt32(pKernel.ReadProcessMemory(CharX, 4), 0);
            CharXvalue.Text = hahmoB.ToString();

            int ihahmoy = hahmoA + 0x63C;
            IntPtr CharY = (IntPtr)ihahmoy;
            int hahmoC = BitConverter.ToInt32(pKernel.ReadProcessMemory(CharY, 4), 0);
            CharYvalue.Text = hahmoC.ToString();


I dont want to make my code too messy or slow Wink

~~Well messy or not, but its working like a charm!
Case closed!
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