Author | Message | Time |
---|---|---|
FLiPPY_ | 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... [code] 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 [/code] All help is appreciated. | July 11, 2004, 6:42 PM |
ChR0NiC | Are you sending the Protocol Header first? Edit: Ah yes you are, try replacing that with sckBnet.SendData Chr(1) Also remember [code] (DWORD) Platform ID (DWORD) Program ID [/code] Those should be treated as DWORDs not Strings. But that shouldn't result in an IP Ban. | July 11, 2004, 6:47 PM |
DarkMinion | .SendPacket should create the header... And also, it wouldn't matter if he treated them as DWORDs, he's still just inserting 4 bytes. | July 12, 2004, 3:47 PM |
FLiPPY_ | [quote] Edit: Ah yes you are, try replacing that with sckBnet.SendData Chr(1) [/quote] 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? | July 12, 2004, 4:29 PM |
Myndfyr | [quote author=DarkMinion link=board=17;threadid=7661;start=0#msg69970 date=1089647222] .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] 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? | July 12, 2004, 4:35 PM |
FLiPPY_ | 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) [code] 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 [/code] | July 12, 2004, 4:55 PM |
ChR0NiC | [quote author=DarkMinion link=board=17;threadid=7661;start=0#msg69970 date=1089647222] .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] [quote author=ChR0NiC link=board=17;threadid=7661;start=0#msg69728 date=1089571629] Are you sending the Protocol Header first? Those should be treated as DWORDs not Strings. But that shouldn't result in an IP Ban. [/quote] I never said it would matter, I just think it's bad practice. | July 12, 2004, 6:07 PM |
FLiPPY_ | Ok... thanks? ::) | July 12, 2004, 7:58 PM |
FLiPPY_ | 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.. [code] 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 [/code] On my data arival I basically just make it [code] Bot_Functions.PacketParse strData [/code] My Packet Parse is this [code] Public Function PacketParse(strData As String) Select Case strData Case &H25 With PacketBuf .InsertDWORD &H0 .SendPacket main.BNET, &H25 End With End Function [/code] 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[code][/code] | July 22, 2004, 5:54 PM |
Stealth | [quote author=FLiPPY_ link=board=17;threadid=7661;start=0#msg71879 date=1090518883] On my data arival I basically just make it [code] Bot_Functions.PacketParse strData [/code] My Packet Parse is this [code] Public Function PacketParse(strData As String) Select Case strData Case &H25 With PacketBuf .InsertDWORD &H0 .SendPacket main.BNET, &H25 End With End Function [/code] [/quote] 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, 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 and you can see how information bounces back and forth between the client and the server. | July 22, 2004, 6:13 PM |