Register for your free account! | Forgot your password?

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

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

Advertisement



Creating a simple clientless login using Silkroad.Net

Discussion on Creating a simple clientless login using Silkroad.Net within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2008
Posts: 56
Received Thanks: 50
Creating a simple clientless login using Silkroad.Net

Hi, I recently got back into the game and decided I want to familiarize myself with packets. I've noticed that there are a lot of resources available, which is very nice to see, however the majority of these resources are meant/made for vsro. I've been 'playing' GameGami's TRSRO and thought, why not give it a shot and try to mess around with the latest iSRO/TRSRO packets. This way I learn more about how Silkroad works under the hood, and at the same time I pick up some stuff about networking and C#.

My programming knowledge is Java for the most part, as most of my 9-5 day consists of programming in Java. So I thought I'd use the Silkroad.Net wrapper that was made for the SilkroadSecurityApi, since C# comes pretty close to Java.
So I took a shot at creating a simple program that attempts to clientlessly login to the TRSRO servers. However, since there's not many resources on the latest iSRO packets, data and whatnot, I'm getting stuck on some things. I managed to get up to the point where the program logs in, sends the secondary passcode and receives a valid/invalid response. After that, the program crashes due to it being unable to parse the incoming stream of data (I am assuming).
The following exception is thrown:
Code:
Unhandled exception. System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'Length')
   at Silkroad.Security.Blowfish.Decrypt(Span`1 input) in C:\Users\burak\RiderProjects\Silkroad.Net\Silkroad\Security\Blowfish.cs:line 272
   at Silkroad.Network.Messaging.Protocol.MessageProtocol.Decode(MessageSize size, Span`1 buffer) in C:\Users\burak\RiderProjects\Silkroad.Net\Silkroad\Network\Messaging\Protocol\MessageProtocol.cs:line 60
   at Silkroad.Network.Session.ReceiveAsync() in C:\Users\burak\RiderProjects\Silkroad.Net\Silkroad\Network\Session.cs:line 252
   at Silkroad.Network.Session.RunAsync() in C:\Users\burak\RiderProjects\Silkroad.Net\Silkroad\Network\Session.cs:line 356
   at SimpleClientless.Program.Main(String[] args) in C:\Users\burak\RiderProjects\Silkroad.Net\SimpleClientless\Program.cs:line 32
   at SimpleClientless.Program.<Main>(String[] args)
Since I am not very familiar with the SilkroadSecurity api, I was wondering if there are people who can help me and figure out what could be going wrong in my program.

Also there are some bytes in some packets that I was unable to parse myself, and was wondering if you guys have been able to. For example this one:
Code:
Message login = new Message(Opcodes.Gateway.Request.LOGIN2, true);
login.Write((byte) Local.SRO_TR_Official_GameGami);
login.Write(UserName, Encoding.Default);
login.Write(Password, Encoding.Default);
                
// Unknown 6 bytes (for now)
login.Write<ushort>(123);
login.Write<ushort>(456);
login.Write<ushort>(789);
                
login.Write(servers["Misis"].Id);
login.Write<byte>(1);
The source is available on my GitHub:

I'm also down to talk on Discord: Burak#5201

Update 19/06:
I decided to create an implementation in the original SilkroadSecurityApi. I did this so I could familiarize myself with the original api. See source code here:

Update 19/06 v2:
It is now possible to log in, select a character and join the game world. I've also added some pretty messages to login errors.

I shall delve deeper into the original api. Any form of feedback is always appreciated.
brklol is offline  
Thanks
2 Users
Old 06/19/2021, 00:13   #2
 
elite*gold: 0
Join Date: Jan 2009
Posts: 314
Received Thanks: 686
This seems to contain the protocol code I originally wrote for .
When the project was abandoned the implementation was still unstable and won't be updated by me. I don't know if 'zefiers' put any work into testing or stabilizing it.
You might want to try the original SilkroadSecurityApi from Drew Benton to rule out any protocol bugs I might've introduced.
DaxterSoul is offline  
Old 06/19/2021, 00:30   #3
 
elite*gold: 0
Join Date: Aug 2008
Posts: 56
Received Thanks: 50
Quote:
Originally Posted by DaxterSoul View Post
This seems to contain the protocol code I originally wrote for .
When the project was abandoned the implementation was still unstable and won't be updated by me. I don't know if 'zefiers' put any work into testing or stabilizing it.
You might want to try the original SilkroadSecurityApi from Drew Benton to rule out any protocol bugs I might've introduced.
Yeah I figured it might be better to become familiar with the original SilkroadSecurityApi to fully understand how if works, as the current one I'm using is a high level wrapper. I'll take a look at it, thanks

Today I took a shot at implementing the same clientless login in the original security api. And without surprise, everything works smoothly with the original api.

Source code was attached to the original post.
brklol is offline  
Old 07/06/2021, 13:06   #4
 
zefiers's Avatar
 
elite*gold: 0
Join Date: Jul 2021
Posts: 1
Received Thanks: 1
I am actually surprised to see that anyone is paying some attention to this project, a lot of people fear of trying something new, especially in this scene, yet me either is not paying attention to it recently as a result of being busy. Just as 'DaxterSoul' mentioned above this wrapper was actually extracted from project 'Phoenix' and yet I left a copyright note in the 'License' section in the README file at GitHub.

However it was planned to get this project 'Silkroad.Net' into a fully wrapper. but I'm just busy atm.
Feel free to contribute, and I will do the same after finishing what I'm doing atm.
However you should have created Issue in GitHub I would have seen this earlier.

Back to the problem, also I don't have much time atm, but may I ask why you are using [Encoding.Default] when writing Strings into the Packet/Message? Normally SRO uses ASCII but ISRO sometimes uses 'UTF16' especially with Packets/Messages related to the in-game chat. Encoding is not something that you choose based on your opinion.

In the current situation, the Login Message should be encoded in ASCII, this should work.

Also I have pushed a CRITICAL bug fix in the repo just a moment ago, make sure to check it out.
zefiers is offline  
Thanks
1 User
Old 07/13/2021, 14:12   #5
 
elite*gold: 0
Join Date: Apr 2015
Posts: 56
Received Thanks: 28
You can also take a look on the sro server emulator I'm working on. At least the protocol seems to be stable for VSRO 188. It has client and server protocol implemented.

Here's the link:

If you have any questions regarding the code, just leave me a message
pumpya19 is offline  
Reply


Similar Threads Similar Threads
[Guide] Creating a Simple Loader with Injected DLL for Silkroad
02/02/2016 - SRO Coding Corner - 37 Replies
This next article in my series is a very important one for anyone wanting to get started with client modifications or understanding the client itself. This is the base article that will be used for all my future articles that explain various Silkroad development concepts. Like my previous article, there is nothing terribly exciting with this one as we have to get through the necessary boring stuff first before we can have any real fun. Unfortunately, this article is very heavy text wise and...
[Guide] Using edxSilkroadProxy to Create a Simple AutoIt Clientless
11/09/2014 - SRO Coding Corner - 38 Replies
Warning: Do not use on ISRO due to the 7 day ban on a wrong opcode.. Use this only for educational purposes and a reference! Here it is! The third and final guide in my small series relating to the Silkroad proxy project. From here you will learn how to make a simple clientless that can spawn in game using the edxSilkroadProxy. Included is support for character listing and server stats. Be sure to read through the entire guide and code before trying to make your own version! Using...



All times are GMT +1. The time now is 06:39.


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.