Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: SiMi on May 27, 2003, 08:29 PM

Title: Winsocks Api
Post by: SiMi on May 27, 2003, 08:29 PM
Currentely im trying to connect on socks 4 for my unlimited bot and i want to know what api calls do i need when sending my port and the ip. Can Someone Help Me?

Here is an example:

Blah = Split(GetStuff("Main", "Server"), ".")
................      
GateBuf.InsertWORD 6112
   For i = LBound(Blah) To UBound(Blah)
           GateBuf.InsertBYTE CStr(Blah(i))
   Next i
Title: Re:Winsocks Api
Post by: SiMi on May 28, 2003, 12:32 AM
so im thinking the ip would stay the same?
Title: Re:Winsocks Api
Post by: Skywing on May 28, 2003, 01:22 PM
Quote from: Maddox on May 27, 2003, 11:32 PM
You can just send chr(23) and chr(224) for the port.

There are no special API calls needed.
I'd recommend not hardcoding 6112 in a nonobvious way, especially since Blizzard's now planning to change the Battle.net port.
Title: Re:Winsocks Api
Post by: l)ragon on May 28, 2003, 07:27 PM
Quote from: Maddox on May 28, 2003, 04:51 PM
Quote from: Skywing on May 28, 2003, 01:22 PM
Quote from: Maddox on May 27, 2003, 11:32 PM
You can just send chr(23) and chr(224) for the port.

There are no special API calls needed.
I'd recommend not hardcoding 6112 in a nonobvious way, especially since Blizzard's now planning to change the Battle.net port.

How do you know?  :D

Bacause he is God 9p
Title: Re:Winsocks Api
Post by: SiMi on May 28, 2003, 10:27 PM
but for some reason its not working.... What can be wrong?
Title: Re:Winsocks Api
Post by: c0ol on May 29, 2003, 02:36 PM
ports arent usually a DWORD, they are usually an unsigned short, or WORD in win32 terms.
Title: Re:Winsocks Api
Post by: Tazo on May 29, 2003, 03:14 PM
he put word..
Title: Re:Winsocks Api
Post by: SiMi on May 29, 2003, 11:16 PM
here is the full thing:
Blah = Split(GetStuff("Main", "Server"), ".")
InsertByte &H4
InsertByte &H1
InsertWORD 6112
   For i = LBound(Blah) To UBound(Blah)
           InsertBYTE CStr(Blah(i))
   Next i
InsertByte &H0
SendPacket Ws

can anyone tell me whats wrong with it now?
Title: Re:Winsocks Api
Post by: SiMi on June 01, 2003, 03:18 PM
i got what i had to do with the port but now what do i with the ip?
Title: Re:Winsocks Api
Post by: UserLoser on June 03, 2003, 05:51 PM
Here's my method and it works great...

(BYTE) 0x04
(BYTE) 0x01
(WORD) 6112 - Reversed
(DWORD) IP of destination
(STRING) User ID
(BYTE) 0x00

-- OR -- for the PORT you could do

(BYTE) 0x17
(BYTE) 0xE0

--

For the Destination IP, use inet_addr()
Declare Function inet_addr Lib "ws2_32" (ByVal IP As String) As Long

--

When the proxy sends you back 0x5A, then you can begin sending the normal packets used for Battle.net.

--
Edit:
--
Err.... I don't think that will work, I think it's missing some bytes, not sure since I don't have my packet logs from before...
Title: Re:Winsocks Api
Post by: SiMi on June 03, 2003, 11:06 PM
thanks userloser ill try it out your method later.
Title: Re:Winsocks Api
Post by: Camel on June 03, 2003, 11:27 PM
Quote from: c0ol on May 29, 2003, 02:36 PM
ports arent usually a DWORD, they are usually an unsigned short, or WORD in win32 terms.

Short and Long have been known to change definition with different processors/languages. WORD has not. 8)
Title: Re:Winsocks Api
Post by: Adron on June 04, 2003, 04:44 AM
The definition of what's a word changes a lot between processors. The only processors it has stayed much the same on are the processors that work on multiples of 8 bits.
Title: Re:Winsocks Api
Post by: UserLoser on June 04, 2003, 11:20 AM
Quote from: SiMi on June 03, 2003, 11:06 PM
thanks userloser ill try it out your method later.
Where's the +1 on my karma? :(
Title: Re:Winsocks Api
Post by: Yoni on June 04, 2003, 02:21 PM
-1 to UserLoser for requesting a +1