Register for your free account! | Forgot your password?

You last visited: Today at 02:23

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

Advertisement



CO2_CORE_DLL (C# Library)

Discussion on CO2_CORE_DLL (C# Library) within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
CO2_CORE_DLL (C# Library)

I decided to implement a big part of my knowledge in a library. At the start, I wanted to make a C library, but as mostly all the server use C# and because I don't want to work too much on it, I decided to make it in C#.

The library is constructed like the .net framework. Often, you'll just have to change System to CO2_CORE_DLL to get some similar class/goal.

The library is based on the version 5017 of CO2, but it may work on older or newer client. It also use a lot of pointer, but there is often a managed equivalent.

What is implemented yet:
CO2_CORE_DLL
- Ini: INI wrapper. Still using the WinAPI.
- Kernel: Kernel of the library. Contains memory management, etc. (memcpy/memset/malloc/free/srand/rand/assert)
- BigInteger: Chew Keong TAN BigInteger implementation
- MSRandom: Microsoft C Random implementation. (srand/rand)
- MathExt: A mathematic class that implement a thread-safe random.
- MyString: Extensions to the String class.
- MyStream: Extensions to the Stream class.
- Queue: Saint's queue class. Still not worked on.

CO2_CORE_DLL.IO
- AutoAllot: Binary / Custom Text support (not fully working for text)
- ItemType: Custom Binary / Text support
- LevelExp: Binary / Custom Text support
- MagicType: Binary / Text support

- ChatLog: Binary / Custom Text support
- WDF: Windsoul Data File, fully supported
- NetDragonDatPkg: NetDragon Data Package (TPI/TPD), partially supported
- DNP: DawnPack, partially supported

- EFFE (DBC): Binary / Text support [3DEffect]
- EMOI (DBC): Binary / Text support [EmotionIco]
- MATR (DBC): Binary / Text support [Material]
- MESH (DBC): Binary / Text support [Armet, Armor, Head, Misc, Mount, Weapon]
- ROPT (DBC): Binary / Text support [RolePart]
- RSDB [32bits] (DBC): Binary / Text support [3DEffectObj, 3DObj, 3DTexture, Sound]
- RSDB [64bits] (DBC): Binary / Text support [3DMotion, ArmetMotion, ArmorMotion, HeadMotion, MiscMotion, MountMotion, WeaponMotion]
- SIMO (DBC): Binary / Text support [3DSimpleObj]

CO2_CORE_DLL.Map
- MapManager: Loads all DMap from the GameMap.dat file and handles dynamic maps with Link().
- GameMap: A DMap representation with all the cells and their data.

CO2_CORE_DLL.Net
- Msg: Basic class for packets. Work with structure and packet writer.

CO2_CORE_DLL.Net.Sockets
- ServerSocket: Server socket class to create a server using TCP/IPv4.
- NetworkClient: Client class used by the server.
- ClientSocket: Client socket class to create a client using TCP/IPv4.
- Event: Network events.

CO2_CORE_DLL.Security.Cryptography
- Blowfish: Blowfish Cipher Feedback (CFB64)
- CAST5: CAST-128 Cipher Feedback (CFB64)
- COCAC: Conquer Online Client Asymmetric Cipher
- COFAC: Conquer Online File Asymmetric Cipher
- CORC5: Conquer Online Rivest Cipher 5
- COSAC: Conquer Online Server Asymmetric Cipher
- DiffieHellman: Diffie-Hellman Key Exchange.

Special thanks to Sparkie, Hybrid, Saint & high6 for all their contributions in the community.

The project is hosted in a SVN. The source is given with pre-compiled assembly. Also, there is some examples on how to implement it.

Please keep the paternity of the class! Never say that it's your own code.
Attached Files
File Type: zip rev11.zip (720.1 KB, 493 views)
File Type: zip rev13.zip (737.6 KB, 321 views)
File Type: zip rev20.zip (829.7 KB, 1240 views)
CptSky is offline  
Thanks
35 Users
Old 01/13/2012, 18:59   #2


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
During the weekend or maybe the next week, I should have time to finish my WDF implementation and my decryptor for the chat log files.
CptSky is offline  
Thanks
2 Users
Old 01/13/2012, 23:48   #3
 
elite*gold: 0
Join Date: May 2011
Posts: 648
Received Thanks: 413
Id fix the MagicType reader. (Maybe others aswell O.o)

Key already added issue on loading.

You might wanna add a if(!Collection.ContainsKey(ID)) xD

But overall, its a really cool ressource!
Y u k i is offline  
Thanks
1 User
Old 01/14/2012, 00:17   #4


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Quote:
Originally Posted by Y u k i View Post
Id fix the MagicType reader. (Maybe others aswell O.o)

Key already added issue on loading.

You might wanna add a if(!Collection.ContainsKey(ID)) xD

But overall, its a really cool ressource!
You have two identical entry, you shouldn't. But yes, I will add a verification. Thanks.
CptSky is offline  
Thanks
1 User
Old 01/19/2012, 02:20   #5


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
New revision available!

Code:
CO2_CORE_DLL v1.0.0 (REV-6) new features and fixed bugs (from REV-5) :

1.  Add the support of the ChatLog files.
2.  Add the support of the Windsoul Data File packages.
3.  Add an extension to the String class to get a pointer.
4.  Add an implementation of the memset function in the Kernel.
5.  Fix the problem of redondant key in the MagicType class.

January 18th, 2012
Also, I added the list of the files contained by the WDF packages in the example folder. The lists contain approximatively 96-98% of all the files. It is made from all the link in the client, and some algorithms to predict possibilities. It is enough to rebuilt these packages.
CptSky is offline  
Thanks
3 Users
Old 01/26/2012, 03:22   #6


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
New revision!

Code:
CO2_CORE_DLL v1.0.0 (REV-8) new features and fixed bugs (from REV-7) :

1.  Finish the implementation of the WDF files.

January 25th, 2012

CO2_CORE_DLL v1.0.0 (REV-7) new features and fixed bugs (from REV-6) :

1.  Add the support of the EMOI (DBC) files. [EmotionIco]
2.  Add the support of the MATR (DBC) files. [Material]
3.  Add the support of the ItemType files.

January 22th, 2012
So, I started implementing DBC files, but I faced a problem... Fixed size buffer can only be primitive type, so I'll need to rework the implementation. Not a major problem.

For the DBC, they are implemented in a separate namespace, with the identifier as name. As I know people will not necessarily know which one is used by the file, I made some wrapper... For example, Material will implement all MATR functions.

For the WDF implementation. Everything is implemented. It is possible, to pack a folder, get data, add an entry, delete an entry, update an entry... The last three possibilities aren't really "safe" implementation. They may corrupt the file if badly used, but eh, people aren't stupid?

Have fun! And if you have proposition for priorities in file implementation, you can suggest!
CptSky is offline  
Thanks
1 User
Old 02/22/2012, 19:04   #7


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Code:
CO2_CORE_DLL v1.0.0 (REV-9) new features and fixed bugs (from REV-8) :

1.  Add the support of Blowfish Cipher Feedback (CFB64) algorithm.
2.  Add the support of the Diffie-Hellman key exchange algorithm.
3.  Add an implementation of BigInteger.
4.  Add an implementation of the C assertion.
5.  Add the support of the MESH (DBC) files. [Armet, Armor, Head, Misc, Mount, Weapon]

February 22th, 2012
The DH implementation may be a bit slow... Actually, it is due to the BigInteger implementation. The MESH implementation is REALLY slow when reading from a plain text file.

Oh! And, I added a little example of how the DH exchange work.
CptSky is offline  
Thanks
2 Users
Old 02/22/2012, 21:27   #8

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
The emotionico.dbc converter doesn't seem to work. I attached the failed file too.
What happens is that when converting .txt -> .dbc the file gets filled with the Hoho entry.
Attached Files
File Type: rar emotionico.rar (1.2 KB, 27 views)
Kiyono is offline  
Old 02/22/2012, 23:21   #9


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Quote:
Originally Posted by Kiyono View Post
The emotionico.dbc converter doesn't seem to work. I attached the failed file too.
What happens is that when converting .txt -> .dbc the file gets filled with the Hoho entry.
An error of 'i' I'll fix that when I'll be at home.

N.B. New revision!

Code:
CO2_CORE_DLL v1.0.0 (REV-10) new features and fixed bugs (from REV-9) :

1.  Fix the MATR implementation. (SaveToDat)
2.  Fix the EMOI implementation. (SaveToDat)
3.  Add the support of the EFFE (DBC) files. [3DEffect]

February 23th, 2012
Like the MESH implementation, the EFFE implementation is really slow on LoadFromTxt due the over-utilisation of the WinAPI with the Ini class... I started a new Ini class, but that is not a priority for me.
CptSky is offline  
Old 03/12/2012, 22:36   #10


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Code:
CO2_CORE_DLL v1.0.0 (REV-11) new features and fixed bugs (from REV-10) :

1.  Adapt the MagicType, ItemType and LevelExp implementations to work like a Dictionary/List to be used as a database.
2.  Add a MathExt class that implement a thread-safe random.
3.  Add the support of the SIMO (DBC) files. [3DSimpleObj]
4.  Add the support of the ROPT (DBC) files. [RolePart]
5.  Add the support of the RSDB [32bits] (DBC) files. [3DEffectObj, 3DObj, Sound]
6.  Add the support of the RSDB [64bits] (DBC) files. [3DMotion, ArmetMotion, ArmorMotion, HeadMotion, MiscMotion, MountMotion, WeaponMotion]
7.  Fix the COFAC implementation where the encrypt/decrypt functions where inversed.

March 12th, 2012
So, now, all the DBC files are implemented. The project is now a VS '10 project... And I added a zip that contains the rev11 for people who don't use SVN.
CptSky is offline  
Thanks
1 User
Old 03/12/2012, 23:02   #11
 
2slam's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 586
Received Thanks: 336
2 left [3Dtexture,weapon]
thanks for ur great efforts
2slam is offline  
Old 03/12/2012, 23:07   #12


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Quote:
Originally Posted by 2slam View Post
2 left [3Dtexture,weapon]
thanks for ur great efforts
3DTexture is a RSDB (32bits), Weapon is a MESH.
CptSky is offline  
Thanks
1 User
Old 03/12/2012, 23:13   #13
 
2slam's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 586
Received Thanks: 336
waiting for a release for that dbc editor
2slam is offline  
Old 03/13/2012, 07:17   #14
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Why implement the thread-safe random as a few static methods inside MathExt? It's just as easy (and cleaner) to create a non-static class that is derived from Random and overrides the calls:
Code:
    public class SafeRandom : Random
    {
        private object _syncRoot;

        public object SyncRoot
        {
            get
            {
                if (_syncRoot == null)
                {
                    Interlocked.CompareExchange<object>(ref _syncRoot, new object(), null);
                }

                return _syncRoot;
            }
        }

        protected override double Sample()
        {
            lock (SyncRoot)
            {
                return base.Sample();
            }
        }

        public override int Next()
        {
            lock (SyncRoot)
            {
                return base.Next();
            }
        }

        public override int Next(int maxValue)
        {
            lock (SyncRoot)
            {
                return base.Next(maxValue);
            }
        }

        public override int Next(int minValue, int maxValue)
        {
            lock (SyncRoot)
            {
                return base.Next(minValue, maxValue);
            }
        }

        public override void NextBytes(byte[] buffer)
        {
            lock (SyncRoot)
            {
                base.NextBytes(buffer);
            }
        }

        public override double NextDouble()
        {
            lock (SyncRoot)
            {
                return base.NextDouble();
            }
        }
    }
nTL3fTy is offline  
Thanks
2 Users
Old 03/13/2012, 10:31   #15

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
For those wondering where the dbc converter went, I moved it to the tools section as it is not private server only but a general tool.
Kiyono is offline  
Thanks
1 User
Reply

Tags
co2 library, co2_core_dll, cptsky


Similar Threads Similar Threads
Release Library
06/04/2013 - Maestia - 6 Replies
Here are all the working Releases and Tutorials. Speed Hack: This will increase your movement speed http://www.elitepvpers.com/forum/maestia/1288146- release-maestia-speed-hack-v-1-x86-64-a.html Hackshieldkiller, Bot,...: The bot will level automatically. The Hackshieldbypass will bypass the Hackshield, so you wont get kicked.
MSDN Library
01/17/2011 - Flyff Private Server - 4 Replies
Also gut, da ich die Src nicht mehr compiled bekomme, warum auch immer wollt ich fragen ob es wichtig ist das die MSDN Library mitinstalliert worden ist, da ich es bei meiner jetztigen Version nicht hinbekomme diese zu installieren. Permanent kommt die Meldung, Insert Disc 1 ^^ Darum wollt ich fragen ob die Library wichtig sei, und wenn ja ob man diese auch manuell installieren kann. Mfg
[How to] ADD Library to C++ 2010
11/20/2010 - WarRock - 3 Replies
I am Sorry for Spam :( ... __ QUESTION: How to ADD Library(Direction) Direct Summer 2004 to Visual C++ 2010 ? Please :(
Library Files ?
08/06/2008 - Silkroad Online - 2 Replies
Hi, I bought me a new pc and I want to install agbot but the link to the library files on rev6 is dead ? Does anybody have a other link ? I couldn't find it :( thx
.NET 2.0/c# - CO2 Proxy Library
08/12/2006 - CO2 Exploits, Hacks & Tools - 29 Replies
Hi, As I spent a good days work writing this, and I got a lot of help from reading through posts from this forum to get it going I feel I should contribute something back! Maybe some of you could help me expand this code by sharing some your knowledge of the structure of the packets. I will cover the following in this post: 1) What this code does, and how to use it 2) What I know about different packets types (and what I'm assuming, I may be wrong!) 3) What I want to know! If anyone...



All times are GMT +1. The time now is 02:31.


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.