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 can I view a stacktrace or call tree?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
hjefferson
Newbie cheater
Reputation: 0

Joined: 19 May 2012
Posts: 12

PostPosted: Tue May 22, 2012 7:37 am    Post subject: How can I view a stacktrace or call tree? Reply with quote

When I break within a function, I see the return address - the function that called it. Is there any way to view the function that called that and the one that called that and so on?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Tue May 22, 2012 7:45 am    Post subject: Reply with quote

Rightclick the stacktrace and choose a different style of viewing. (full, module only, etc...)

Also, if you're using the 32-bit ce version you may see a longer list (for some reason the walkstacktrace api in win64 applications return a incomplete set if the target is 32-bit (I should fix that))

_________________
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
hjefferson
Newbie cheater
Reputation: 0

Joined: 19 May 2012
Posts: 12

PostPosted: Tue May 22, 2012 7:54 am    Post subject: Reply with quote

The full viewing option shows the entire stack at this point, right?

The module viewing shows all the values that are the program base address+an offset?

How come the first value in "module only" is not the same as the return address listed under "stacktrace"?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Tue May 22, 2012 7:59 am    Post subject: Reply with quote

the function you're in may have stored modulebased addresses in the stack as local variables

ebp+4 will usually be the return address
(ebp+0 is usually the address of the previous stackframe, and that address+4 is the return address of that one.
I guess I could even write a lua function that shows this)

_________________
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
hjefferson
Newbie cheater
Reputation: 0

Joined: 19 May 2012
Posts: 12

PostPosted: Tue May 22, 2012 12:20 pm    Post subject: Reply with quote

And does the stacktrace view only show explicit calls to a function?

As in : I break at 004B1843. I see the return address in "stacktrace" view is 005227A6. But when I go to 005227A6, I don't see any call to the function at 004B1750, which contains 004B1843.

Instead I see a call to a different function, seemingly unrelated.

However, if I look at the "modules only" view and follow the very first value in the stack, 0051E900, I see a "call eax" opcode. Can I assume eax was 004B1750?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Tue May 22, 2012 12:53 pm    Post subject: Reply with quote

If the return address is 005227A6 then the caller address is 005227a1

the stack does not only contain code addresses, but also variable addresses.
0051E900 just means that that value is at the top of the stack (local variable, base pointer, etc...) but doesn't mean it's the return address.

_________________
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
hjefferson
Newbie cheater
Reputation: 0

Joined: 19 May 2012
Posts: 12

PostPosted: Tue May 22, 2012 1:01 pm    Post subject: Reply with quote

But at 005227A1, it calls 0051D350. How does this 0051D350 relate to my function at 004B1750?

Am I misunderstanding something fundamental about calls and return addresses?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Tue May 22, 2012 1:01 pm    Post subject: Reply with quote

No idea, perhaps somewhere in 51d350 is a jmp ?
_________________
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
hjefferson
Newbie cheater
Reputation: 0

Joined: 19 May 2012
Posts: 12

PostPosted: Wed May 23, 2012 8:04 pm    Post subject: Reply with quote

Yes, you are right, there was a jmp in 0051D350. I had not anticipated a long jump like this.
Back to top
View user's profile Send private message
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