• Welcome to Valhalla Legends Archive.
 

Packet Help - Local IP

Started by Elneroth, June 28, 2005, 02:35 PM

Previous topic - Next topic

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

QwertyMonster

What packet is this for, or what? Please say, and i will look into it.

Elneroth

Message ID: 0x50
Message Name: SID_AUTH_INFO 
Direction: Client -> Server (Sent)

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?

Blaze

Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

shout

192.168.1.100 -> 0x6401A8C0

Imagine all the triplets were switched.
192 -> C0
168 -> A8
1     -> 01
100 -> 64

Ringo

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

Elneroth

Alright, Thanks for the help

QwertyMonster

Yeah, put it with 0 mate. I did and it works fine. :)

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.

QwertyMonster

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.

Blaze

Qwerty, your sending 0x12, hes sending 0x50 so your example is useless.
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

QwertyMonster

Oh sorry, didnt relise. But it still shows the country abbrivation..

Ringo

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

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