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.
//
}
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.
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.
//
}
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?
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.
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
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