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 


Another how question [CE & C++]

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

Joined: 09 Jan 2008
Posts: 84

PostPosted: Wed Apr 02, 2008 12:38 am    Post subject: Another how question [CE & C++] Reply with quote

is this a pointer-to-pointer case?? because everytime i re-run the game the address which the pointer points is changing but the value is ok. how can i get the base address so that i don't have to enter pointer address and the offset just to get the value.

or atleast how can i get the address which the pointer points in C++?
"Address of Pointer: 109CD4F0 Offset: 110"

i hope you understand what i mean.


_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
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: Wed Apr 02, 2008 2:36 am    Post subject: Reply with quote

Thats the point of the pointer, to point to the address which is unknown because its changing all the time.

To get the address the pointer points to, read the value of the base address and add the offset, then you'll get the address it points to and then you can read the value from that address. thats how pointers works, value of base address+offset = address it points to.
Back to top
View user's profile Send private message
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Wed Apr 02, 2008 3:03 am    Post subject: Reply with quote

i see.
can you translate this to me in C++ code?
"address+offset = address it points to."

_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
Back to top
View user's profile Send private message
Estx
Expert Cheater
Reputation: 0

Joined: 04 Mar 2008
Posts: 172

PostPosted: Wed Apr 02, 2008 3:56 am    Post subject: Reply with quote

1. Read 0x109CD4F0 for a length of 4 bytes
2. Read the value returned (in your topic example: 0x2e912458)
3. Add 0x110 to the value returned - and edit that address accordingly.

You shouldn't need more information than that, yeah?


Last edited by Estx on Thu Apr 03, 2008 6:04 am; edited 1 time in total
Back to top
View user's profile Send private message
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Wed Apr 02, 2008 4:26 am    Post subject: Reply with quote

yes, that should do fine. thanks.

BTW, does anybody has a solution to this http://forum.cheatengine.org/viewtopic.php?t=219771

_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
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: Wed Apr 02, 2008 7:34 am    Post subject: Reply with quote

Estx wrote:
1. Read 0x109CD4F0+0x110 (which is 0x109CD600) for a length of 4 bytes

Wrong.
The value in 0x109CD4F0+0x110, therefore you can't tell the address it will point to. (unless you read the value)
Back to top
View user's profile Send private message
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Wed Apr 02, 2008 8:47 am    Post subject: Reply with quote

Quote:
1. Read 0x109CD4F0+0x110 (which is 0x109CD600) for a length of 4 bytes

Read 0x109CD4F0 for a length of 4 bytes then add 0x110 to it. In this case it'll be 2e912348 + 110
Back to top
View user's profile Send private message
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Wed Apr 02, 2008 9:19 am    Post subject: Reply with quote

you mean ((value of 0x109CD4F0) + 0x110) == 0x2E912348?
_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed Apr 02, 2008 9:38 am    Post subject: Reply with quote

I believe he means Value of 0x109CD4F0 is 0x2E912348...
_________________
Back to top
View user's profile Send private message
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Wed Apr 02, 2008 9:47 am    Post subject: Reply with quote

so the offset 0x110 is useless because the value of 0x109CD4F0 is 0x2e912348 which is the right address.
_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Apr 02, 2008 10:11 am    Post subject: Reply with quote

1. Read 0x109CD4F0
2. Add the offset to what you got from it
3. Done, use your new address however you want

Example:

Code:
int  adddress       = 0;
BYTE something[]    = { 0x12, 0x34 };

ReadProcessMemory(someProcess, (void*)0x109CD4F0, &address, sizeof(address), NULL);
address = address + 0x110;

WriteProcessMemory(someProcess, (void*)address, &something, sizeof(something), NULL);
Back to top
View user's profile Send private message
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Wed Apr 02, 2008 4:51 pm    Post subject: Reply with quote

0x2e912348 is NOT the end address you're looking for, 0x2e912458 is.

end addresss = (value of 0x109CD4F0) + 0x110
= (0x2e912348) + 0x110
= 0x2e912458

[0x109CD4F0] is the base, when you add the offset, you get a different address in memory and, therefore, a different variable.
[0x109CD4F0] + 0x18 may be lives, and [0x109CD4F0]+0x1c may be your score or something.
Back to top
View user's profile Send private message
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Wed Apr 02, 2008 5:49 pm    Post subject: Reply with quote

thank you. i fully understand now.
_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
Back to top
View user's profile Send private message
Estx
Expert Cheater
Reputation: 0

Joined: 04 Mar 2008
Posts: 172

PostPosted: Thu Apr 03, 2008 6:01 am    Post subject: Reply with quote

My mistake (before) I wasn't paying attention to what I was writing - I usually come on here before I head off to sleep lol, not a good choice because my mind is already half-way there.

What slovach said is what I intended to say.
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