Briefing: This tutorial is meant to teach you how to make a redirector, from scratch. It will not include any code, it will explain the concepts behind making a redirector in-depth, however. All you need to know is how to use the TCP networking library in your favorite programming language.
Imagine the following scenario:
On your computer you have MapleStory. Now, the client is a vanilla one (completely unedited). By default, the client will try reaching out to Nexon's servers. This is the behavior we're going to alter with our redirector.
Conceptually, this works like so:
All traffic is rerouted through our app (the redirector), from the client to the server and back.
How to actually achieve this
You set up a tcp server (bound to localhost:8484) in your redirector and wait for an incoming connection. Once a connection is established, you make a new TCP connection to your server's loginserver; once your server accepts the connection, you simply "pipe" the packets across, like so:
Data sent in the direction of the arrow. Red represents a TCP connection, green represents the pipe your program must implement. Generally, this is as easy as piping an input stream into an output stream.
This is how a redirector works internally. It's dead simple yet elegant. However, we're still missing one final step.
Derouting Nexon's IP
A simple, clever hack that makes any and all traffic sent to a certain IP be derouted to the local host. Without this step, your redirector will not work!
This can be achieved with the netsh int ip command line utility. Read the documentation and figure out how to do it yourself
Important information
If you pipe only port 8484 (login), your game will crash after entering pin/pic. To fix this, you must pipe your channel ports (generally 8585 on) as well as your cash shop port (8610). Check your source for these values, though.
Either way, a TCP connection is closed (in favor of a new one) once you enter the game(login->channel), change channel (channelA->channelB), enter cs (channel->cs), leave cs (cs->channel) and log out (channel->login).
In other words, the game will only have one active connection at a time and its port number will change, be ready to deal with that
You should take this into account, since if you don't have a TCP server ready to accept a new connection on that port, your game will crash.
If I missed anything or you have any questions, put them below.
Enjoy!
Imagine the following scenario:
On your computer you have MapleStory. Now, the client is a vanilla one (completely unedited). By default, the client will try reaching out to Nexon's servers. This is the behavior we're going to alter with our redirector.
Conceptually, this works like so:
All traffic is rerouted through our app (the redirector), from the client to the server and back.
How to actually achieve this
You set up a tcp server (bound to localhost:8484) in your redirector and wait for an incoming connection. Once a connection is established, you make a new TCP connection to your server's loginserver; once your server accepts the connection, you simply "pipe" the packets across, like so:
Data sent in the direction of the arrow. Red represents a TCP connection, green represents the pipe your program must implement. Generally, this is as easy as piping an input stream into an output stream.
This is how a redirector works internally. It's dead simple yet elegant. However, we're still missing one final step.
Derouting Nexon's IP
A simple, clever hack that makes any and all traffic sent to a certain IP be derouted to the local host. Without this step, your redirector will not work!
This can be achieved with the netsh int ip command line utility. Read the documentation and figure out how to do it yourself
Important information
If you pipe only port 8484 (login), your game will crash after entering pin/pic. To fix this, you must pipe your channel ports (generally 8585 on) as well as your cash shop port (8610). Check your source for these values, though.
Either way, a TCP connection is closed (in favor of a new one) once you enter the game(login->channel), change channel (channelA->channelB), enter cs (channel->cs), leave cs (cs->channel) and log out (channel->login).
In other words, the game will only have one active connection at a time and its port number will change, be ready to deal with that
You should take this into account, since if you don't have a TCP server ready to accept a new connection on that port, your game will crash.
If I missed anything or you have any questions, put them below.
Enjoy!
Attachments
You must be registered for see attachments list
Last edited: