Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 09:06

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Question] Why do we need redirect IP for communicating with the client?

Discussion on [Question] Why do we need redirect IP for communicating with the client? within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 130
Join Date: Mar 2008
Posts: 2,485
Received Thanks: 934
Question [Question] Why do we need redirect IP for communicating with the client?

Hey guys,

A guy here at epvp recently asked me this question, and I wondered why, too.
Can anyone explain IN DETAIL why do we need phconnector, nuconnector, and any other proxies to reach sro_client.exe? Yes, of course, bots and other programs, but why do THEY use localhost to communicate? It must have the reason...

Would help us a lot to understand the communication.


Thanks in advance.
intercsaki is offline  
Old 03/08/2013, 17:10   #2
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
A proxy like phConnector etc. usually has three sockets (i.e. network connections):

One socket connects to the GatewayServer (aka 'Login Server') and later it disconnects from the GatewayServer and can be reused to connect to the AgentServer (aka. 'Game Server').

The second socket is a server socket, usually listening on port 15779 and hostname localhost. This is the port that the client connects to.

The last socket is also a server socket, which listens on a user-defined port. The bot, alchemy tool or whatever (just called 'bot' after this) connects to this port. Using specially crafted packets (*) sent to this port, the bot can send packets to the client or the server via the proxy.

A schematic overview:



* Example of a possible header format:
uint16 - total length
uint16 - opcode (real opcode)
byte (bool) - direction flag (00: client, 01: server)
byte[] - data

From this header the proxy can gather all the information needed to send the packet it received from the bot (obviously with the right SRO packet header) to the right socket.

Edit: I just realised that I didn't really answer your question. So, why do we need a proxy? Well, we don't, really. Instead of a proxy we could hook the clients winsock imports and use them directly.

However, this has disadvantages. For example, every bot would need to have its own loader (a proxy can be reused by basically all bots or alchemy tools) to hook the functions, and it wouldn't be possible to host the clients on one PC and run the bots on another.

Edit 2: This post is based on the idea that the proxy and the bot are two separate applications. These days, more advanced bots have a built-in proxy that the client connects to, so only one application is needed.
lesderid is offline  
Thanks
4 Users
Old 03/08/2013, 17:19   #3
Chat Killer In Duty


 
PortalDark's Avatar
 
elite*gold: 5
Join Date: May 2008
Posts: 16,397
Received Thanks: 6,509
in other words, the proxy is used as a way to get the connection(to read/write packets) between client and server
for example
mBot has his own built-in proxy, so you wont need another
PortalDark is offline  
Thanks
1 User
Old 03/08/2013, 17:20   #4
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
Quote:
Originally Posted by PortalDark View Post
in other words, the proxy is used as a way to get the connection(to read/write packets) between client and server
for example
mBot has his own built-in proxy, so you wont need another
He asked to explain it in detail, so I did. :P
lesderid is offline  
Thanks
2 Users
Old 03/08/2013, 17:22   #5
Chat Killer In Duty


 
PortalDark's Avatar
 
elite*gold: 5
Join Date: May 2008
Posts: 16,397
Received Thanks: 6,509
Quote:
Originally Posted by lesderid View Post
He asked to explain it in detail, so I did. :P
i wanted to at the same time, what i read is what i think understood
PortalDark is offline  
Old 03/08/2013, 21:11   #6
 
elite*gold: 130
Join Date: Mar 2008
Posts: 2,485
Received Thanks: 934
Wow, it IS detailed. Thanks for that.

In the meantime I heard the same what you wrote down, that proxy is unnecessary but greatly advised, so it's good to feel confirmed.


An actual question, because I don't really get it: Why do we need "0/22 0 0" as arguments when we're starting sro process?
intercsaki is offline  
Old 03/08/2013, 21:25   #7
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
Quote:
Originally Posted by intercsaki View Post
Wow, it IS detailed. Thanks for that.

In the meantime I heard the same what you wrote down, that proxy is unnecessary but greatly advised, so it's good to feel confirmed.


An actual question, because I don't really get it: Why do we need "0/22 0 0" as arguments when we're starting sro process?
I have no idea to be quite honest, never looked into that. I suspect it might have something to do with the selected division and the locale, but I could be totally wrong. :P

Edit: From pushedx's edxSilkroadLoader_Lite:
Code:
std::stringstream args;
args << "0 /" << (int)data.divInfo.locale << " " << divindex << " " << ipindex;
lesderid is offline  
Thanks
1 User
Old 03/10/2013, 13:16   #8
 
LastThief*'s Avatar
 
elite*gold: 60
Join Date: Feb 2012
Posts: 3,942
Received Thanks: 6,474
Quote:
Originally Posted by intercsaki View Post
Wow, it IS detailed. Thanks for that.

In the meantime I heard the same what you wrote down, that proxy is unnecessary but greatly advised, so it's good to feel confirmed.


An actual question, because I don't really get it: Why do we need "0/22 0 0" as arguments when we're starting sro process?
locale stuff related to the client if you changed those arguments it'll never work
LastThief* is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Question] Autopot for vSro (without redirect)
10/08/2012 - SRO Private Server - 27 Replies
Hi guys, I'm playing on Perfection (pvp) server, and recently they have added protection, so we can't log in with mbot, etc. The thing is, the vsro autopot sucks like hell, using pots with about 3-5 secs delay (especially bad with eu characters), and I often have to use hp pot manually. In the old sjsro times, there was a keypresser autopot which you started after login, and worked like charm. Is there someone who knows an autopot similar to that? It would be hella great, then I...
QUESTION - redirect/detour IP of an .exe
05/05/2011 - General Coding - 3 Replies
Someone know how to do it? redirecting or detour the IP of an executable.. to localhost (127.0.0.1) --- Weiß einer wie das geht? umleiten einer IP bzw Verbindung von einer .exe zu localhost (127.0.0.1) ..
C# communicating with injected dll
05/17/2009 - CO2 Programming - 1 Replies
Soooo since injected dlls are in these days i wonder is it possible make gui in C# and call functions from the injected dll and how it should be done if anyone could poke me to right direction.
friend can't hit redirect client in dihydrotestosterone
03/01/2009 - Silkroad Online - 0 Replies
why can't he do this?
Friend can't click Client redirect in Dihydrotestosterone
03/01/2009 - Silkroad Online - 0 Replies
uhh why..



All times are GMT +1. The time now is 09:07.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.