|
You last visited: Today at 17:39
Advertisement
[Help]MagicType.dat
Discussion on [Help]MagicType.dat within the CO2 Programming forum part of the Conquer Online 2 category.
02/28/2011, 12:30
|
#1
|
elite*gold: 0
Join Date: May 2010
Posts: 133
Received Thanks: 27
|
[Help]MagicType.dat
PHP Code:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO;
namespace ConsoleApplication1 { class Program { static string FilePath = @"C:/";
static void Main() { using (BinaryReader Reader = new BinaryReader(new FileStream(FilePath + @"MagicType.dat", FileMode.Open))) { TextWriter TW = new StreamWriter(@"C:\MagicType.txt"); uint TotalSpells = Reader.ReadUInt32(); TW.WriteLine("Total Spells: " + TotalSpells); TW.WriteLine(); for (int i = 0; i < TotalSpells; i++) { TW.WriteLine("ID: " + Reader.ReadUInt16()); TW.WriteLine("Type: " + Reader.ReadByte()); TW.WriteLine("Sort: " + Reader.ReadUInt32()); TW.WriteLine("Name: " + Reader.ReadByte()); TW.WriteLine(); } TW.Close(); Reader.Close(); } Console.WriteLine("Decryption Done!"); Console.ReadLine(); }
} }
I have troubles reading the content of the MagicType.dat file. I think I don't know the column names (the one which defines the numbers/strings), so program can't read them. I tried looking in other sources just to get the names but I still failed. Can someone provide a little help?
Here's a part of the decrypted content:
Code:
Total Spells: 655
ID: 10000
Type: 0
Sort: 2560256
Name: 0
ID: 10002
Type: 0
Sort: 2560768
Name: 0
ID: 10004
Type: 0
Sort: 2562560
Name: 0
ID: 10011
Type: 0
Sort: 2563072
Name: 0
ID: 10013
Type: 0
Sort: 2565120
Name: 0
ID: 10021
Type: 0
Sort: 2565632
Name: 0
ID: 10023
Type: 0
Sort: 2572800
Name: 0
ID: 10051
Type: 0
Sort: 2573312
Name: 0
ID: 10053
Type: 0
Sort: 2573824
Name: 0
ID: 10100
Type: 0
Sort: 2598400
Name: 0
|
|
|
02/28/2011, 17:18
|
#2
|
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
|
Quote:
Originally Posted by WarpGeorge
PHP Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static string FilePath = @"C:/";
static void Main()
{
using (BinaryReader Reader = new BinaryReader(new FileStream(FilePath + @"MagicType.dat", FileMode.Open)))
{
TextWriter TW = new StreamWriter(@"C:\MagicType.txt");
uint TotalSpells = Reader.ReadUInt32();
Reader.BaseStream.Seek(TotalSpells * 4, SeekOrigin.Current);
TW.WriteLine("Total Spells: " + TotalSpells);
TW.WriteLine();
for (int i = 0; i < TotalSpells; i++)
{
TW.WriteLine("ID: " + Reader.ReadUInt16());
TW.WriteLine("Type: " + Reader.ReadByte());
TW.WriteLine("Sort: " + Reader.ReadUInt32());
TW.WriteLine("Name: " + Encoding.Default.GetString(Reader.ReadBytes(16)));
TW.WriteLine();
}
TW.Close();
Reader.Close();
}
Console.WriteLine("Decryption Done!");
Console.ReadLine();
}
}
}
[...]
|
My reader is somewhere on my hard drive, but it should works.
|
|
|
02/28/2011, 19:43
|
#3
|
elite*gold: 0
Join Date: Dec 2006
Posts: 50
Received Thanks: 13
|
Quote:
Originally Posted by CptSky
My reader is somewhere on my hard drive, but it should works.
|
Do you mean that's your code or you'll gonna gimme a tip? If it matters, this code was not entirely done by me. It's based on Arco's GameMap.dat decoder...
|
|
|
02/28/2011, 19:46
|
#4
|
elite*gold: 0
Join Date: May 2010
Posts: 133
Received Thanks: 27
|
#Delete the upper reply. It was made accidentaly when I was browsing my old old account. You can even infract me for that, I'll take the responsability for...
Do you mean that's your code or you'll gonna gimme a tip? If it matters, this code was not entirely done by me. It's based on Arco's GameMap.dat decoder...
|
|
|
02/28/2011, 23:09
|
#5
|
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
|
What version is this being based on? TQ has changed the format of magictype.dat a few times..
|
|
|
03/01/2011, 01:28
|
#6
|
elite*gold: 0
Join Date: Jun 2006
Posts: 457
Received Thanks: 67
|
try searching for datcryptor v2 by high6. It has a complete solution to latest .dat crypts.
|
|
|
03/01/2011, 04:06
|
#7
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
|
Quote:
Originally Posted by shitboi
try searching for datcryptor v2 by high6. It has a complete solution to latest .dat crypts.
|
He's talking about the old magictype.dat.
Your code looks reasonable. Does it work at all? Chances are there's just an extra column or two. Read a bit further into and you should be good.
There are a HELL of a lot more columns then that (take a peek at a current decrypted one... like 50 columns per entry lol!) so chances are you just need to read more offsets regardless of if you need them or not.
IE: throw in some ReadBytes(X);'s
|
|
|
03/01/2011, 06:50
|
#8
|
elite*gold: 0
Join Date: May 2010
Posts: 133
Received Thanks: 27
|
Quote:
Originally Posted by pro4never
He's talking about the old magictype.dat.
Your code looks reasonable. Does it work at all? Chances are there's just an extra column or two. Read a bit further into and you should be good.
There are a HELL of a lot more columns then that (take a peek at a current decrypted one... like 50 columns per entry lol!) so chances are you just need to read more offsets regardless of if you need them or not.
IE: throw in some ReadBytes(X);'s
|
It does, anyway when I dump the file, in the ID field, the program's adding an extra 0 at the end of it like, 1045 (FB) it turns into 10450...
|
|
|
03/01/2011, 06:55
|
#9
|
elite*gold: 0
Join Date: Mar 2009
Posts: 518
Received Thanks: 238
|
Quote:
Originally Posted by WarpGeorge
It does, anyway when I dump the file, in the ID field, the program's adding an extra 0 at the end of it like, 1045 (FB) it turns into 10450...
|
I may not be a C# guru, but instead of worrying what in the code is causing that, sometimes it's better to just have it trim it off and go about your day.
Just my opinion, though.
|
|
|
03/01/2011, 08:51
|
#10
|
elite*gold: 0
Join Date: May 2010
Posts: 133
Received Thanks: 27
|
I' m worried just because after I manage to fully decrypt it, I'll need to revert it back to its original state (encrypted) in order to make it functional again.
|
|
|
03/01/2011, 13:06
|
#11
|
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
|
Quote:
Originally Posted by WarpGeorge
It does, anyway when I dump the file, in the ID field, the program's adding an extra 0 at the end of it like, 1045 (FB) it turns into 10450...
|
In the later versions, TQ changed the Id field to reflect the level of the spell as well, so 10450 is 1045 level 0, 10451 is 1045 level 1, etc.
|
|
|
03/01/2011, 14:30
|
#12
|
elite*gold: 0
Join Date: May 2010
Posts: 133
Received Thanks: 27
|
Yes, I figured that out by myself but you know, this version it's the last version I think, when TQ kept the same way to encrypt the MagicType.dat. For example, for the v5095 version, higher than 5065 obviusly, you can decrypt the MagicType.dat using the decryptors available on this forum. Since I have no clue how to decrypt it or encrypt it back (well, decrypting may just work if someone's gonna help me) but ecrypting it's totally clueless for me.
|
|
|
03/01/2011, 14:47
|
#13
|
elite*gold: 0
Join Date: Jun 2006
Posts: 457
Received Thanks: 67
|
Quote:
Originally Posted by pro4never
He's talking about the old magictype.dat.
Your code looks reasonable. Does it work at all? Chances are there's just an extra column or two. Read a bit further into and you should be good.
There are a HELL of a lot more columns then that (take a peek at a current decrypted one... like 50 columns per entry lol!) so chances are you just need to read more offsets regardless of if you need them or not.
IE: throw in some ReadBytes(X);'s
|
yeah, i did realize that his code are for older versions of co. that makes me wonder if he doesn't know that he might be using the wrong algorithm; cuz he didn't specify which version is he working on. lol.
|
|
|
03/01/2011, 15:08
|
#14
|
elite*gold: 0
Join Date: May 2010
Posts: 133
Received Thanks: 27
|
My bad then. The version where i'm trying to get it decrypted it's 5065...
|
|
|
03/02/2011, 01:56
|
#15
|
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
|
Magictype.dat structure:
| datatype | name | | int | amount | | uint[amount] | id | | MagicType[amount] | magictypes |
MagicType structure:
| datatype | name | | uint | type | | uint | sort | | byte[16] | name | | uint | crime | | uint | ground | | uint | multi | | uint | target | | uint | level | | uint | use_mp | | int | power | | uint | intone_duration | | uint | percent | | uint | duration | | uint | range | | uint | distance | | uint | status | | uint | req_profession | | int | req_exp | | uint | req_level | | uint | use_xp | | uint | weapon_subtype | | uint | active_times | | uint | auto_active | | uint | floor_attr | | uint | auto_learn | | uint | learn_level | | uint | drop_weapon | | uint | use_stamina | | uint | weapon_hit | | uint | use_item | | uint | next_magic | | uint | delay | | uint | use_item_num | | uint | sender_action | | byte[64] | description | | byte[256] | description_ex | | byte[64] | intone_effect | | byte[260] | intone_sound | | byte[64] | sender_effect | | byte[260] | sender_sound | | uint | target_delay | | byte[64] | target_effect | | byte[260] | target_sound | | byte[64] | ground_effect | | byte[64] | trace_effect | | uint | screen_represent | | uint | use_in_market | | uint | target_wound_delay |
I believe this should be all you need to parse the file. The id mentioned in the beginning of the file is type*10+level. With that information, you can build a dictionary.
|
|
|
Similar Threads
|
Magictype.sql
07/11/2010 - CO2 Private Server - 2 Replies
Hello Guys !!
Im Looking for cq_magictype.sql
Witch makes the skills lvling normal ... like real tq
and i wish if has ninja skills ....
|
[Help] MagicType.txt
03/13/2010 - CO2 Private Server - 3 Replies
can anyone read this sample code from Magictype.txt pls.
1380 22 Dance2 0 0 0 2 0 0 0 0 100 0 0 5 0 0 0 0 2 0 0 0 0 0 0 0 10 0 0 0 0 1 2 Fixed Dance born4 sound\ball1.wav NULL NULL 0 NULL sound\Health.wav NULL NULL 0 1 0
|
MagicType?
12/23/2009 - CO2 Private Server - 5 Replies
Does anyone have MagicType.dat decrypted for patch 5017?
|
All times are GMT +1. The time now is 17:40.
|
|