• Welcome to Valhalla Legends Archive.
 

Proxy Help

Started by -Drew-, August 24, 2006, 12:57 AM

Previous topic - Next topic

-Drew-

alright, like i said in my previous post. i threw together proxy support pretty quickly after reading up on it. This is so far what i have. also like i said before, this will work with pvpgn servers but not bnet, after sending 0x50 i get disc'd. as of right now i am stumped. i've packetlogged and everything looks perfectly fine, but obviously isnt. any help with this would be greatly appreciated.



Private Sub bnSockets_Connect(Index As Integer)



    If BotMains(Index).IsProxy = 1 Then
        BotMains(Index).InProxy = True
        Dim Splt() As String, str As String, i As Integer
        BotMains(Index).ServerVar = LCase$(BotMains(Index).ServerVar)
        Splt = Split(BotMains(Index).ServerVar, ".")
        If IsNumeric(Splt(0)) = False Then
            ' If server is not an ip.
            Dim a
            a = GetIPFromHostName(BotMains(Index).ServerVar)
            Splt = Split(a, ".")
        End If
        For i = 0 To UBound(Splt)
            str = str & Chr(CStr(Splt(i)))
        Next i
        rtbAdd "Connected to ", vbGreen, BotMains(Index).Proxy & vbNewLine, vbWhite
        Socks.SendSocks Chr(&H4) & Chr(&H1) & Chr(&H17) & Chr(&HE0) & str & "anonymous" & Chr(&H0), bnsockets(Index)
        rtbAdd "Sending Socks Header packet." & vbNewLine, vbGreen
    Else
        rtbAdd "Connected to ", vbGreen, bnsockets(Index).RemoteHost & vbNewLine, vbWhite
        bnsockets(Index).SendData Chr(1)
        Call BotMains(Index).SendProductPacket(BotMains(Index).ProductVar)
        BotMains(Index).ConnUptime = GetTickCount()
    End If




   ' If BotMains(Index).SelectedVar = True Then
        'rtbAdd "Connected!" & vbNewLine, RGB(25, 87, 5)
    'End If

End Sub

Private Sub bnSockets_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim strBuffer As String, strTemp As String, lngLen As Long
Dim Data As String

If BotMains(Index).InProxy = True Then
    bnsockets(Index).GetData Data, vbString
    Call consAdd(DebugOutput(Data) & vbNewLine & vbNewLine, vbYellow)
End If

    If BotMains(Index).InProxy = True Then
       
        Select Case Mid(Data, 2, 1)
            Case Chr(&H5A)
                rtbAdd "SOCKS -> ", vbWhite, "Request granted." & vbNewLine, vbGreen
                rtbAdd "Connecting to Battle.net" & vbNewLine, vbGreen
                bnsockets(Index).SendData Chr(1)
                Call BotMains(Index).SendProductPacket(BotMains(Index).ProductVar)
                BotMains(Index).ConnUptime = GetTickCount()
                BotMains(Index).InProxy = False
                Exit Sub
            Case Chr(&H5B)
                rtbAdd "SOCKS -> ", vbWhite, "Request Rejected or Failed." & vbNewLine, vbRed
                bnsockets(Index).Close
                Exit Sub
            Case Chr(&H5C)
                rtbAdd "SOCKS -> ", vbWhite, "Request Rejected because SOCKS server cannot IDENT on the client." & vbNewLine, vbRed
                bnsockets(Index).Close
                Exit Sub
            Case Chr(&H5D)
                rtbAdd "SOCKS -> ", vbWhite, "Request Rejected because the Client Program and the ID Report Different User-IDs." & vbNewLine, vbRed
                bnsockets(Index).Close
                Exit Sub
        End Select
    Else
        Call BotMains(Index).PrepareParse(strTemp, Index)
    End If
   
   
   
End Sub

Mystical

soo much reading, atleast post a packet log with it, and make sure your using good proxys. kthx

-Drew-

like i said, i verified that the proxy and packets being sent looked correct, but here you go.


1  Hide  Hide  18  Send 
0000  04 01 17 E0 D3 E9 00 31 61 6E 6F 6E 79 6D 6F 75    .......1anonymou
0010  73 00                                              s.

2  Hide  Hide  8  Recv 
0000  00 5A 17 E0 D3 E9 00 31                            .Z.....1

3  Hide  Hide  67  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 FF 25 08 00 69    ted States..%..i
0040  1D 18 34                                           ..4


MysT_DooM

#3
It could be possible that connecting to the proxy itself request is good but then getting that proxy on bnet may be denied. Possibly proxy is ipbanned.


edit: if the proxy does work u can try changing in orange to all 0 since it wont break login. .insertdword &h0 etc 5 times after version byte and then dont send 0x25 and see if that will help.

But ur 0x50 looks fine everything in the right place etc.

Quote
3  Hide  Hide  67  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 FF 25 08 00 69    ted States..%..i
0040  1D 18 34                                           ..4


vb6, something about that combination of numbers and letters is sexy

topaz

Quotealright, like i said in my previous post. i threw together proxy support pretty quickly after reading up on it. This is so far what i have. also like i said before, this will work with pvpgn servers but not bnet, after sending 0x50 i get disc'd. as of right now i am stumped. i've packetlogged and everything looks perfectly fine, but obviously isnt. any help with this would be greatly appreciated.

Uh huh. This isn't your code.
RLY...?

Kp

Quote from: Topaz on August 24, 2006, 07:32 PM
Quotealright, like i said in my previous post. i threw together proxy support pretty quickly after reading up on it. This is so far what i have. also like i said before, this will work with pvpgn servers but not bnet, after sending 0x50 i get disc'd. as of right now i am stumped. i've packetlogged and everything looks perfectly fine, but obviously isnt. any help with this would be greatly appreciated.

Uh huh. This isn't your code.

How can you tell?  His writing is terrible and so is the code. :)
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Mystical

#6
my ruling is its copypasted code, that he's trying to get it to work with one another example
Dim strBuffer As String, strTemp As String, lngLen As Long
why are these in the sub and not used? :P someone forgot to takem out! =) when pasting!

by the looks of reviewing shouldn't this:
Call BotMains(Index).PrepareParse(strTemp, Index)
be
Call BotMains(Index).PrepareParse(Data, Index)
because:
bnsockets(Index).GetData Data, vbString


and this?
Socks.SendSocks Chr(&H4) & Chr(&H1) & Chr(&H17) & Chr(&HE0) & str & "anonymous" & Chr(&H0), bnsockets(Index)
this is kinda confusing? are you using a winsock class or somthing? or shouldn't this be somthing like..
bnsockets(index).SendData Chr(&H4) & Chr(&H1) & Chr(&H17) & Chr(&HE0) & str & "anonymous" & Chr(&H0)

topaz

Quote from: Kp on August 24, 2006, 09:00 PM
Quote from: Topaz on August 24, 2006, 07:32 PM
Quotealright, like i said in my previous post. i threw together proxy support pretty quickly after reading up on it. This is so far what i have. also like i said before, this will work with pvpgn servers but not bnet, after sending 0x50 i get disc'd. as of right now i am stumped. i've packetlogged and everything looks perfectly fine, but obviously isnt. any help with this would be greatly appreciated.

Uh huh. This isn't your code.

How can you tell?  His writing is terrible and so is the code. :)

He's not smart enough to do it on his own, and he types in all lowercase:

"Request Rejected or Failed."
"Request Rejected because SOCKS server cannot IDENT on the client."
"Request Rejected because the Client Program and the ID Report Different User-IDs."


also, his code has variables that he doesn't use.
RLY...?

-Drew-

ask for help and ya get critics? america...

actually most of the code is my own, like i said i wanted to throw it together quickly so learning how it works was from a little reading and a little copy and pasting. as for the other code, Botmains() etc... Botmains() is actually a class that i used a few years ago so i could do muliple logons with only one bot screen but use multiple chat buffers. i actually made this thing back when spawns could actually load in channels. i wanted it to be much like s0ul's Damnbot but i never have the time to tinker. so for the critics, thanks

topaz

Quote from: -Drew- on August 28, 2006, 09:46 PM
ask for help and ya get critics? america...

actually most of the code is my own, like i said i wanted to throw it together quickly so learning how it works was from a little reading and a little copy and pasting. as for the other code, Botmains() etc... Botmains() is actually a class that i used a few years ago so i could do muliple logons with only one bot screen but use multiple chat buffers. i actually made this thing back when spawns could actually load in channels. i wanted it to be much like s0ul's Damnbot but i never have the time to tinker. so for the critics, thanks

Bullshit. If you wrote a class that let you logon spawned clients, you wouldn't have problems like this. Quit stealing code and quit lying, someone might actually decide to help you then.
RLY...?

Mystical

If you read my full posts, you can see some problems with your code, and possible updates n changes... Read and see the help that was giving to you and not just the critize, but we know you didn't write this code.