Register for your free account! | Forgot your password?

Go Back   elitepvpers > Other Online Games > Browsergames > DarkOrbit
You last visited: Today at 08:04

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

Advertisement



[C#] DarkOrbit Encoding/Decoding from Netty

Discussion on [C#] DarkOrbit Encoding/Decoding from Netty within the DarkOrbit forum part of the Browsergames category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2012
Posts: 37
Received Thanks: 177
[C#] DarkOrbit Encoding/Decoding from Netty


Hello, today i bring you how to encode and decode the packets of the new darkorbit(which uses netty).

Dictionary:
Short - 2 bytes
Int - 4 bytes
Bool - 1 byte
Str or UTF - Short Length of String + String

The structure of the packets are:
1 - Short Length of all packet
2 - Short Packet ID
3 - Short version (normally 0)
4 - PACKET with shorts, ints, bools and strings (utf)


To encode/decode the bytes, you must use this functions:

And to read the packets or encode, you must use this 2 classes:

Example to use packetParser:
the first packet you receive from the client, apart from the policy, is id: 666.
To read:
Code:
int bytesRead = handler.EndReceive(ar);
if(bytesRead > 0)
{
    byte[] Body = new byte[bytesRead];
    Array.Copy(buffer, Body, bytesRead);

    packetParser packet = new packetParser(Body);
    if (packet.Id == 666)
    {
        Console.WriteLine(packet.ReadInt()); //Version Major
        Console.WriteLine(packet.ReadInt()); //Version Minor
        Console.WriteLine(packet.ReadInt()); //Version Build
    }
}
Example to use packetBuilder:
To respond to the version request (ID:666), you must build a packet like this:
Code:
packetBuilder enc = new packetBuilder(667);
enc.writeShort(0); // version
enc.writeBool(true);
enc.writeInt(0); //Version Major
enc.writeInt(0); //Version Minor
enc.writeInt(27); //Version Build

this.handler.Send(enc.GetBytes());
The Version Major, Minor and Build must be equal to which the client sent

SOMETHING INTERESTING:
To operate an upgraded server darkorbit is not necessary to start encryptions as ARC4 and IOW (InjectedObfuscationWrapper) because it are optional.

Credits
Me.
LittleJ.
Xdr1 is offline  
Thanks
18 Users
Old 05/18/2013, 13:59   #2
 
elite*gold: 0
Join Date: Oct 2009
Posts: 77
Received Thanks: 20
Also note the bitshifting and other obfuscations.
Also note that these functions are not just "these functions" but that "these functions" actually perform endianess conversion. That should help to understand it better.
Also note that using a "List<byte>" as a buffer for the "packetBuilder" class is inappropriate. For the sake of performance and correctness please use a different data structure or operate on streams for final victory and confirming to the .NET Framework programming style.
That being said "packetBuilder" becomes obselete, since you can simply create a endianness converting stream, conforming to the as3 spec of IDataOut-/Input.

Other than that, nice to see someone sharing code and thus information
general_lolichdissdich is offline  
Old 05/18/2013, 15:26   #3
 
V.I.R.U.S.'s Avatar
 
elite*gold: 0
Join Date: Nov 2010
Posts: 310
Received Thanks: 460
kapitan
V.I.R.U.S. is offline  
Old 05/18/2013, 16:12   #4
 
By-Soul's Avatar
 
elite*gold: 0
Join Date: Apr 2013
Posts: 49
Received Thanks: 21
What is this?
What is the purpose?
By-Soul is offline  
Old 05/18/2013, 16:26   #5
 
bestbots_support's Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 1,453
Received Thanks: 1,746
the purpose is you must remove the line under your name
"C# Html Css Asp JavaScpt"
bestbots_support is offline  
Thanks
8 Users
Old 05/18/2013, 17:28   #6


 
Requi's Avatar
 
elite*gold: 3570
The Black Market: 244/0/0
Join Date: Dec 2012
Posts: 13,044
Received Thanks: 8,252
Thanks, that you joined epvp
Requi is offline  
Reply


Similar Threads Similar Threads
[B] Ioncube DECODING [S]e*g
03/27/2013 - elite*gold Trading - 18 Replies
Hallo epvper, ich biete euch einen Ioncube 7.0 DECODING Service. Ihr möchtet an den Source einen Ioncube Datei ran? Ihr möchtet Features hinzufügen, da es keine Plugin Schnittstelle gibt? Ihr müsst einen Bug entfernen aber das Script wird nicht mehr Supportet? Ihr habt euer Script encodiert und die Source verloren?
Need Help in Decoding!!
12/24/2011 - Facebook - 0 Replies
Please Help me In Decoding those Files.. Thanks, jslvdr
[Help] Packet Decoding
01/23/2011 - SRO Coding Corner - 1 Replies
Ive been attempting to make a clientless bot for Scions Of Fate (fate.netgame.com) using the tClientless source, There was a bot that existed before by the name of AutoHunter, its currently alive as AutoHunterSEA. Enough Background. I have been using wireshark to log the packets ive received and have found what i believe to be the packet header, 00 18 39 F3 4D ED 00 25 9C 7A 5D C3 08 00 45 00 00 My question is what do i do next, here is an example of what i call a "IDLE" packet...
Decoding GameMap.dat
09/21/2010 - CO2 Programming - 15 Replies
Well I was working on a project tonite, it was decoding Gamemap.dat. Thanks to the help of haydz I finally got this and it works! using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace ConsoleApplication1
Packet decoding
08/15/2009 - Silkroad Online - 5 Replies
Hi ! Today I just wrote a simple proxy in autoit for ksro, to sniff the packets , but yeah I knew it is encrypted. This is an example first packet 0x2500005000000EF7360258FEDD153B370000009B000000A6 FF776C62225323D37E6C13555A852137DC3612 Where clearscrean told me 25 00 is the lenght 00 50 is opcode 00 00 is magic bytes and the 0EF7360258FEDD153B370000009B000000A6FF776C62225323 D37E6C13555A852137DC3612 is the handshake. So my question now how to decode the next packets by knowing the...



All times are GMT +1. The time now is 08:04.


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.