| View previous topic :: View next topic |
| Author |
Message |
Kolkina Newbie cheater
Reputation: 0
Joined: 13 Oct 2012 Posts: 17
|
Posted: Mon May 05, 2014 3:38 pm Post subject: |
|
|
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 |
|
 |
Dark Byte Site Admin
Reputation: 474
Joined: 09 May 2003 Posts: 25953 Location: The netherlands
|
Posted: Mon May 05, 2014 4:43 pm Post subject: |
|
|
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 |
|
 |
Kolkina Newbie cheater
Reputation: 0
Joined: 13 Oct 2012 Posts: 17
|
Posted: Mon May 05, 2014 6:16 pm Post subject: |
|
|
| 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 |
|
 |
|