(DWORD) Local IP for NAT compatibility*
Local IP
This is the local network IP of the client, in network byte order.
I'm having trouble with this.
Do I just insert a DWORD with the local IP? (192.168.1.100) Doesn't make sense.
Please help, TYVM
What packet is this for, or what? Please say, and i will look into it.
Message ID: 0x50
Message Name: SID_AUTH_INFO
Direction: Client -> Server (Sent)
Is it possible to skip the following?
(DWORD) Local IP for NAT compatibility*
(DWORD) Time zone bias*
(DWORD) Locale ID*
(DWORD) Language ID*
(STRING) Country abreviation
(STRING) Country
And send the packet without that information?
* can be replaced with 0.
192.168.1.100 -> 0x6401A8C0
Imagine all the triplets were switched.
192 -> C0
168 -> A8
1 -> 01
100 -> 64
Quote from: Elneroth on June 28, 2005, 02:35 PM
(DWORD) Local IP for NAT compatibility*
Local IP
This is the local network IP of the client, in network byte order.
I'm having trouble with this.
Do I just insert a DWORD with the local IP? (192.168.1.100) Doesn't make sense.
Please help, TYVM
You need to turn each number of the address into a byte
You could do it as a string if your lazzy;
Dim Splitter(3) as string
Splitter = Split(Sockets.localip, ".")
Stringthing = Chr(Splitter(0)) & Chr(Splitter(1)) & Chr(Splitter(2)) & Chr(Splitter(3))
Alright, Thanks for the help
Yeah, put it with 0 mate. I did and it works fine. :)
Alright, so far I have:
pktBnet.InsertDWORD 0
pktBnet.InsertNTString "68XI"
pktBnet.InsertNTString VarClient (Varclient = RATS)
pktBnet.InsertDWORD "&H" & VarVerByte (Verbyte = CB)
pktBnet.InsertDWORD 0
pktBnet.InsertDWORD 0
pktBnet.InsertDWORD 0
pktBnet.InsertDWORD 0
pktBnet.InsertDWORD 0
(STRING) Country abreviation
(STRING) Country
Can these be also set as 0 or do I have to acually do those?
*edit*, woops, didn't notice they were strings. Can they be left out is what I meant.
Straight from an old version of my bot:
Packet.InsertDWORD &H0
Packet.InsertDWORD &H0
Packet.InsertDWORD &H0
Packet.InsertDWORD &H0
Packet.InsertDWORD &H0
Packet.InsertDWORD &H0
Packet.InsertDWORD &H0
Packet.InsertDWORD &H0
Packet.InsertNTString "ENG" 'England
Packet.InsertNTString "44" '44 is the mobile thing for england
Packet.InsertNTString "GBR" 'Great britian
Packet.InsertNTString "United Kingdom"
Packet.SendPacket bnetsocket, &H12
Hope this helps mate.
Qwerty, your sending 0x12, hes sending 0x50 so your example is useless.
Oh sorry, didnt relise. But it still shows the country abbrivation..
Quote from: Elneroth on June 28, 2005, 02:49 PM
Alright, so far I have:
pktBnet.InsertDWORD 0
pktBnet.InsertNTString "68XI"
pktBnet.InsertNTString VarClient (Varclient = RATS)
pktBnet.InsertDWORD "&H" & VarVerByte (Verbyte = CB)
pktBnet.InsertDWORD 0
pktBnet.InsertDWORD 0
pktBnet.InsertDWORD 0
pktBnet.InsertDWORD 0
pktBnet.InsertDWORD 0
(STRING) Country abreviation
(STRING) Country
Can these be also set as 0 or do I have to acually do those?
*edit*, woops, didn't notice they were strings. Can they be left out is what I meant.
with pktBnet
.InsertDWORD 0
.InsertNONNTString "68XI" <- with a null @ end will get u ip ban
.InsertNONNTString VarClient (Varclient = RATS)
.InsertDWORD val("&H" & VarVerByte) (Verbyte = CB)
.InsertDWORD 0
.InsertDWORD 0
.InsertDWORD 0
.InsertDWORD 0
.InsertDWORD 0
.InsertNTString "BOT"
.InsertNTString "Robot Land"
end with
You were inserting "68XIRATS" into your buffer as "68XI" & Chr(0) & "RATS" & Chr(0)
That would have gotten you IP banned.
The nullstring, in that example as "BOT" is checked by the server, so must be a 3 byte nullstring, i think the last nullstring can be blank (its ignored i think*)
hope that helps
Alright, thanks for the help everyone, i appreciate it.
Just one more check:
Private Sub SckCon_Connect()
AddChat vbGreen, " >> Connected!"
AddChat vbGreen, " >> Sending packet &H1E..."
sckCon.SendData Chr(1)
With pktBnet
.InsertDWORD 0
.InsertNonNTString "68XI"
.InsertNonNTString VarClient
.InsertDWORD Val("&H" & VarVerByte)
.InsertDWORD 0
.InsertDWORD 0
.InsertDWORD 0
.InsertDWORD 0
.InsertDWORD 0
.InsertNTString "USA"
.InsertNTString "United States"
End With
AddChat vbGreen, " >> Sending packet &H50... [68XI / " & VarClient & " / &H" & VarVerByte & "]"
pktBnet.SendPacket &H50
End Sub
Use inet_addr or as Kp always says, inet_pton or inet_aton. I don't think the last two are used on Windows, though.
Edit:
Quote
.InsertDWORD Val("&H" & VarVerByte)
Let me be the first to say, wtf. Just insert
VarVerbyte, what you're doing is completely pointless...
I really don't get why people always store the version byte as a string...it's a BYTE and hence NUMERICAL. Dammit people....
Public varVerByte as Byte
varVerByte = &HCB (For starcraft)