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 


What is happening when doing code injection/pointer scanning
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Kolkina
Newbie cheater
Reputation: 0

Joined: 13 Oct 2012
Posts: 17

PostPosted: Mon May 05, 2014 3:38 pm    Post subject: Reply with quote

I wanted to ask some more questions, but I don't know what good etiquette for this sort of thing is, so I thought I'd just continue this one.

I wanted to know something about objects, and this is the scenario.

Code:
class A
{
    float var_a;
    int   var_b;
    ...
}

class B : A
{
    ...
}

class C : A
{
    ...
}


I don't know all the contents of the classes.

I have found a pointer of type A that will point towards an the start of an object.

What I want to know is:

Can I somehow scan these object fields to find out what the values in them are?

Is it possible for me to find a pointer that points towards the extended classes B or C from the type A pointer?

If I could find a pointer towards B or C, could I somehow change their types, so that B would become C and C become B?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

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

PostPosted: Mon May 05, 2014 4:43 pm    Post subject: Reply with quote

An object of class c is most likely build up as:
Code:

pointer to method table
all variables of class a
all variables of class c


Depending on the programming language and if debugging information is compiled in you can either figure out the layout of the structure with the RTTI (runtime type info) or just guess and take what's the most likely possibility. (cheat engine guesses)

Code that expects a class of type A can use class B and C without a problem, as the variables of class A are present in both B and C and the methodlist is the proper order.
B to C is only possible if both classes are exactly the same. (same variables and methods in the same order, but the method implementation can differ)

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Kolkina
Newbie cheater
Reputation: 0

Joined: 13 Oct 2012
Posts: 17

PostPosted: Mon May 05, 2014 6:16 pm    Post subject: Reply with quote

Dark Byte wrote:
Depending on the programming language and if debugging information is compiled in you can either figure out the layout of the structure with the RTTI (runtime type info) or just guess and take what's the most likely possibility. (cheat engine guesses)


I don't know what the language is in (I'm suspecting C++), but how would I find the RTTI if it did exist?
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 Gamehacking All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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