• Welcome to Valhalla Legends Archive.
 

[SOLVED] Program closes out of nowhere

Started by l2k-Shadow, November 05, 2006, 07:37 PM

Previous topic - Next topic

l2k-Shadow

So recently I actually picked up learning C++ seriously, and finally managed to get a bot to connect to battle.net and enter a channel successfully. However, right after it enters the channel, the program closes out, no errors or anything, it just simply quits. Also there are no errors or warnings given by the compiler (I'm using Dev-C++). Any ideas on why this would be happening?
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

warz

Some sort of overflow, most likely, or non-null terminated char array that you're passing to some string function. Those tend to just close programs. Possibly a recursive loop?

l2k-Shadow

Could be, i just sent source to a friend and he compiled it and it didn't close out for him. I can't restart my comp right now but once i can i'll see if that will make a difference..
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Kp

Attach a debugger to it before you connect.  If it is crashing, the debugger will report the exception when it happens (and halt program execution so you can see the crash).  If it is simply terminating, you will see the debugger report that the program exited with no error.  If you're not familiar with any other debugger, you can use ntsd (comes built-in on NT4, NT5.0, NT5.1, and NT5.2(?), but not on NT6(!)).  Note that ntsd cannot natively read gcc debug information, so you may be better off trying to use gdb if you need symbolic debugging.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

l2k-Shadow

#4
Well i hooked it with ollydbg and ran it through that and it doesn't terminate if i do that.. but if i want to run it on it's own it just closes out.

EDIT: I'm not really sure what I did but I changed something and now it's working... thx anyway.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.