Ok, right after I try to send the packet 0x50, my bot just disconnects. I have a feeling that I am not sending it correctly...
Public Sub Send_0x50()
With PacketBuf
.InsertDWORD &H0
.InsertNonNTString "68XI"
.InsertNonNTString "PXES"
.InsertDWORD &HC9
.InsertDWORD &H0
.InsertDWORD &H0
.InsertDWORD &H0
.InsertDWORD &H0
.InsertDWORD &H0
.InsertNTString "USA"
.InsertNTString "United States"
.SendPacket BNET, &H50
AddChat vbRed, "SENT -> 0x50"
End With
End Sub
All help is appreciated.
Are you sending the Protocol Header first?
Edit: Ah yes you are, try replacing that with sckBnet.SendData Chr(1)
Also remember
(DWORD) Platform ID
(DWORD) Program ID
Those should be treated as DWORDs not Strings. But that shouldn't result in an IP Ban.
.SendPacket should create the header...
And also, it wouldn't matter if he treated them as DWORDs, he's still just inserting 4 bytes.
Quote
Edit: Ah yes you are, try replacing that with sckBnet.SendData Chr(1)
Well, after adding that, I'm not disconnecting but it seems like BNET isn't sending me any data back?
Under my BNET Data Arrival i make it add text that it is being recieved something. Any tips?
Quote from: DarkMinion on July 12, 2004, 10:47 AM
.SendPacket should create the header...
And also, it wouldn't matter if he treated them as DWORDs, he's still just inserting 4 bytes.
It might not matter if he treats them as DWORDS, but at least in my packet-buffer, when I insert a non-NT string, I verify four-byte length and then reverse them. So, should InsertNonNTString take "IX86" and "SEXP" as parameters perhaps? Invalid product and platform IDs?
No, they are the correct ones.
edit:
Wait!!
I was just testing it, and I let it sit for like 2 minutes.... when all the sudden it says I am recieving something but it doesnt say... it should because if it recieves 0x25 it will Addchat... and so on... here is my packetparse...(just as right now, I will finish it)
Dim PacketNumber As Integer
Select Case PacketNumber
Case &H25
AddChat vbCyan, "RECV <- 0x25"
With PacketBuf
.SendPacket main.BNET, &H25
End With
Case &H50
AddChat vbCyan, "RECV <- 0x50"
End Select
Quote from: DarkMinion on July 12, 2004, 10:47 AM
.SendPacket should create the header...
And also, it wouldn't matter if he treated them as DWORDs, he's still just inserting 4 bytes.
Quote from: ChR0NiC on July 11, 2004, 01:47 PM
Are you sending the Protocol Header first?
Those should be treated as DWORDs not Strings. But that shouldn't result in an IP Ban.
I never said it would matter, I just think it's bad practice.
Ok... thanks? ::)
Well no one really got to answer this... so here is my progress now
After I send 0x50 packet... I only receive something after about 1-2 minutes. Here is my 0x50 Packet..
Public Sub Send_0x50()
BNET.SendData Chr(1)
With PacketBuf
.InsertDWORD &H0
.InsertNonNTString "68XI"
.InsertNonNTString "PXES"
.InsertDWORD &HC9
.InsertDWORD &H0
.InsertDWORD &H0
.InsertDWORD &H0
.InsertDWORD &H0
.InsertDWORD &H0
.InsertNTString "USA"
.InsertNTString "United States"
.SendPacket BNET, &H50
AddChat vbRed, "SENT -> 0x50"
End With
End Sub
On my data arival I basically just make it
Bot_Functions.PacketParse strData
My Packet Parse is this
Public Function PacketParse(strData As String)
Select Case strData
Case &H25
With PacketBuf
.InsertDWORD &H0
.SendPacket main.BNET, &H25
End With
End Function
I think it has something to do with me sending the 0x50 wrong... but i left that code just incase you needed it.
Thanks in advance
Quote from: FLiPPY_ on July 22, 2004, 12:54 PM
On my data arival I basically just make it
Bot_Functions.PacketParse strData
My Packet Parse is this
Public Function PacketParse(strData As String)
Select Case strData
Case &H25
With PacketBuf
.InsertDWORD &H0
.SendPacket main.BNET, &H25
End With
End Function
You don't appear to be doing any actual parsing here. You have to determine which character in the string you get from the winsock is the packet ID, and then proceed from there. Once you send 0x50, the server will reply with 0x50 and 0x25 in sequence. You're supposed to then take the data you received in 0x50 and apply it to the creation of 0x51.
In fact, if you want to watch the whole sequence, get a packet logger (http://ethereal.com), close all programs other than Starcraft, start the packetlogger and log in with Starcraft. Once you're done logging in, stop the packetlogger and have a look at the results. Traffic between Starcraft and the server will follow the packet format outlined in BNetDocs (http://bnetdocs.valhallalegends.com) and you can see how information bounces back and forth between the client and the server.