|
You last visited: Today at 05:35
Advertisement
[Question] ItemType.dat version 4351 or lower
Discussion on [Question] ItemType.dat version 4351 or lower within the CO2 Private Server forum part of the Conquer Online 2 category.
06/23/2019, 21:06
|
#1
|
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 458
|
[Question] ItemType.dat version 4351 or lower
Hey guys!
It's been a while since my last thread about making a server. I need a bit of help because i'm out of CO2 programming for too long and forgot some little things.
I could read and write all other .dat usefull files (levelxp, magic, monster, autoallot and etc) but not ItemType.dat, is there an public script for it? i remmember something about itemtype being encrypted in older versions.
Since i'm doing this, i have to edit the client to get the desired result.
If someone could help me with that, i would be very gratefull!
Thanks for all who gave me help and for the amazing samples found in this forum (alive after more than 10 years hehe).
|
|
|
06/23/2019, 23:20
|
#2
|
elite*gold: 0
Join Date: Jan 2008
Posts: 1,444
Received Thanks: 1,176
|
ItemType.dat was a binary file on the first clients. I think my CO2_CORE_DLL library supported the binary version, but you might have to tweak the parsing.
|
|
|
06/24/2019, 00:01
|
#3
|
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 458
|
Yeah, i tested using your library, but worked just with the newer clients, even changing a few things... as i see it seems to be encrypted, guess i'm loosing something... this makes me few stupid hehe
#Edit
Here's the way to decrypt and encrypt the itemtype.dat for older clients:
Code:
private Byte[] Key = new byte[] { 173, 107, 79, 251, 221, 184, 14, 9, 19, 51, 143, 245, 67, 9, 21, 136, 93, 128, 163, 69, 45, 66, 8, 86, 128, 248, 25, 197,
136, 27, 62, 239, 129, 7, 48, 54, 149, 82, 0, 247, 253, 91, 92, 188, 106, 38, 14, 178, 163, 103, 197, 93, 111, 220, 24, 138, 181, 224, 200, 133, 226,
62, 69, 141, 139, 67, 116, 133, 84, 23, 176, 236, 16, 77, 15, 15, 41, 184, 230, 125, 66, 128, 143, 188, 28, 118, 105, 58, 182, 165, 33, 134, 185, 41,
48, 192, 18, 69, 165, 79, 225, 175, 37, 209, 146, 46, 48, 88, 73, 103, 165, 211, 132, 244, 137, 202, 252, 183, 4, 79, 204, 110, 172, 49, 212, 135, 7,
114 };
/// <summary>
/// Save all the dictionary to the specified itemtype file (in custom binary format).
/// </summary>
public void SaveToDat(String FilePath)
{
if (File.Exists(FilePath))
{
byte[] pBuf = File.ReadAllBytes(FilePath);
Encrypt(ref pBuf);
string szRealName = Path.GetDirectoryName(FilePath) + "\\" + Path.GetFileNameWithoutExtension(FilePath);
File.WriteAllBytes(Environment.CurrentDirectory + "\\" + szRealName + ".dat", pBuf);
}
}
/// <summary>
/// Save all the dictionary to the specified itemtype file (in plain format).
/// </summary>
public void SaveToTxt(String FilePath)
{
if (File.Exists(FilePath))
{
byte[] pBuf = File.ReadAllBytes(FilePath);
Decrypt(ref pBuf);
string szRealName = Path.GetDirectoryName(FilePath) + "\\" + Path.GetFileNameWithoutExtension(FilePath);
File.WriteAllBytes(Environment.CurrentDirectory + "\\" + szRealName + ".txt", pBuf);
}
}
/// <summary>
/// Decrypt the ItemType.dat File
/// </summary>
/// <param name="pBuffer"></param>
public void Decrypt(ref byte[] pBuffer)
{
for (int i = 0; i < pBuffer.Length; i++)
{
byte byt_ = (byte)(pBuffer[i] ^ Key[(int)((byte)i % 128)]);
int int_ = i % 8;
pBuffer[i] = (byte)(((int)byt_ << (8 - int_ & 31)) + ((int)byt_ >> (int_ & 31)));
}
}
/// <summary>
/// Encrypt the ItemType.dat File
/// </summary>
/// <param name="pBuffer"></param>
public void Encrypt(ref byte[] pBuffer)
{
for (int i = 0; i < pBuffer.Length; i++)
{
int int_ = i % 8;
byte byt_ = (byte)(((int)pBuffer[i] >> (8 - int_ & 31)) + ((int)pBuffer[i] << (int_ & 31)));
pBuffer[i] = (byte)((byt_ ^ Key[(int)((byte)i % 128)]));
}
}
|
|
|
 |
Similar Threads
|
ItemType.dat (Customize Your Own ItemType File In 3 Steps)
02/06/2016 - CO2 Exploits, Hacks & Tools - 463 Replies
THIS WILL NEVER AND CAN NEVER WORK ON NORMAL EQUIPMENT EXCEPT WEAPONS AND TALISMANS! IT'S IMPOSSIBLE SO STOP ASKING FOR IT!
WORKS ON ALL PATCHES
Create your own itemtype.dat file in 3 easy steps: choose file, choose settings, generate.
Features:
Choose prefixes for fixed, refined, unique, elite or super items.
Choose prefixes for normal, refined or super gems.
Choose names for command tokens.
|
[Question]Shop.dat and itemtype.dat editing
03/13/2012 - EO PServer Hosting - 4 Replies
I`ve never posted on EPVP before so if this is in the wrong place i appologise.
Ive finally decided to take the plunge and edit my shop.dat and itemtype.dat and TBH im struggling a little bit.
Ive already translated my whole datatbase and most of the client
Question is if i edit the dats using winhex and change the chinese on the right side of the editing window to english will this mess up the dats or is it just a referance kinda thing. (cos i cant read chinese lol)
Also if i want...
|
ItemType.dat and itemtype.txt 5018 AnD Change Font Size :D
09/27/2009 - CO2 Exploits, Hacks & Tools - 14 Replies
itemType.dat
1. See the Quality of Items on the ground before you pick them up.
2. See CommandTokens, so you know which ones you have already.
3. See where the WindSpells will take you at a glance.
|
All times are GMT +1. The time now is 05:36.
|
|