Results 1 to 14 of 14
  1. #1
    New's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Location
    Location:
    Posts
    2,599
    Reputation
    386
    Thanks
    4,710
    My Mood
    Angelic

    Connecting to the proxy server.

    so.

    i was making a thing so i could connect to the proxy server.

    i swear to god if anyone says "just use krelay" ill fkin do something

    So proxy server connects to 127.0.0.1 2050.

    When you listen on that port, you get no errors. But the game does not start. Why? Because the game tries to send packets to the server to connect.

    Right now the game is trying to connect to local 2050, but local 2050 only listens on that port, it doesnt do anything.

    So I started making a program. At start it listens on 127.0.0.1 port 2050
    Then it receives all packets send there. Like the hello packet the game tries to send to the server.

    So I would need to send that hello packet to the server right? Because thats what the game tries to do if you're not connected to the proxy server.

    The game tries to send packets to the server, the server responds with its own packet, the game sees it and sends more etc..



    So I would think that if I made something that forwards the packets from the game to the server, I could then receive any responses and send them to the 127.0.0.1 2050.

    However look at my code.
    Code:
    Imports System.Net.Sockets
    Imports System.Net
    
    Module Module1
        Dim listener As TcpListener = New TcpListener(IPAddress.Parse("127.0.0.1"), 2050)
        Dim textz As String
        Dim texts As String 'the one server sent
        Dim clientsendpacket As Boolean = False
        Dim serversendpacket As Boolean = False
        Sub Main()
            getfrom()
            Console.ReadLine()
    
        End Sub
        Sub sendto()
            Dim txp As TcpClient = New TcpClient
            txp.Connect("52.77.221.237", 2050)
            Console.WriteLine("> Connected to Game Server")
            Using ns As NetworkStream = txp.GetStream
                While True
                    Do Until clientsendpacket = True
    
                    Loop
                    Try
                        Dim msg As Byte() = System.Text.Encoding.ASCII.GetBytes(textz)
                        ns.Write(msg, 0, msg.Length)
                        Console.WriteLine("> Packet send to Game Server")
                        clientsendpacket = False
                    Catch ex As Exception
                        Console.WriteLine("DAMN IT FUCK SHIT")
                        MsgBox(ex.ToString)
                    End Try
                    Dim receive(255) As Byte
                    Dim length As Integer = ns.Read(receive, 0, receive.Length)
                    texts = System.Text.Encoding.ASCII.GetString(receive, 0, length)
                    Console.WriteLine(texts.Length.ToString)
                    serversendpacket = True
                End While
    
            End Using
        End Sub
        Sub getfrom()
            listener.Start()
            Console.WriteLine("Listening on 127.0.0.1, port 2050.")
            Dim tcp As TcpClient = listener.AcceptTcpClient
            Using ns As NetworkStream = tcp.GetStream
                If True Then
                    Console.WriteLine("> Client connected to local")
                End If
                While True
                    Try
                        Dim receive(255) As Byte
                        Dim length As Integer = ns.Read(receive, 0, receive.Length)
                        textz = System.Text.Encoding.ASCII.GetString(receive, 0, length)
                        Console.WriteLine("> Packet received from client")
                        clientsendpacket = True
                    Catch ex As Exception
                        Console.WriteLine("WTF?")
                        MsgBox(ex.ToString)
                        Return
                    End Try
                    'Forward to server
                    Try
                        sendto()
                    Catch ex As Exception
                        Console.WriteLine(ex.ToString)
                    End Try
                    Do Until serversendpacket = True
    
                    Loop
    
                    Dim msg As Byte() = System.Text.Encoding.ASCII.GetBytes(texts)
                    ns.Write(msg, 0, msg.Length)
                    serversendpacket = False
                End While
            End Using
    
    
    
        End Sub
    
    End Module
    Especially this piece
    Code:
                    Dim receive(255) As Byte
                    Dim length As Integer = ns.Read(receive, 0, receive.Length)
                    texts = System.Text.Encoding.ASCII.GetString(receive, 0, length)
    When the hello packet is send, I dont receive any response from the server. Which is weird.


    I think it could be from the encoding, the server doesnt understand it? idk.

    Help is appreciated.
    New

    Current Project:
    SimpleExaltHack

    Outdated stuff I made in the past:
    Famebot
    Clientless tradebot
    RotMG ping checker
    Zautonexus crack

  2. #2
    PimpOrPosh's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Posts
    44
    Reputation
    10
    Thanks
    15
    Is that... Visual basic? xD

  3. #3
    Kushala Daora's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Location
    RealmSupply
    Posts
    1,075
    Reputation
    73
    Thanks
    643
    My Mood
    Angelic
    Quote Originally Posted by PKTINOS View Post
    So proxy server connects to 127.0.0.1 2050.
    When you listen on that port, you get no errors. But the game does not start. Why?
    Right now the game is trying to connect to local 2050, but local 2050 only listens on that port, it doesnt do anything.
    TcpListener is for Client <--> Proxy communication. The proxy then forwards client information to the server via TcpClient.

    If the client isn't getting the Connected! message then there is something wrong with your listener.

    Unless you're trying to do something totally different?
    Last edited by Kushala Daora; 08-11-2016 at 11:17 AM.

    "There is no higher form of user validation than having customers support your product with their wallets." ~ Google


  4. #4
    New's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Location
    Location:
    Posts
    2,599
    Reputation
    386
    Thanks
    4,710
    My Mood
    Angelic
    Quote Originally Posted by Kushala Daora View Post
    Unless you're trying to do something totally different?
    Trying to make the game connect to say "USW" from the proxy server.

    It does say connected!



    But the Game Server doesnt send me any responses to the packet I send.

    And yeah the client doesnt go in game obviously, because it doesnt get any response to its hello packet.

    - - - Updated - - -

    Quote Originally Posted by PimpOrPosh View Post
    Is that... Visual basic? xD
    saddap kieron xd
    New

    Current Project:
    SimpleExaltHack

    Outdated stuff I made in the past:
    Famebot
    Clientless tradebot
    RotMG ping checker
    Zautonexus crack

  5. #5
    Kushala Daora's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Location
    RealmSupply
    Posts
    1,075
    Reputation
    73
    Thanks
    643
    My Mood
    Angelic
    Quote Originally Posted by PKTINOS View Post
    But the Game Server doesnt send me any responses to the packet I send.
    And yeah the client doesnt go in game obviously, because it doesnt get any response to its hello packet
    After the client sends the hello, the server responds with a MapInfo, then the client responds back with create/load.

    It's either you're not listening for the MapInfo or something is wrong with the hello packet.

    "There is no higher form of user validation than having customers support your product with their wallets." ~ Google


  6. #6
    New's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Location
    Location:
    Posts
    2,599
    Reputation
    386
    Thanks
    4,710
    My Mood
    Angelic
    Quote Originally Posted by Kushala Daora View Post
    After the client sends the hello, the server responds with a MapInfo, then the client responds back with create/load.

    It's either you're not listening for the MapInfo or something is wrong with the hello packet.
    Code:
     Dim receive(255) As Byte
                    Dim length As Integer = ns.Read(receive, 0, receive.Length)
                    texts = System.Text.Encoding.ASCII.GetString(receive, 0, length)
    I do listen for the mapinfo, but I think it falls off at me sending the hello packet.

    This is how I receive the hello packet:
    Code:
     Dim receive(255) As Byte
                        Dim length As Integer = ns.Read(receive, 0, receive.Length)
                        textz = System.Text.Encoding.ASCII.GetString(receive, 0, length)
                        Console.WriteLine("> Packet received from client")
    see how I convert it to a string with system.text.encoding.ascii.getstring

    and this is how I send it to the game server, converting it back to bytes.

    Code:
     Dim msg As Byte() = System.Text.Encoding.ASCII.GetBytes(textz)
                        ns.Write(msg, 0, msg.Length)
    Is this the correct way? Getting the bytes -> convert to ascii -> convert to bytes -> send to server (?)

    And

    Is there any better way of, instead of going thru the process of encoding / decoding the packet, instead send it immidiately, its received, and automatically sent, that would be optimal.
    New

    Current Project:
    SimpleExaltHack

    Outdated stuff I made in the past:
    Famebot
    Clientless tradebot
    RotMG ping checker
    Zautonexus crack

  7. #7
    Kushala Daora's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Location
    RealmSupply
    Posts
    1,075
    Reputation
    73
    Thanks
    643
    My Mood
    Angelic
    Quote Originally Posted by PKTINOS View Post
    Code:
     Dim receive(255) As Byte
                    Dim length As Integer = ns.Read(receive, 0, receive.Length)
                    texts = System.Text.Encoding.ASCII.GetString(receive, 0, length)
    OHHH I see your problem. You need to encrypt and unencrypt the packets to and from RC4. Other than the hello packet (which the server will accept in raw form), you'll need to de encrypt the packets the server sends.

    If you need just use the rc4 cipher from krelay and pass the information through there.

    "There is no higher form of user validation than having customers support your product with their wallets." ~ Google


  8. #8
    New's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Location
    Location:
    Posts
    2,599
    Reputation
    386
    Thanks
    4,710
    My Mood
    Angelic
    Quote Originally Posted by Kushala Daora View Post
    OHHH I see your problem. You need to encrypt and unencrypt the packets to and from RC4. Other than the hello packet (which the server will accept in raw form), you'll need to de encrypt the packets the server sends.

    If you need just use the rc4 cipher from krelay and pass the information through there.
    But I send the hello packet and the response comes after multiple seconds, and it's literally a question mark, and its only 1 in length (message.Length) so idk
    New

    Current Project:
    SimpleExaltHack

    Outdated stuff I made in the past:
    Famebot
    Clientless tradebot
    RotMG ping checker
    Zautonexus crack

  9. #9
    Kushala Daora's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Location
    RealmSupply
    Posts
    1,075
    Reputation
    73
    Thanks
    643
    My Mood
    Angelic
    Quote Originally Posted by PKTINOS View Post
    But I send the hello packet and the response comes after multiple seconds, and it's literally a question mark, and its only 1 in length (message.Length) so idk
    The game was just updated so update your hello packet too.

    "There is no higher form of user validation than having customers support your product with their wallets." ~ Google


  10. #10
    New's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Location
    Location:
    Posts
    2,599
    Reputation
    386
    Thanks
    4,710
    My Mood
    Angelic
    Quote Originally Posted by Kushala Daora View Post
    The game was just updated so update your hello packet too.
    dude no, im not sending the hello packets, the game is. and if I open the game with krelay it works.

    im listening on 127.0.0.1 2050 and im on proxyserver so i just forward the packets from the game to me and from me to the server and vice versa
    New

    Current Project:
    SimpleExaltHack

    Outdated stuff I made in the past:
    Famebot
    Clientless tradebot
    RotMG ping checker
    Zautonexus crack

  11. #11
    CheesyWesy's Avatar
    Join Date
    Aug 2016
    Gender
    male
    Posts
    5
    Reputation
    10
    Thanks
    0
    My Mood
    Tired
    I don't know anything about this coding and such,so can someone reply the download link when/if they're done? Thanks a bunch guys,really appreciate it!
    Last edited by CheesyWesy; 08-11-2016 at 01:42 PM.

  12. #12
    Kushala Daora's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Location
    RealmSupply
    Posts
    1,075
    Reputation
    73
    Thanks
    643
    My Mood
    Angelic
    Quote Originally Posted by PKTINOS View Post
    im listening on 127.0.0.1 2050 and im on proxyserver so i just forward the packets from the game to me and from me to the server and vice versa
    You're doing it fine, like I said, just need to encrypt and unencrypt with RC4.

    "There is no higher form of user validation than having customers support your product with their wallets." ~ Google


  13. #13
    New's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Location
    Location:
    Posts
    2,599
    Reputation
    386
    Thanks
    4,710
    My Mood
    Angelic
    Quote Originally Posted by Kushala Daora View Post
    You're doing it fine, like I said, just need to encrypt and unencrypt with RC4.
    But you said the hello packet which was sent at the start didn't need encryption :s. Anyways ill try that and post back results later.
    Does KRelay have the current RC4 encryption key?
    New

    Current Project:
    SimpleExaltHack

    Outdated stuff I made in the past:
    Famebot
    Clientless tradebot
    RotMG ping checker
    Zautonexus crack

  14. #14
    Kushala Daora's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Location
    RealmSupply
    Posts
    1,075
    Reputation
    73
    Thanks
    643
    My Mood
    Angelic
    Quote Originally Posted by PKTINOS View Post
    But you said the hello packet which was sent at the start didn't need encryption :s. Anyways ill try that and post back results later.
    Does KRelay have the current RC4 encryption key?
    It does. //////

    "There is no higher form of user validation than having customers support your product with their wallets." ~ Google


Similar Threads

  1. connect to the steam server
    By m!lchshake in forum Realm of the Mad God Discussions
    Replies: 1
    Last Post: 06-10-2013, 12:26 PM
  2. [Help Request] Having trouble connecting to the EU server
    By vihbu in forum Combat Arms EU Help
    Replies: 2
    Last Post: 04-13-2013, 12:24 PM
  3. [Solved] Cannot connect to the master server on iBerianOps Black Ops
    By Harrabed in forum Call of Duty Black Ops Help
    Replies: 3
    Last Post: 03-20-2013, 05:58 AM
  4. MCP Can't get connect to the source server
    By xfightsport in forum Minecraft Help
    Replies: 1
    Last Post: 01-26-2012, 12:19 PM
  5. [Help Request] Can not connect to the online-server
    By jabbathehutt in forum Call of Duty Modern Warfare 3 Help
    Replies: 6
    Last Post: 12-10-2011, 04:57 AM