Register for your free account! | Forgot your password?

You last visited: Today at 17:39

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

Advertisement



[Help]MagicType.dat

Discussion on [Help]MagicType.dat within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
WarpGeorge's Avatar
 
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 0TotalSpellsi++)
                {
                    
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
WarpGeorge is offline  
Old 02/28/2011, 17:18   #2


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Quote:
Originally Posted by WarpGeorge View Post
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 4SeekOrigin.Current);

                
TW.WriteLine("Total Spells: " TotalSpells);
                
TW.WriteLine();
                for (
int i 0TotalSpellsi++)
                {
                    
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.
CptSky is offline  
Old 02/28/2011, 19:43   #3
 
elite*gold: 0
Join Date: Dec 2006
Posts: 50
Received Thanks: 13
Quote:
Originally Posted by CptSky View Post
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...
George7293 is offline  
Old 02/28/2011, 19:46   #4
 
WarpGeorge's Avatar
 
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...
WarpGeorge is offline  
Old 02/28/2011, 23:09   #5
 
nTL3fTy's Avatar
 
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..
nTL3fTy is offline  
Old 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.
shitboi is offline  
Old 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 View Post
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
pro4never is offline  
Old 03/01/2011, 06:50   #8
 
WarpGeorge's Avatar
 
elite*gold: 0
Join Date: May 2010
Posts: 133
Received Thanks: 27
Quote:
Originally Posted by pro4never View Post
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...
WarpGeorge is offline  
Old 03/01/2011, 06:55   #9
 
elite*gold: 0
Join Date: Mar 2009
Posts: 518
Received Thanks: 238
Quote:
Originally Posted by WarpGeorge View Post
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.
DeathByMoogles is offline  
Old 03/01/2011, 08:51   #10
 
WarpGeorge's Avatar
 
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.
WarpGeorge is offline  
Old 03/01/2011, 13:06   #11
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Quote:
Originally Posted by WarpGeorge View Post
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.
nTL3fTy is offline  
Old 03/01/2011, 14:30   #12
 
WarpGeorge's Avatar
 
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.
WarpGeorge is offline  
Old 03/01/2011, 14:47   #13
 
elite*gold: 0
Join Date: Jun 2006
Posts: 457
Received Thanks: 67
Quote:
Originally Posted by pro4never View Post
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.
shitboi is offline  
Old 03/01/2011, 15:08   #14
 
WarpGeorge's Avatar
 
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...
WarpGeorge is offline  
Old 03/02/2011, 01:56   #15
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Magictype.dat structure:
datatypename
intamount
uint[amount]id
MagicType[amount]magictypes

MagicType structure:

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.
nTL3fTy is offline  
Thanks
2 Users
Reply


Similar Threads 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.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.