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 


CreateThread problem

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

Joined: 02 Jul 2012
Posts: 21

PostPosted: Tue Jul 22, 2014 10:55 pm    Post subject: CreateThread problem Reply with quote

I've recently stumbled upon a problem while using CreateThread (although I'm not certain that it's the problem). When I use CreateThread, and if it ends up calling a function named "_CxxThrowException", which is basically erroring, the program crashes. I was wondering if it's a problem while using CreateThread, because when the program reaches _CxxThrowException without me having to use CreateThread to reach that point, it doesn't crash the program.
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: Wed Jul 23, 2014 2:25 am    Post subject: Reply with quote

If you raise exceptions you have to write an exception handler to deal with them. Unhandled exceptions will crash the program
Look into structured or vectored exception handling

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

Joined: 02 Jul 2012
Posts: 21

PostPosted: Wed Jul 23, 2014 12:33 pm    Post subject: reply Reply with quote

I decided to go with the Structured Error Handler since it's what the program uses. But I still have another problem, I ran this autoassembly code :

Code:
alloc(newmem,2048)
registersymbol(newmem)
label(handler)


newmem:
push handler
push dword ptr fs:[0]
mov dword ptr fs:[0],esp
mov eax,0
mov byte ptr ds:[eax],1 // THIS BIT OF CODE CRASHES INTENTIONALLY
pop fs:[0]
add esp,4
ret
handler:
push 0
push title
push text // title and text are addresses to the title and text of the message
push 0
call MessageBoxA
ret


I made a new thread at "newmem" and after that, since I intentionally ran an invalid code, I expected the handler to run but it didn't. I don't know why??

EDIT : I should also mention that when I put the handler as an error handler function that already exists in the program, it does run it.
Back to top
View user's profile Send private message
MErtHRMKsE
Newbie cheater
Reputation: 0

Joined: 02 Jul 2012
Posts: 21

PostPosted: Thu Jul 24, 2014 9:28 am    Post subject: Reply with quote

bump
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