View previous topic :: View next topic |
Author |
Message |
MErtHRMKsE Newbie cheater Reputation: 0
Joined: 02 Jul 2012 Posts: 21
|
Posted: Tue Jul 22, 2014 10:55 pm Post subject: CreateThread problem |
|
|
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 |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Wed Jul 23, 2014 2:25 am Post subject: |
|
|
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 |
|
|
MErtHRMKsE Newbie cheater Reputation: 0
Joined: 02 Jul 2012 Posts: 21
|
Posted: Wed Jul 23, 2014 12:33 pm Post subject: reply |
|
|
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 |
|
|
MErtHRMKsE Newbie cheater Reputation: 0
Joined: 02 Jul 2012 Posts: 21
|
Posted: Thu Jul 24, 2014 9:28 am Post subject: |
|
|
bump
|
|
Back to top |
|
|
|