• Welcome to Valhalla Legends Archive.
 

Wtf???!!!

Started by QwertyMonster, February 13, 2005, 07:35 AM

Previous topic - Next topic

QwertyMonster

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??!!

Arta

It's likely that you broke something else but the server didn't disconnect you right away. Check your logon?

QwertyMonster

Hmm k ill check


Edit:

What exactly should i look out for in my logon ?  :-\

QwertyMonster

#3
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 :(

Soul Taker

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.

QwertyMonster

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..

shout

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).

QwertyMonster

No im not using BNLS, ill check through my coding now,  :-\

QwertyMonster

Ok ive checked through my whole bot, and i see nothing wrong..

shout

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.

QwertyMonster

#10
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? :(

Arta

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 :)

QwertyMonster

Its my 0x25 :(

I dont know whats causing my 0x25 to send 3 times, then making B.net ipban me! Arrgghhh  :-\

shout

Could you show some code?

QwertyMonster

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