• Welcome to Valhalla Legends Archive.
 

Winsocks Api

Started by SiMi, May 27, 2003, 08:29 PM

Previous topic - Next topic

SiMi

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

SiMi

so im thinking the ip would stay the same?

Skywing

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.

l)ragon

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
*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*ˆ¨¯¯¨ˆ*^~·.,l)ragon,.-·~^*ˆ¨¯¯¨ˆ*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*

SiMi

but for some reason its not working.... What can be wrong?

c0ol

ports arent usually a DWORD, they are usually an unsigned short, or WORD in win32 terms.

Tazo


SiMi

#7
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?

SiMi

i got what i had to do with the port but now what do i with the ip?

UserLoser

#9
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...

SiMi

#10
thanks userloser ill try it out your method later.

Camel

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)

Adron

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.

UserLoser

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? :(

Yoni

-1 to UserLoser for requesting a +1