Valhalla Legends Forums Archive | Battle.net Bot Development | Packet Help - Local IP

AuthorMessageTime
Elneroth
(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
June 28, 2005, 7:35 PM
QwertyMonster
What packet is this for, or what? Please say, and i will look into it.
June 28, 2005, 7:38 PM
Elneroth
Message ID: 0x50
Message Name: SID_AUTH_INFO 
Direction: Client -> Server (Sent)
June 28, 2005, 7:38 PM
Elneroth
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?
June 28, 2005, 7:40 PM
KkBlazekK
* can be replaced with 0.
June 28, 2005, 7:43 PM
shout
192.168.1.100 -> 0x6401A8C0

Imagine all the triplets were switched.
192 -> C0
168 -> A8
1     -> 01
100 -> 64
June 28, 2005, 7:43 PM
Ringo
[quote author=Elneroth link=topic=12010.msg117919#msg117919 date=1119987321]
(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
[/quote]

You need to turn each number of the address into a byte
You could do it as a string if your lazzy;
[code]
Dim Splitter(3) as string
Splitter = Split(Sockets.localip, ".")
Stringthing = Chr(Splitter(0)) & Chr(Splitter(1)) & Chr(Splitter(2)) & Chr(Splitter(3))
[/code]
June 28, 2005, 7:44 PM
Elneroth
Alright, Thanks for the help
June 28, 2005, 7:45 PM
QwertyMonster
Yeah, put it with 0 mate. I did and it works fine. :)
June 28, 2005, 7:46 PM
Elneroth
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.
June 28, 2005, 7:49 PM
QwertyMonster
Straight from an old version of my bot:

[code]
    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[/code]

Hope this helps mate.
June 28, 2005, 7:53 PM
KkBlazekK
Qwerty, your sending 0x12, hes sending 0x50 so your example is useless.
June 28, 2005, 7:55 PM
QwertyMonster
Oh sorry, didnt relise. But it still shows the country abbrivation..
June 28, 2005, 7:57 PM
Ringo
[quote author=Elneroth link=topic=12010.msg117929#msg117929 date=1119988186]
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.
[/quote]

[code]
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[/code]

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
June 28, 2005, 8:05 PM
Elneroth
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
June 28, 2005, 8:11 PM
UserLoser.
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)
[/quote]

Let me be the first to say, wtf.  Just insert VarVerbyte, what you're doing is completely pointless...
June 28, 2005, 8:12 PM
R.a.B.B.i.T
I really don't get why people always store the version byte as a string...it's a BYTE and hence NUMERICAL.  Dammit people....
June 29, 2005, 1:34 AM
Archangel
Public varVerByte as Byte
varVerByte = &HCB (For starcraft)
June 29, 2005, 4:23 AM

Search