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 


How to get address of executing function?

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

Joined: 03 Jun 2008
Posts: 283
Location: The Netherlands

PostPosted: Fri Aug 23, 2013 8:43 pm    Post subject: How to get address of executing function? Reply with quote

I have a table with pointers, for all vehicles:

VehiclePointer_Index1
VehiclePointer_Index2
VehiclePointer_Index3
VehiclePointer_Index4

All those are multi level pointers with the same base address and end offsets, except the first offset which is the pointer to the car information at that index.

Now, I can imagine that the game code would do something like this:

VehiclePointer* CreateCar(input)
{
return new Car(input);
}

VehiclePointer_Index1 = CreateCar(some params);

How can I get the address of the "CreateCar" function with Cheat Engine (Or Car)?
I can force the game to re-create the cars from invalid addresses to valid cars (just select "race" from menu and cars will be created)

Is there any way to accomplish this?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 472

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

PostPosted: Sat Aug 24, 2013 2:48 am    Post subject: Reply with quote

Find what writes to the pointer and then check the stacktrace to see the calls that preceded it. (Or look above it)
If they are register calls and the registervalue is gone manually find the fuctionstart (push ebp, or look for int3 or mov [eax],al)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

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

Joined: 03 Jun 2008
Posts: 283
Location: The Netherlands

PostPosted: Sat Aug 24, 2013 9:18 am    Post subject: Reply with quote


Hm I don't see any push ebp, int3 or mov [eax],al :$

I also saw the comments and now started wondering if it's possible to determine why the pointer for the first car position X is
[[["speed2.exe"+0046B2E0]+0x38]+0x0C]+0x20]

and for the next car

[[["speed2.exe"+0046B2E0]+0x248]+0x0C]+0x20]

Where the first offset is exactly +0x210 away from the last one, is that the RigidBody pointer? So where does that 0x0C come from? ;o

The next car positions are also each +0x210 first offset away
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 472

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

PostPosted: Sat Aug 24, 2013 11:08 am    Post subject: Reply with quote

function calls usually set EAX as a result

EAX most likely got it's value from the call at speed2.exe+198e8 (probably some kind of lookup in the RigidBodySlotPool )

As for the rest no idea, I don't have this game and might just be coincidense

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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