• Welcome to Valhalla Legends Archive.
 

socks4 problems

Started by Tazo, December 21, 2005, 03:11 PM

Previous topic - Next topic

Tazo

I am connecting to my socks server fine, but I am receiving my packets from bnet in clumps!

3  192.168.2.62:1732  200.117.129.160:1080  59  Send 
0000  01 FF 50 3A 00 00 00 00 00 36 38 58 49 56 44 32    ..P:.....68XIVD2
0010  44 0B 00 00 00 00 00 00 00 00 00 00 00 80 04 00    D...............
0020  00 33 10 00 00 33 10 00 00 55 53 41 00 55 6E 69    .3...3...USA.Uni
0030  74 65 64 20 53 74 61 74 65 73 00                   ted States.

4  200.117.129.160:1080  192.168.2.62:1732  106  Recv 
0000  FF 25 08 00 58 9D C8 81 FF 50 62 00 00 00 00 00    .%..X....Pb.....
0010  DB 8D 86 74 7E 72 23 00 00 AC 41 43 25 0B C5 01    ...t~r#...AC%...
0020  49 58 38 36 76 65 72 31 2E 6D 70 71 00 41 3D 39    IX86ver1.mpq.A=9
0030  39 32 30 33 37 36 38 38 20 42 3D 35 33 39 38 37    92037688 B=53987
0040  30 30 30 20 43 3D 35 39 33 38 37 33 35 31 38 20    000 C=593873518
0050  34 20 41 3D 41 2D 53 20 42 3D 42 2B 43 20 43 3D    4 A=A-S B=B+C C=
0060  43 2B 41 20 41 3D 41 5E 42 00                      C+A A=A^B.

Is there anything I can do to fix this? I cannot parse packets when they are received 2 at a time  :-\ btw: 200.117.129.160:1080 is a proxy, and 192.168.2.62 is my router IP.

MyndFyre

QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Tazo

hmm..no luck..am i grabbing data right?

Private Sub sckBnet_DataArrival(ByVal bytesTotal As Long)
Dim strTemp$
sckBnet.GetData strTemp, vbString
Select Case Mid(strTemp, 2, 1)
    Case Chr(&H5A)
        AddText vbGreen, "SOCKS Request Granted, beginning battle.net connection."
        sckBnet.SendData Chr(1)
        Packet50
    Case Else
         Parse(strTemp)
End Select
End Sub

Also, my packet 50:

Public Sub Packet50()
        Clear
        InsertDWORD &H0
        InsertNonNTString "68XIVD2D"
        InsertDWORD &HB
        InsertDWORD &H0
        InsertDWORD &H0
        InsertDWORD &H480
        InsertDWORD &H1033
        InsertDWORD &H1033
        InsertNTString "USA"
        InsertNTString "United States"
        SendPacket &H50
End Sub

--sendpacket--

Public Function SendPacket(PacketID As Byte)
    If sckBnet.State <> 7 Then Exit Function
        Me.sckBnet.SendData Chr(&HFF) & Chr(PacketID) & MakeWORD(Len(buffer) + 4) & buffer
    Clear
End Function

Does everything look right? because now, I get disconnected after sending 0x50 and I receive nothing from bnet..  :-\

Kp

Quote from: Tazo on December 21, 2005, 03:11 PM
I am connecting to my socks server fine, but I am receiving my packets from bnet in clumps!

Is there anything I can do to fix this? I cannot parse packets when they are received 2 at a time  :-\

You're doomed.  It's highly likely that TCP will do the same thing to you whether you use a SOCKS proxy or not.  Also, why're you using SOCKS4?  SOCKS5 has been out for ages...

Quote from: Tazo on December 21, 2005, 06:43 PMDoes everything look right? because now, I get disconnected after sending 0x50 and I receive nothing from bnet..  :-\

No, there's a lot of VB code there.  That's never a good sign.  Being disconnected also indicates a problem. :)  As is typically advised when people complain that they're falling offline, I'll suggest to you that you post what's being sent and received.  It's much easier to analyze that for correctness than to try to determine whether your code is constructing the message correctly, particularly when you don't post all of your code.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Eric

Packet headers exist for a reason.

MyndFyre

Quote from: Tazo on December 21, 2005, 09:11 PM
I got to connecting fine, however packets are still clumping up and I am still yet to find a solution..
OH MY GOD.  Did you not read what I suggested?  Let me quote from this thread
Quote
that I cited in this post:

Quote from: MyndFyre on November 22, 2005, 03:36 PM
Don't count on it always being there.  The recv (or if you're using VB, DataReceived) function should specify how long your packet was (how much data was received).  Always check that against the header-specified length to see whether you need to extract more data from the packet.

Let me re-emphasize:
Quote from: MyndFyre on November 22, 2005, 03:36 PM
Don't count on it always being there.  The recv (or if you're using VB, DataReceived) function should specify how long your packet was (how much data was received).  Always check that against the header-specified length to see whether you need to extract more data from the packet.

It is able and EASY to split packets.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Tazo

i just sorta skimmed through the thread, thnks Mynd, I've had about 5  hrs of sleep  ::) thanks again