Register for your free account! | Forgot your password?

You last visited: Today at 19:02

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

Advertisement



[C# Source/App] DatCryptor

Discussion on [C# Source/App] DatCryptor within the CO2 Exploits, Hacks & Tools forum part of the Conquer Online 2 category.

Reply
 
Old 04/16/2008, 07:25   #31
 
elite*gold: 0
Join Date: Jun 2006
Posts: 965
Received Thanks: 576
Quote:
Originally Posted by shitboi View Post
Took me quite a while to put chocoman's source into use.

Ummmm, how to use the key for lv.dat? Does level.dat have the same de/encrytion routine as itemtype.dat

If possible teach me the process of decrypting itemtype.dat. Eg, finding keys and de/encrytion process
chocoman's source?

Just replace the byte arrays. Yes

high6 is offline  
Thanks
1 User
Old 04/18/2008, 14:38   #32
 
warriorchamp's Avatar
 
elite*gold: 0
Join Date: May 2007
Posts: 171
Received Thanks: 41
Quote:
Originally Posted by high6 View Post
There might be a problem with your .net framework.

Also are you 32 bit or 64 bit?
Im at 32 bit. I dont know why isn't working This is the first application which doesn't work on my computer... :|
warriorchamp is offline  
Old 04/18/2008, 17:11   #33
 
elite*gold: 0
Join Date: Jun 2006
Posts: 457
Received Thanks: 67
Quote:
Originally Posted by high6 View Post
chocoman's source?

Just replace the byte arrays. Yes

In coder62's itemtype DeEn thread, first page, Chocoman4k released his version of the de/en routine in C++. That was the one i made use of.

Code:
example: 

CounterA = 7
CounterB = CounterA Mod 128 //=0x7
CounterC = CounterA Mod 8 //=0x7
ByteA = 0xBB
ByteB = 0x09
xor ByteA, ByteB // 0xBB xor 0x0E = 0xB2
ByteC = ByteA  // =0xB2
shl ByteA, (8 - CounterC) // ByteA = 0x64
shr ByteC, CounterC //ByteC = 0x1
result = ByteA + ByteC // 0x64 + 0x1 = 0x65 (101 = "e")
i don't quite get what does 0x7 mean. I fact, what is the exact meaning of "0x" does it convert from hex to dec or what?
shitboi is offline  
Old 04/18/2008, 18:55   #34
 
elite*gold: 0
Join Date: Jun 2006
Posts: 457
Received Thanks: 67
Quote:
Originally Posted by warriorchamp View Post
Im at 32 bit. I dont know why isn't working This is the first application which doesn't work on my computer... :|
Well, you can use the tool i made.

Extract the pure_itemtypeEnDe.exe into your ..Conquer2.0/ini folder and run.
The menu is easy to understand, just follow instructions.
Attached Files
File Type: zip pure_itemtypeEnDe.zip (43.6 KB, 92 views)
shitboi is offline  
Thanks
1 User
Old 04/27/2008, 11:33   #35
 
elite*gold: 0
Join Date: Jun 2007
Posts: 8
Received Thanks: 1
Hi guys, i tryed to include the encrypt and decrypt functions into my own project, which should check automatically, if the itemtype.dat was updated by conquer and then decrypt, replace some strings in it and write back encrypted into itemtype.dat.

Here is my code:

/*
* Erstellt mit SharpDevelop.
* Datum: 27.04.2008
* Zeit: 10:57
*
* Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
*/

using System;
using System.Drawing;
using System.Windows.Forms;
using System.IO;

namespace CO4US
{
/// <summary>
/// Description of Form1.
/// </summary>
public partial class frmSpecial : Form
{
public frmSpecial()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();

//
// TODO: Add constructor code after the InitializeComponent() call.
//
}

void CmdBackClick(object sender, EventArgs e)
{
this.Hide();
}

void CmdItemTypeClick(object sender, EventArgs e)
{
byte[] bytes;
bytes = HoleDaten("ItemType");
Decrypt(ref bytes);
}

byte[] HoleDaten(string Datei)
{
if (Datei == "ItemType" || Datei == "Monster")
{
Datei = "ini" + Path.DirectorySeparatorChar + Datei + ".dat";
}
if (Datei == "MapItemIcon")
{
Datei +=".ani";
}
string Pfad = System.IO.Directory.GetCurrentDirectory();
Pfad = Directory.GetParent(Pfad).ToString();
Pfad = @"C:\Programme\Conquer 2.0";
string DateiPfad = Pfad + Path.DirectorySeparatorChar + Datei;
MessageBox.Show(DateiPfad);
byte[] bytes = File.ReadAllBytes(DateiPfad);
return bytes;
}

static byte[] key = {
0xAD ,0x6B ,0x4F ,0xFB ,0xDD ,0xB8 ,0x0E ,0x09 ,0x13 ,0x33 ,0x8F ,0xF5 ,0x43 ,0x09 ,0x15 ,0x88 ,0x5D ,0x80 ,0xA3 ,0x45 ,0x2D ,0x42 ,0x08 ,0x56 ,0x80 ,0xF8 ,0x19 ,0xC5 ,0x88 ,0x1B ,0x3E ,0xEF
,0x81 ,0x07 ,0x30 ,0x36 ,0x95 ,0x52 ,0x00 ,0xF7 ,0xFD ,0x5B ,0x5C ,0xBC ,0x6A ,0x26 ,0x0E ,0xB2 ,0xA3 ,0x67 ,0xC5 ,0x5D ,0x6F ,0xDC ,0x18 ,0x8A ,0xB5 ,0xE0 ,0xC8 ,0x85 ,0xE2 ,0x3E ,0x45 ,0x8D
,0x8B ,0x43 ,0x74 ,0x85 ,0x54 ,0x17 ,0xB0 ,0xEC ,0x10 ,0x4D ,0x0F ,0x0F ,0x29 ,0xB8 ,0xE6 ,0x7D ,0x42 ,0x80 ,0x8F ,0xBC ,0x1C ,0x76 ,0x69 ,0x3A ,0xB6 ,0xA5 ,0x21 ,0x86 ,0xB9 ,0x29 ,0x30 ,0xC0
,0x12 ,0x45 ,0xA5 ,0x4F ,0xE1 ,0xAF ,0x25 ,0xD1 ,0x92 ,0x2E ,0x30 ,0x58 ,0x49 ,0x67 ,0xA5 ,0xD3 ,0x84 ,0xF4 ,0x89 ,0xCA ,0xFC ,0xB7 ,0x04 ,0x4F ,0xCC ,0x6E ,0xAC ,0x31 ,0xD4 ,0x87 ,0x07 ,0x72};

static void Decrypt(ref byte[] bytes)
{
if (bytes.Length < 0)
return;
int i = 1;
byte t1 = 0;
int t2;
while (i < bytes.Length)
{
MessageBox.Show(bytes[i].ToString());
t1 = (byte)(bytes[i] ^ key[(byte)i % 0x80]);
t2 = i % 0x8;
bytes[i] = (byte)((t1 << (0x8 - t2)) + (t1 >> t2));
i++;
}
}

static void Encrypt(ref byte[] bytes)
{
if (bytes.Length < 0)
return;
int i = 1;
byte t1 = 0;
int t2;
while (i < bytes.Length)
{
t2 = i % 0x8;
t1 = (byte)((bytes[i] >> (0x8 - t2)) + (bytes[i] << t2));
bytes[i] = (byte)(t1 ^ key[(byte)i % 0x80]);
i++;
}
}
}
}

Everytime i try to run it, it says "overflow" and i found out it stops at the function decrypt at bytes[i] = (byte)((t1 << (0x8 - t2)) + (t1 >> t2));
I worked the original programm through and the variables at the first time are have the same worth like they are in my program, but in my program is an overflow. I hope you can help me.

Mfg Sissi.
Sissi is offline  
Old 04/28/2008, 03:42   #36
 
elite*gold: 0
Join Date: Jun 2006
Posts: 965
Received Thanks: 576
Quote:
Originally Posted by Sissi View Post
Hi guys, i tryed to include the encrypt and decrypt functions into my own project, which should check automatically, if the itemtype.dat was updated by conquer and then decrypt, replace some strings in it and write back encrypted into itemtype.dat.

Here is my code:

/*
* Erstellt mit SharpDevelop.
* Datum: 27.04.2008
* Zeit: 10:57
*
* Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
*/

using System;
using System.Drawing;
using System.Windows.Forms;
using System.IO;

namespace CO4US
{
/// <summary>
/// Description of Form1.
/// </summary>
public partial class frmSpecial : Form
{
public frmSpecial()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();

//
// TODO: Add constructor code after the InitializeComponent() call.
//
}

void CmdBackClick(object sender, EventArgs e)
{
this.Hide();
}

void CmdItemTypeClick(object sender, EventArgs e)
{
byte[] bytes;
bytes = HoleDaten("ItemType");
Decrypt(ref bytes);
}

byte[] HoleDaten(string Datei)
{
if (Datei == "ItemType" || Datei == "Monster")
{
Datei = "ini" + Path.DirectorySeparatorChar + Datei + ".dat";
}
if (Datei == "MapItemIcon")
{
Datei +=".ani";
}
string Pfad = System.IO.Directory.GetCurrentDirectory();
Pfad = Directory.GetParent(Pfad).ToString();
Pfad = @"C:ProgrammeConquer 2.0";
string DateiPfad = Pfad + Path.DirectorySeparatorChar + Datei;
MessageBox.Show(DateiPfad);
byte[] bytes = File.ReadAllBytes(DateiPfad);
return bytes;
}

static byte[] key = {
0xAD ,0x6B ,0x4F ,0xFB ,0xDD ,0xB8 ,0x0E ,0x09 ,0x13 ,0x33 ,0x8F ,0xF5 ,0x43 ,0x09 ,0x15 ,0x88 ,0x5D ,0x80 ,0xA3 ,0x45 ,0x2D ,0x42 ,0x08 ,0x56 ,0x80 ,0xF8 ,0x19 ,0xC5 ,0x88 ,0x1B ,0x3E ,0xEF
,0x81 ,0x07 ,0x30 ,0x36 ,0x95 ,0x52 ,0x00 ,0xF7 ,0xFD ,0x5B ,0x5C ,0xBC ,0x6A ,0x26 ,0x0E ,0xB2 ,0xA3 ,0x67 ,0xC5 ,0x5D ,0x6F ,0xDC ,0x18 ,0x8A ,0xB5 ,0xE0 ,0xC8 ,0x85 ,0xE2 ,0x3E ,0x45 ,0x8D
,0x8B ,0x43 ,0x74 ,0x85 ,0x54 ,0x17 ,0xB0 ,0xEC ,0x10 ,0x4D ,0x0F ,0x0F ,0x29 ,0xB8 ,0xE6 ,0x7D ,0x42 ,0x80 ,0x8F ,0xBC ,0x1C ,0x76 ,0x69 ,0x3A ,0xB6 ,0xA5 ,0x21 ,0x86 ,0xB9 ,0x29 ,0x30 ,0xC0
,0x12 ,0x45 ,0xA5 ,0x4F ,0xE1 ,0xAF ,0x25 ,0xD1 ,0x92 ,0x2E ,0x30 ,0x58 ,0x49 ,0x67 ,0xA5 ,0xD3 ,0x84 ,0xF4 ,0x89 ,0xCA ,0xFC ,0xB7 ,0x04 ,0x4F ,0xCC ,0x6E ,0xAC ,0x31 ,0xD4 ,0x87 ,0x07 ,0x72};

static void Decrypt(ref byte[] bytes)
{
if (bytes.Length < 0)
return;
int i = 1;
byte t1 = 0;
int t2;
while (i < bytes.Length)
{
MessageBox.Show(bytes[i].ToString());
t1 = (byte)(bytes[i] ^ key[(byte)i % 0x80]);
t2 = i % 0x8;
bytes[i] = (byte)((t1 << (0x8 - t2)) + (t1 >> t2));
i++;
}
}

static void Encrypt(ref byte[] bytes)
{
if (bytes.Length < 0)
return;
int i = 1;
byte t1 = 0;
int t2;
while (i < bytes.Length)
{
t2 = i % 0x8;
t1 = (byte)((bytes[i] >> (0x8 - t2)) + (bytes[i] << t2));
bytes[i] = (byte)(t1 ^ key[(byte)i % 0x80]);
i++;
}
}
}
}

Everytime i try to run it, it says "overflow" and i found out it stops at the function decrypt at bytes[i] = (byte)((t1 << (0x8 - t2)) + (t1 >> t2));
I worked the original programm through and the variables at the first time are have the same worth like they are in my program, but in my program is an overflow. I hope you can help me.

Mfg Sissi.
What is "i"'s value on overflow? And how big is the array?
high6 is offline  
Old 04/28/2008, 04:19   #37
 
Hiyoal's Avatar
 
elite*gold: 20
Join Date: Mar 2007
Posts: 2,444
Received Thanks: 1,067
How do you find the initial key in the first place?? What are the steps to go through. Could you please enlighten me on this Topic High...This one time.

Hiyoal
Hiyoal is offline  
Old 04/29/2008, 08:37   #38
 
elite*gold: 0
Join Date: Jun 2007
Posts: 8
Received Thanks: 1
i is the counter from 0 to end of the array and the array is the whole file, like in your code. Strange is in your prog, when i compile, it works, but not at mine. But it seems that my software (sharpdevelop) is the problem - its freeware and if others do the same with my code it works.
Seems i need to borrow me that software fom them, thx anywhere
Sissi is offline  
Old 07/08/2008, 21:08   #39
 
Dgen's Avatar
 
elite*gold: 0
Join Date: Jan 2007
Posts: 95
Received Thanks: 7
Why doesn't this program work for me? It shows and error when i want to start it.



EDiT: I fixed it .
Dgen is offline  
Old 07/24/2008, 23:51   #40
 
Guerilla's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 44
Received Thanks: 3
Thank you very much.
Guerilla is offline  
Old 08/04/2008, 14:29   #41
 
elite*gold: 0
Join Date: Mar 2008
Posts: 20
Received Thanks: 0
good ty
torbido is offline  
Old 08/05/2008, 16:51   #42
 
Hassan28's Avatar
 
elite*gold: 0
Join Date: May 2007
Posts: 82
Received Thanks: 3
nice ty
Hassan28 is offline  
Old 12/02/2008, 02:58   #43
 
elite*gold: 0
Join Date: Oct 2007
Posts: 120
Received Thanks: 24
alot thanks i was search for it while ago
thanks for @nTL3fTy for guide me
and can i use this code for all dat files?? or just co ??
elragal_30 is offline  
Old 12/02/2008, 04:38   #44
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Quote:
Originally Posted by elragal_30 View Post
alot thanks i was search for it while ago
thanks for @nTL3fTy for guide me
and can i use this code for all dat files?? or just co ??
Just encrypted CO2 ones, because there are some CO2 .dat files that are not encrypted (such as MagicType (as of v5017)).
nTL3fTy is offline  
Old 01/23/2009, 16:56   #45
 
elite*gold: 0
Join Date: Dec 2008
Posts: 26
Received Thanks: 2
Thanks alot for this, it both helped me getting monsters smaller and learned me how to encrypt/decrypt easily, thanks a lot!
Deriaz is offline  
Reply


Similar Threads Similar Threads
DatCryptor v2
04/09/2022 - CO2 Programming - 21 Replies
Not sure if it is the same encryption as I lost the original. People are saying it doesn't work anymore so I rewrote it with whatever they are currently using. Works just like the old. So you drag/drop the dat file (or txt for encrypting) onto datcryptor and it will decrypt/encrypt the file. You must provide the correct key listed below otherwise it will not decrypt/encrypt properly. Keys for patch 5253 LevExp - 4d2 Silent - 2537 MapDestination - 2537 ItemType - 2537 MagicType - 2537
[QUESTION] DatCryptor source
04/27/2009 - CO2 Programming - 2 Replies
How make or get this key? static byte key = { 0xAD ,0x6B ,0x4F ,0xFB ,0xDD ,0xB8 ,0x0E ,0x09 ,0x13 ,0x33 ,0x8F ,0xF5 ,0x43 ,0x09 ,0x15 ,0x88 ,0x5D ,0x80 ,0xA3 ,0x45 ,0x2D ,0x42 ,0x08 ,0x56 ,0x80 ,0xF8 ,0x19 ,0xC5 ,0x88 ,0x1B ,0x3E ,0xEF ,0x81 ,0x07 ,0x30 ,0x36 ,0x95 ,0x52 ,0x00 ,0xF7 ,0xFD ,0x5B ,0x5C ,0xBC ,0x6A ,0x26 ,0x0E ,0xB2 ,0xA3 ,0x67 ,0xC5 ,0x5D ,0x6F ,0xDC ,0x18 ,0x8A ,0xB5 ,0xE0 ,0xC8 ,0x85 ,0xE2 ,0x3E ,0x45 ,0x8D ,0x8B ,0x43 ,0x74 ,0x85 ,0x54 ,0x17 ,0xB0 ,0xEC ,0x10 ,0x4D...



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


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.