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 


obtain thread id in debugger_onBreakpoint()

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Hexshark
How do I cheat?
Reputation: 0

Joined: 13 Nov 2016
Posts: 3

PostPosted: Sun Nov 13, 2016 11:45 pm    Post subject: obtain thread id in debugger_onBreakpoint() Reply with quote

Hello! I found that lua engine in CE is very handy when I try to automate my debugging.
Recently I play with a muti-thread application but with a problem. I set a breakpoint on an address that several threads will run through.
debugger_onBreakpoint() get called but I cannot find a way to distinguish between threads (I want to peform some operations depending on thread id).
I found that thread id show on the top of window while I'm debugging manually( as shown in the figure 0).So I think that there should be a lua function like "getCurrentThreadId". I dig through docs and googles but nothing found.
I get stucked and please help me out if any one has any solution. btw It's my first post ever.please be kind if I'm asking a foolish question.



figure 0.JPG
 Description:
 Filesize:  31.64 KB
 Viewed:  5046 Time(s)

figure 0.JPG


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Mon Nov 14, 2016 4:09 am    Post subject: Reply with quote

there is currently no option for that, but i'll look into adding it.

an alternate way to distinguish between threads is look at the esp/rsp value during breakpoint as every thread will start their stack at a different position

_________________
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
Hexshark
How do I cheat?
Reputation: 0

Joined: 13 Nov 2016
Posts: 3

PostPosted: Thu Nov 17, 2016 8:34 pm    Post subject: thanks Reply with quote

Thanks for help. I wrote a plugin in the end. ce-plugin-system is more powerful to suit my needs.
But I still failed to find some functions from exported functions. e.g.,I want to get the stacktrace when a debugEvent occurs. Do I need to implement that function myself(using winapi stackwalk,as I know)?
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 Lua Scripting 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