Register for your free account! | Forgot your password?

You last visited: Today at 17:48

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

Advertisement



c++ Proxy

Discussion on c++ Proxy within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2009
Posts: 41
Received Thanks: 1
c++ Proxy

Im writing a c++ proxy similar to nuconnector, and have gotten it to accept the connection from the bot and sro_client. what's next? how do i send packets etc get security bytes?
kibbles18 is offline  
Old 11/28/2011, 08:23   #2
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,748
Received Thanks: 2,010
reinventing the wheel, aren't you?
Nezekan is offline  
Old 11/28/2011, 17:12   #3
 
kevin_owner's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 1,484
Received Thanks: 809
Take a look at some proxies by drew. It has a SilkroadSecurity class which generates those bytes for you. He also wrote an article about the silkroad security which you can find at scribd.com.

Or get one of his more recent releases the SilkroadSecurityApi which is written in C# but it shouldn't be a huge problem to convert it back to C++.

But like Nezekan also said it's kinda reinventing the wheel. NuConnector works fine and srproxy is also a nice one and there are a few others out there. Also the SilkroadSecurityApi which I just mentioned is a great library to create a proxy.
kevin_owner is offline  
Thanks
1 User
Old 11/29/2011, 00:37   #4
 
elite*gold: 0
Join Date: Feb 2009
Posts: 41
Received Thanks: 1
What are the security bytes for?
im the type that wants to know how things work so i always code everything from scratch
kibbles18 is offline  
Old 11/29/2011, 01:17   #5
 
theoneofgod's Avatar
 
elite*gold: 20
Join Date: Mar 2008
Posts: 3,940
Received Thanks: 2,211
Study Drews code. Drew is a legend in the Silkroad Online scene, so if you want reference, that is where you should look.
theoneofgod is offline  
Old 11/29/2011, 02:47   #6
 
elite*gold: 0
Join Date: Feb 2009
Posts: 41
Received Thanks: 1
ok but i hate how oop his code is makes it hard to read imo
kibbles18 is offline  
Old 11/29/2011, 17:31   #7
 
kevin_owner's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 1,484
Received Thanks: 809
Yeah his code is a bit hard to read cause it lacks of comments ect but it's at least something and he released it for free so I guess we should be happy for someone release such great things.

And the security bytes are just for the server to verify that it's really communicating with the client so it makes it harder for someone to create a bot or a clientless.

I'm also a guy who likes to reinvent the wheel and who wants to know how things are done in a program and how I got to know how that code worked was to create an own project add the code from drew's project till it works and then I started deleting/modifing parts to understand what it does.
kevin_owner is offline  
Thanks
1 User
Old 11/30/2011, 11:33   #8

 
elite*gold: 260
Join Date: Aug 2008
Posts: 560
Received Thanks: 3,779
To get a better idea of what is going on, try referring to the C# code instead. It's more modern and up to date compared to the C++ stuff I had released a long time ago, not to mention it probably has more comments. For C++ stuff, you want to just look over all my posted articles and code here on epvp. They are pretty outdated now and if I were coding them again today, they'd look a lot different, but that's just what happens as you become more experienced.

C++ just isn't a good language to use to try and convey new ideas or specific implementations to learn from, so that's why it's impossible to follow the code. Even I have trouble following some of my older stuff, but it's more because of how you have to approach programming when using C++ compared to other languages. That's a main reason I moved on from doing a lot of coding in C++ in favor of C#.

Anyways, there's a lot of concepts you have to be aware of to understand SilkroadSecurity. Overtime, as you learn them, you learn better ways to implement the API, which is why I had so many different versions over the years and never really came up with a "final solution".

First, you need to understand the concepts of TCP programming, Specifically, TCP is a stream of data, not a packet protocol like UDP. This means you have to buffer all your input data and then process it as you go along rather than all at once when you receive it. This is a big hurdle for a lot of people and even today commercial games still improperly use TCP.

Second, you need to understand the DH Key Exchange. This is part of the first steps for the Silkroad security. This is one of the most complex parts of the security, so it might take some time to understand everything going on.

Third, you just have to understand the Silkroad specific algos that are implemented and referenced in the code. There's no short cut in understanding this as you'd really have to reverse engineer them from the clients again to know what they were doing and your implementation in C++ would look just about the same as the code I have. So you can't really understand what's going on other than what you see in the code unless you talked to someone from Joymax that designed the system.

I wrote an article a while ago talking about the security, but it has some bugs and errors (for example, all my 0x7FF should be 0x7FFF). This was the very first version of my SecurityAPI, but I never got around to updating it. It's still mostly useful to get an idea about stuff though. It's attached to this post. A lot has changed since then too; I'd not recommend using WinSock API but rather a network library like boost::asio. It just makes life easier in the long run. It's more stuff to learn and work with, but it's just part of the deal when you use C++.

Once you understand the whole Silkroad Security system, you then have full control over the packet streams and can do whatever you want. If you are not familiar with proxy concepts, you can write a simple proxy to get started that doesn't use the API, but it won't work for the AgentServer connection unless you come up with a method to detour the client and connect to the correct address yourself (what I did for that to get started was simple write to a text file.)

Everything else you pretty much learn and get familiar with the more time you spend with it. For example, a lot of the design of my C# code might not seem apparent until you go through everything and then "discover" why it's setup as it is. It certainly does take time and patience, but if you are committed to learning about this stuff, you'll get it all down in time.
Attached Files
File Type: zip SilkroadSecurity.zip (678.5 KB, 223 views)
pushedx is offline  
Thanks
6 Users
Old 12/01/2011, 05:20   #9
 
elite*gold: 0
Join Date: Feb 2009
Posts: 41
Received Thanks: 1
thanks pushedx,
the proxy is coming along well i read thro the .pdf and created a connection to the server "121.128.133.30" port 15779 and now am in the process of processing the packets recieved. im just wondering how you reversed the packet structure yourself, like what did u look for to find the blowfish, security CRC etc.?


*first line of proxy.exe should say "proxy started" instead of "bot"
kibbles18 is offline  
Reply


Similar Threads Similar Threads
*Tutorial* How To Get A Free Proxy Or Find & Test A Proxy
03/17/2017 - SRO Hacks, Bots, Cheats & Exploits - 17 Replies
Tired of the IP limit and you want to make a ARMY on SRO!? In this tutorial i will give you WEBSITES where to get proxies & also test proxies, so that you dont have to keep testing it on your bot and waste TIME! Websites OF FREE PROXIES! Free Proxy List - Public Proxy Servers (IP PORT) - Hide My Ass! Socks5 Open Proxy List sorted by reliability column, descending
Proxy geht nicht/Proxy doesn´t work
08/10/2010 - Metin2 Private Server - 0 Replies
Folgendes Problem: Squid ist installiert. Startet anscheinend nicht richtig, funktioniert einfach nicht. Die Meldung welche kommt, wenn man startet: 2010/08/10 17:02:26| Starting Squid Cache version 2.7.STABLE9 for i386-portbld-freebsd7.1... 2010/08/10 17:02:26| Process ID 1952 2010/08/10 17:02:26| With 11095 file descriptors available 2010/08/10 17:02:26| Using kqueue for the IO loop



All times are GMT +1. The time now is 17:49.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.