PDA

View Full Version : How to avoid OutputDebugString() message box?


GuangZor
May 15th, 2010, 05:43
When I run a game executable, which is compiled in Debug mode, everytime it calls OutputDebugStringA() I get a message box containing strange characters:

http://img194.imageshack.us/img194/1502/ollydbgdebugmessageboxi.jpg

The API is called everytime the game loads a resource/file, then you can imagine how annoying is to keep pressing ESC/or pressing OK button many times, everytime I need to run the game.

My OllyDBG settings:
"Option -> Events -> BP on Debug String" -> Unchecked

olydbg.ini:
Code:

Stop on new DLL=0
Stop on DLL unload=0
Stop on new thread=0
Stop on thread end=0
Stop on debug string=0


Any ideas?

BoB
May 15th, 2010, 09:35
Hi GuangZor,
Well the proper debug string is output in the status bar, but without seeing the code where it is then put into the MessageBox it is hard to determine what exactly is wrong. Possibly MessageBoxW is used, or simply a corrupted register or missing debug text.
But if you just want to get rid of the messagebox, just nop the call to it, and the parameters.
Or alternatively you could try writing Ret 4 at the entry to the OutputDebugStringA Api, maybe it won't show the messagebox if no debug string is sent?

Have fun!
BoB

GuangZor
May 15th, 2010, 19:29
Hi BoB,

I forced a RETN 4 at OutputDebugStringA, as you have suggested, and now I'm able to run without any message boxes! This API is calling RaiseException() all the times for this specified game.

Thanks for your hint!

BoB
May 15th, 2010, 21:28
Hi GuangZor,
You're welcome, glad to hear it worked

Have fun!
BoB