Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: QwertyMonster on February 13, 2005, 07:35 AM

Title: Wtf???!!!
Post by: QwertyMonster on February 13, 2005, 07:35 AM
Yes, wtf?!

I came to my bot last night to find when i try talk i get Auto-ipban ?!


Private Sub Text1_KeyPress(KeyAscii As Integer)
'Text1.Text = ""
If KeyAscii = 127 Then MsgBox "del"
If KeyAscii = 13 And Text1 <> "" Then
    'KeyAscii = 0
    cmdSend_Click
    KeyAscii = 0
    End If

                               
    End Sub


Is Keypress



Private Sub cmdSend_Click()
'Bnetsocket As Winsock

'0x0E <-- send text message
  Packet.InsertNTString Text1.Text
  Packet.SendPacket Bnetsocket, &HE
  Packet.Clear
  Display Chatroom, True, True, vbGreen, "<" & frmConfig.Username.Text & "> "
  Display Chatroom, False, False, vbCyan, Text1.Text
  Text1.Text = ""

End Sub



Is the button "Send"

It will display, like this (Example)

Quote[13:37] <QwertyMonster> Hey all!
[13:37] Disconnected!

Then i find myself ipbanned

I dont know what is happening, it looks  right to me? Its prob a silly error, but help plz??!!
Title: Re: Wtf???!!!
Post by: Arta on February 13, 2005, 08:14 AM
It's likely that you broke something else but the server didn't disconnect you right away. Check your logon?
Title: Re: Wtf???!!!
Post by: QwertyMonster on February 13, 2005, 08:16 AM
Hmm k ill check


Edit:

What exactly should i look out for in my logon ?  :-\
Title: Re: Wtf???!!!
Post by: QwertyMonster on February 13, 2005, 09:38 AM
Omg its just not when i talk now, its when im just connected

Quote[15:38] Joining channel: StarCraft GBR-1
[15:39] Disconnected!


Wtf is happening? ahhhh

I have no fecking idea whats going on, its really annoying! ARGGH


Edit:

Ok now i know its NOTHING to do with my chat, its my logging on coding, like Arta said.

I did change "Ucase(Mid(" or "LCase(Mid(" with the replace, but i do doubt that would of affected anything? If ne1 has ideas on what could be causing me to get ipbanned once im logged on, wud help :(
Title: Re: Wtf???!!!
Post by: Soul Taker on February 13, 2005, 11:09 AM
It's a problem with your logon sequence.  Battle.net isn't disconnecting you until after you get in chat, probably to make it harder to figure out what you're doing wrong.  This used to happen all the time back when DamnBot was popular, just look over everything.
Title: Re: Wtf???!!!
Post by: QwertyMonster on February 13, 2005, 11:10 AM
Hmm, i been looking over everything, but the problem is, i dont know what to look out for? Could you please atleast give some examples on what i should look for? Ive been looking through my coding for the past 1hr 30..
Title: Re: Wtf???!!!
Post by: shout on February 13, 2005, 11:18 AM
Are you using BNLS? If not, check hashing functions. If so, check to make sure all of your logon packets are correctly formed, by going line by line though the fucnctions and checking it w/ bnetdocs. Also make sure that you are sending the correct packets. Ex: When I log on using starcraft, and I send SID_LOGONRESPONSE2, I get ipbanned as soon as I send SID_ENTERCHAT, so with starcraft you have to use SID_LOGONRESPONSE. (Although I have heard people can logon to starcraft using SID_LOGONRESPONSE2, but I have never got it to work).
Title: Re: Wtf???!!!
Post by: QwertyMonster on February 13, 2005, 11:19 AM
No im not using BNLS, ill check through my coding now,  :-\
Title: Re: Wtf???!!!
Post by: QwertyMonster on February 13, 2005, 11:23 AM
Ok ive checked through my whole bot, and i see nothing wrong..
Title: Re: Wtf???!!!
Post by: shout on February 13, 2005, 11:31 AM
Stick breakpoints at the beginning of every packet-parseing function, and follow the values through memory. It's not fun, but hey, its the glamorous life of a programmer.

btw, Please try not to have two consecutive posts in a row. It gets very annoying.
Title: Re: Wtf???!!!
Post by: QwertyMonster on February 13, 2005, 11:44 AM
Ok i went through all my packets, and its ok logging on.

Im succesfully logged on, 30 seconds later im disconnected. WTF?

I then get ipbanned along with this message

[17:43:47] Error: -2146818234. The connection is reset by remote side
[17:43:47] Error: -2146818235. Connection is aborted due to timeout or other failure
[17:43:47] Error: -2146818234. The connection is reset by remote side


Ok found where my error is:



    Case &H25 '0x25
        PingValue = Packet.GetDWORD(Mid(Data, 5, 4))
        Packet.InsertDWORD PingValue
        Packet.SendPacket bnetsocket, &H25


It does that 3 times, then ipbans me, any ideas? :(
Title: Re: Wtf???!!!
Post by: Arta on February 13, 2005, 11:53 AM
You need to get a packet capture of yourself logging on, and then go through the messages you're sending, byte by byte, and make sure they're correct. Not just checking for missing/extra fields, but also checking the contents of the fields that are definitely in the right place.

PS: You might also try connecting to TestBNCS. If that detects a mistake in your message, you'll be disconnected immediately. If not, I'll be interested to know what you've got wrong, when you find it :)
Title: Re: Wtf???!!!
Post by: QwertyMonster on February 13, 2005, 11:54 AM
Its my 0x25 :(

I dont know whats causing my 0x25 to send 3 times, then making B.net ipban me! Arrgghhh  :-\
Title: Re: Wtf???!!!
Post by: shout on February 13, 2005, 12:16 PM
Could you show some code?
Title: Re: Wtf???!!!
Post by: QwertyMonster on February 13, 2005, 12:18 PM
Sure,

Heres my coding from the 0x25:


    Case &H25 '0x25
        PingValue = Packet.GetDWORD(Mid(Data, 5, 4))
        Packet.InsertDWORD PingValue
        Packet.SendPacket bnetsocket, &H25





    Case &H29 '0x29  Client's username and hashed password

        If Mid(Data, 5, 1) = Chr(0) Then
           Display Chatroom, True, True, vbRed, "Invalid Password, you supplied battle.net with: " & frmConfig.password.text
           Display Chatroom, False, False, vbGreen, frmConfig.Password.Text
           bnetsocket.Close
        End If
       
        If Mid(Data, 5, 1) = Chr(1) Then
           Display Chatroom, True, True, vbGreen, "Password Check Passed!"
       '0x0a
           Packet.InsertNonNTString frmConfig.Username
           Packet.InsertWORD 0
           Packet.SendPacket bnetsocket, &HA
       '0x0b
           Packet.InsertNonNTString frmConfig.Product.Text
           Packet.SendPacket bnetsocket, &HB
           Display Chatroom, True, True, vbGreen, "Successfully Connected to Battle.net"
           'Display Chatroom, True, True, vbRed, "Info: " '
           Display Chatroom, True, True, vbYellow, "You are connected to " & frmConfig.Server.Text & " on the username " & frmConfig.Username.Text & " In channel " & frmConfig.Channel.Text
       '0x0c
           Packet.InsertDWORD 2
           Packet.InsertNonNTString frmConfig.Channel.Text
           Packet.InsertBYTE 0
           Packet.SendPacket bnetsocket, &HC


Thats from 0x25

Heres my hashes:



                mpqname = Mid(Data, InStr(Data, "I"), Len(Data) - InStr(InStr(Data, "I"), Data, Chr(0)))
                mpqend = InStr(InStr(Data, "I"), Data, Chr(0))
                HasH = Mid(Data, mpqend + 1, InStr(mpqend + 1, Data, Chr(0)))
               

                Dim Version As Long
                Dim Checksum As Long
                Dim ExeInfo As String
                Dim Result As Long
                Dim Root As String
               
                frmMain.Text3.Text = frmConfig.Product.Text
                Root = App.Path & "\Rats\"
                'MsgBox frmMain.Text3.Text
                ExeInfo = Space(256)
                Result = checkrevision(Root & "starcraft.exe", Root & "storm.dll", Root & "battle.snp", HasH, Version, Checksum, ExeInfo, mpqname)
                NullTruncString ExeInfo
                Packet.InsertNonNTString "68XI" & frmMain.Text3.Text
                Packet.InsertDWORD &HC9
                Packet.InsertDWORD Version
                Packet.InsertDWORD Checksum
                Packet.InsertNTString ExeInfo
                Packet.SendPacket bnetsocket, &H7
                Display Chatroom, True, True, vbYellow, "Checking check revision...."
             If ExeInfo = Space(256) Then
                Display Chatroom, True, True, vbRed, "Unable to locate Hashes!"
             bnetsocket.Close
             
             End If
        End If



I think thats all thats needed to show?

If not just ask
Title: Re: Wtf???!!!
Post by: Mephisto on February 13, 2005, 12:21 PM
Don't you people know how to use packet logs and debug your programs?  Go download Ethereal, setup a packet logging session, have your bot connect, and when it's disconnected stop your logging session.  Then mask out all packet logs except for those on port 6112 (make sure you have no other programs utilizing that port which could make it confusing going through your log) by using the string "tcp.port == 6112. " Now, before your eyes should be your logon sequence.  Check each packet sent and received and make sure it corresponds to the correct data required to send (use BnetDocs (http://bnetdocs.valhallalegends.com) as a reference to each packet).  When you find something wrong fix it.  It may also be of greater help if you debugged your application line by line to make sure nothing odd is going on in your code (e.g. checking all code routines, conditionals, and values of your data).

And please don't post again saying that you did the above and found nothing wrong unless you are absolutely serious about it.  You're not going to get a quick easy solution without putting some effort in for situations such as these.

Good luck!  ;)
Title: Re: Wtf???!!!
Post by: QwertyMonster on February 13, 2005, 12:55 PM
The last thing sent to me from battle.net (which is disconnecting me) is


0000  00 40 2b 3f 7b 0b 00 12  17 24 cd 86 08 00 45 00   .@+?{... .$....E.
0010  00 28 b8 99 00 00 73 06  8c ea d5 f8 6a 44 c0 a8   .(....s. ....jD..
0020  01 67 17 e0 0b 4b aa b0  29 70 57 fc cc 93 50 10   .g...K.. )pW...P.
0030  fe b4 92 f7 00 00 00 00  ff 4a 7f 85               ........ .J..   


The 2 things i send before that are:


0000  00 12 17 24 cd 86 00 40  2b 3f 7b 0b 08 00 45 00   ...$...@ +?{...E.
0010  00 28 78 b6 40 00 80 06  7f cd c0 a8 01 67 d5 f8   .(x.@... .....g..
0020  6a 44 0b 4b 17 e0 57 fc  cc 92 aa b0 29 70 50 11   jD.K..W. ....)pP.
0030  fb a6 96 05 00 00                                  ......     


and


0000  00 12 17 24 cd 86 00 40  2b 3f 7b 0b 08 00 45 00   ...$...@ +?{...E.
0010  00 28 78 b5 40 00 80 06  7f ce c0 a8 01 67 d5 f8   .(x.@... .....g..
0020  6a 44 0b 4b 17 e0 57 fc  cc 92 aa b0 29 70 50 10   jD.K..W. ....)pP.
0030  fb a6 96 06 00 00                                  ......           


2 things before that are sent from battle.net are:


0000  00 40 2b 3f 7b 0b 00 12  17 24 cd 86 08 00 45 00   .@+?{... .$....E.
0010  00 28 b5 99 00 00 73 06  8f ea d5 f8 6a 44 c0 a8   .(....s. ....jD..
0020  01 67 17 e0 0b 4b aa b0  29 6f 57 fc cc 92 50 11   .g...K.. )oW...P.
0030  fe b4 92 f8 00 00 00 00  ff b8 76 69               ........ ..vi   


and


0000  00 40 2b 3f 7b 0b 00 12  17 24 cd 86 08 00 45 00   .@+?{... .$....E.
0010  00 28 b5 8f 00 00 73 06  8f f4 d5 f8 6a 44 c0 a8   .(....s. ....jD..
0020  01 67 17 e0 0b 4b aa b0  29 6f 57 fc cc 92 50 10   .g...K.. )oW...P.
0030  fe b4 92 f9 00 00 00 00  0f 1e 82 2a               ........ ...*   


Thats all  i think i should paste, but i cant see anything wrong in there? Can anybody else? If you need me to post more, just ask

Title: Re: Wtf???!!!
Post by: shout on February 13, 2005, 01:13 PM
Are you sending headers on those packets? It looks like you are not.

A packet header consists of the following:

(BYTE) 0xFF
(BYTE) PacketID
(WORD) Packet length, including the header.


This header needs to go on every packet.

Title: Re: Wtf???!!!
Post by: QwertyMonster on February 13, 2005, 01:30 PM
"headers" on those packets? Umm, wtf.

I bet ill get a reply saying "roflmao u cant program!"

But i dont go by the terms "headers on a packet"

Explain more, please?
Title: Re: Wtf???!!!
Post by: Soul Taker on February 13, 2005, 01:58 PM
Quote from: QwertyMonster on February 13, 2005, 01:30 PM
"headers" on those packets? Umm, wtf.

I bet ill get a reply saying "roflmao u cant program!"

But i dont go by the terms "headers on a packet"

Explain more, please?
He gave you the header... it can't be hard to know if you're prepending it to every packet you send to BNCS or not.
I hate to go the "roflmao u cant program!" route, but I don't think you know quite enough for a project this complex.
Title: Re: Wtf???!!!
Post by: QwertyMonster on February 13, 2005, 03:33 PM
Im not ready?

My bot was working fine, then one night i come on and it all buggers up. Please dont go saying "your not ready", because its dam right rude, and 50% chance your wrong, and in this case, YOU ARE WRONG.


Edit:

Ok it seems i think i know whats wrong now
As i have said before in the other posts

Im sending 0x25 3 times, then getting booted off and ipbanned
How can i stop this? :(
Title: Re: Wtf[SOLVED]
Post by: QwertyMonster on February 13, 2005, 04:11 PM
omfg i got it working

i had


Packet.SendPacket &HE
Packet.Clear


lieing around in 0xFF

Fking silly me

Thanks for help anyway lads!
Title: Re: Wtf[SOLVED]
Post by: UserLoser. on February 13, 2005, 06:07 PM
Quote from: QwertyMonster on February 13, 2005, 04:11 PM
omfg i got it working

i had


Packet.SendPacket &HE
Packet.Clear


lieing around in 0xFF

Fking silly me

Thanks for help anyway lads!

huh
Title: Re: Wtf???!!!
Post by: Warrior on February 13, 2005, 06:09 PM
HE HAD A FUNCTION INSIDE 0xFF SILLY USERLOSER
Title: Re: Wtf???!!!
Post by: shout on February 13, 2005, 10:37 PM
So.. you were sending 0xE, then clearing the buffer?
Quote from: UserLoser on February 13, 2005, 06:07 PM
huh
Title: Re: Wtf???!!!
Post by: Soul Taker on February 14, 2005, 06:46 AM
Guys stop being rude he's a master programmer >:(
Title: Re: Wtf???!!!
Post by: QwertyMonster on February 14, 2005, 12:07 PM
Umm, wtf?

BaDDBlooD, wow  thanks? Send me a personal message saying im a "<swear word here> ", wow, so you do it to people you dont know or like?

Soul Taker saying i cant program when it all was a <swear word here> &HE left in my 0xFF accidently, And soul taker didnt take it to hes matters to get in a mood

BaDDBlooD,  Dont go sending me private messages giving me threats,  just because i had a go at somebody.

Ok so do you send threats to every1 who argues? Hey dude, leave us alone, if your jealous of my arguement, find your own.

So next time, DONT SEND ME PRIVATE MESSAGES THREATNING ME.


Peace out.


Edit: Cut out my swearing, incase of kids :/
Title: Re: Wtf???!!!
Post by: UserLoser. on February 14, 2005, 01:34 PM
Quote from: QwertyMonster on February 14, 2005, 12:07 PM
Umm, wtf?

BaDDBlooD, wow  thanks? Send me a personal message saying im a "<swear word here> ", wow, so you do it to people you dont know or like?

Soul Taker saying i cant program when it all was a <swear word here> &HE left in my 0xFF accidently, And soul taker didnt take it to hes matters to get in a mood

BaDDBlooD,  Dont go sending me private messages giving me threats,  just because i had a go at somebody.

Ok so do you send threats to every1 who argues? Hey dude, leave us alone, if your jealous of my arguement, find your own.

So next time, DONT SEND ME PRIVATE MESSAGES THREATNING ME.


Peace out.


Edit: Cut out my swearing, incase of kids :/

Good job, voiceing your opinion as will I.  You're acting like a kid.  And what the hell do you mean by "I left my &HE in my 0xFF"???  That makes almost no sense.  Why are you using VB's notation for hexadecimal for 14, while using the more widely standard "0x" notation to represent 255.  Sure, 14 fits in 255, but how does that solve your problem of being disconnected?  I think others most likely agree that what you said makes no sense, and perhaps that's why people think you're a newbie?
Title: Re: Wtf???!!!
Post by: MyndFyre on February 14, 2005, 01:50 PM
Quote from: QwertyMonster on February 14, 2005, 12:07 PM
BaDDBlooD,  Dont go sending me private messages giving me threats,  just because i had a go at somebody.

As UserLoser has responded to your pissyness, so will I.

You have consistently demonstrated your inability to coherently describe a problem.  You double-post (considered rude forum etiquette) and then you bitch about stupid whiney crap.

Private messages are unregulated on this forum because they are just that, PRIVATE.  If you don't like it, go somewhere else, or set someone to be ignored on PMs.  Taking bitching about PMs to a public forum is NOT the correct action, particularly when they have been courteous enough to keep the flaming private through the use of the private messages.

You keep acting like a little kid.  If you want respect from the forum members, you have to earn it.  Taking this complaint to this forum is not a good way to earn it.  And on that note, neither is naming a topic "Wtf????"  Maybe if you titled your topic appropriately to describe the problem, you might get more coherent help.
Title: Re: Wtf???!!!
Post by: QwertyMonster on February 14, 2005, 02:44 PM
Wow, i never thought of it this way

UserLoser: I left the Packet &HE - ( Chat ) in my Case &HF which was causing my ipban.

MyndFyre: I did earn my respect from a few, but theres always enemys in your life,  As i have just found out.

Anyway, I have some late new year revolutions it seems:P

1.) To stop Double Posting
2.) Give more respect to me
3.) Earn some respect

I hope i'll keep them.

And a special note: Im Sorry to all people on this forum if i acted like a jerk. But hey, lifes a bitch sometimes. A forgivness from all people would be nice, but hey, its up to you.

Peace..
Title: Re: Wtf???!!!
Post by: Warrior on February 14, 2005, 02:58 PM
Quote from: QwertyMonster on February 14, 2005, 02:44 PM
Wow, i never thought of it this way

UserLoser: I left the Packet &HE ( 0x1E ) - ( Chat ) in my Case &HF ( 0xFF ) which was causing my ipban.

I havn't laughed that long in a while
Title: Re: Wtf???!!!
Post by: QwertyMonster on February 14, 2005, 03:01 PM
:( Ok i made a mistake. Get over it, please?  :-\
Title: Re: Wtf???!!!
Post by: Warrior on February 14, 2005, 03:04 PM
Ok you were sending 0x1E in your switch for 0x0F .

Simple
Title: Re: Wtf???!!!
Post by: Blaze on February 14, 2005, 10:24 PM
Quote from: QwertyMonster on February 14, 2005, 02:44 PM
MyndFyre: I did earn my respect from a few

May I ask from who?
Title: Re: Wtf???!!!
Post by: QwertyMonster on February 15, 2005, 06:18 AM
Umm, well i think i earned it from them, but they prob disagree

1.) Arta[vL]
2.) shout
3.) lord_sammy


and a couple more..
Title: Re: Wtf???!!!
Post by: Dark-Feanor on February 15, 2005, 08:03 AM
QwertyMonster, just quit...
Title: Re: Wtf???!!!
Post by: shout on February 15, 2005, 10:28 AM
You are being very childish. Stop replying to this thread. It should of been dead a page ago.