Need help decrypting MagicType.dat

02/13/2011 12:31 WarpGeorge#1
I tried to decrypt the MagicType.dat file (the 5065 version) and it can't be decrypted or I don't have the required programs to do it. I tried every single decryptor I've found here and still no result. The thing is, for this version, the file has 1 MB while the lower or higher versions have it with aprox 400 KB. I think it's encrypted with another program than the other lower or higher versions.
Here's a part of the codes that appearing into it after decrypting with DatCryptor:
Code:
됼翓ﳜሸਂ뻣焕ᅔ퍎꣨⮓갠롆�ႝ옌ꮈ㻙霗ࣴ攸₅ꭱ�ᕠ뀲젚ᬕ㋏뀝脑�㕖ﳕ瀞폤韣詌璥욼큈ࡘ臀㘖㰔ꎔ莤ଌ狧Ꞗ奢鸐ꏶ☫痋ℷ翓谑ሸ෭뻣Njᅔ啝꣨䏂갠概롆見�靓옌퍤뤩霗烻攸ꝵꭱꜻᕠ摨뀲냃ᬕ땔뀝屢�덲钤瀞唦韣璥쟐큈ᣒ臀랇ⱷꎔȅଌ樝Ꞗ潂奢鸐∄☫淑ꁧ翓鑒ሸహ뻣ᇱᅔ헓꣨䬪갠롆膑�ᘓ옌쭕㠼霗梊攸♠ꭱ뿙ᕠ
Do I need another decrypting tool or what should I do?
I heard something about such as binary file and that hey need to be opened with hex editor but I can't really figure out how to do it...Any hints will be really appreciated!
02/13/2011 13:33 Korvacs#2
I beleive 5065 is still the version where by you can read it using a binaryreader and there isnt any encryption for it. See messy example:

Code:
        public static Dictionary<uint, MagicTypeEntry> Parse()
        {
            Dictionary<uint, MagicTypeEntry> MagicData = new Dictionary<uint, MagicTypeEntry>();

            while (!Monitor.TryEnter(Console.Out, 50)) { }
            Console.Write("[Game Server] Loading Magic Data...");
            int Left = Console.CursorLeft;
            FileStream File = new FileStream(Settings.MagicType, FileMode.Open);
            BinaryReader Reader = new BinaryReader(File);

            int start = System.Environment.TickCount;
            uint Amount = Reader.ReadUInt32();

            MagicTypeEntry _MDetail;

            File.Seek(4 * Amount, SeekOrigin.Current);

            for (int i = 0; i < Amount; i++)
            {
                _MDetail = new MagicTypeEntry();
                _MDetail.SpellID = Reader.ReadUInt32();
                _MDetail.Method = (MagicAttackMethod)Reader.ReadUInt32();

                for (int x = 0; x < 16; x++)
                {
                    _MDetail.SpellName += (char)Reader.ReadByte();
                }
                _MDetail.SpellName = _MDetail.SpellName.Trim('\0');


                Console.Write(_MDetail.SpellID);
                Console.CursorLeft = Left;

                _MDetail.Aggressive = Convert.ToBoolean(Reader.ReadUInt32());

                File.Seek(16, SeekOrigin.Current);

                _MDetail.ManaReq = (ushort)Reader.ReadUInt32();
                _MDetail.StatusEffect = Reader.ReadUInt32();
                _MDetail.SuccessRate = (byte)Reader.ReadUInt32();
                _MDetail.Timer = Reader.ReadUInt32();

                File.Seek(16, SeekOrigin.Current);

                uint Unknown4 = Reader.ReadUInt32();
                _MDetail.ExpReq = Reader.ReadUInt32();

                File.Seek(48, SeekOrigin.Current);

                _MDetail.UpgradeSkillID = Reader.ReadUInt32();

                File.Seek(4, SeekOrigin.Current);

                uint Unknown6 = Reader.ReadUInt32();
                uint Unknown7 = Reader.ReadUInt32();

                for (int x = 0; x < 64; x++)
                {
                    _MDetail.Upgrade += (char)Reader.ReadByte();
                }
                _MDetail.Upgrade = _MDetail.Upgrade.Trim('\0');

                uint Unknown8 = Reader.ReadUInt32();
                uint Unknown9 = Reader.ReadUInt32();
                uint Unknown10 = Reader.ReadUInt32();

                File.Seek(244, SeekOrigin.Current);

                for (int x = 0; x < 64; x++)
                {
                    _MDetail.EffectName += (char)Reader.ReadByte();
                }
                _MDetail.EffectName = _MDetail.EffectName.Trim('\0');                

                string Unknown11 = string.Empty;

                for (int x = 0; x < 64; x++)
                {
                    Unknown11 += (char)Reader.ReadByte();
                }
                Unknown11 = Unknown11.Trim('\0');

                File.Seek(196, SeekOrigin.Current);

                string Unknown12 = string.Empty;

                for (int x = 0; x < 64; x++)
                {
                    Unknown12 += (char)Reader.ReadByte();
                }
                Unknown12 = Unknown12.Trim('\0');

                string Unknown13 = string.Empty;

                for (int x = 0; x < 64; x++)
                {
                    Unknown13 += (char)Reader.ReadByte();
                }
                Unknown13 = Unknown13.Trim('\0');

                File.Seek(264, SeekOrigin.Current);

                for (int x = 0; x < 256; x++)
                {
                    _MDetail.SoundPath += (char)Reader.ReadByte();
                }
                _MDetail.SoundPath = _MDetail.SoundPath.Trim('\0');

                File.Seek(4, SeekOrigin.Current);

                string Unknown14 = string.Empty;

                for (int x = 0; x < 64; x++)
                {
                    Unknown14 += (char)Reader.ReadByte();
                }
                Unknown14 = Unknown14.Trim('\0');

                string Unknown15 = string.Empty;

                for (int x = 0; x < 64; x++)
                {
                    Unknown15 += (char)Reader.ReadByte();
                }
                Unknown15 = Unknown15.Trim('\0');

                File.Seek(12, SeekOrigin.Current);

                /*MagicLogger.WriteLine(_MDetail.SpellName + " " + _MDetail.SpellID + " " + _MDetail.Method + " " + _MDetail.ManaReq + " " + _MDetail.StatusEffect + " " + _MDetail.SuccessRate +
                    " " + _MDetail.Timer + " " + _MDetail.Level + " " + _MDetail.ManaReq + " " + _MDetail.ExpReq + " " + _MDetail.Timer + " " + _MDetail.UpgradeSkillID + " " + Unknown6 +
                    " " + Unknown7 + " " + _MDetail.Upgrade + " " + Unknown8 + " " + Unknown9 + " " + Unknown10 + " " + _MDetail.EffectName + " " + Unknown11 + " " +
                    Unknown12 + " " + Unknown13 + " " + _MDetail.SoundPath + " " + Unknown14 + " " + Unknown15);*/
            }
            Console.Write("Completed in {0}ms\n", Environment.TickCount - start);
            Monitor.Exit(Console.Out);

            File.Dispose();
            File.Close();
            Reader.Close();

            return MagicData;
        }
This is a 4267 MagicType loader, but you get the general idea.
02/13/2011 13:52 WarpGeorge#3
Thanks alot for your quick feedback Korv, but, that C# source-code you have posted out it's kind of troublesome to me cause I am a really newbie when it comes about C#. I wish to know what to do with that source-code.
02/13/2011 13:53 Iron~Man#4
Request On Epvp
Release On 4Botters.

Awesome.
02/13/2011 13:58 WarpGeorge#5
Quote:
Originally Posted by Iron~Man View Post
Request On Epvp
Release On 4Botters.

Awesome.
I'm not doing this to release it on 4Botters. I do this for myself, for my own purposes. Even if I would do this to release it there, I would give the credits to the ones who helped me, but people like you are just irretrievable...
02/13/2011 14:47 Korvacs#6
The key to what i posted is the binary reader object, it opens a specific file and you read the data as you need it, since there are many entries you need to read the amount of entries that there are and create some form of loop to read each entry, what you do with the data is then upto you, mine puts the data in a structure and inserts that to a dictionary for later use, be that writing a text file or accessing it while the server is online.

Google binary reader if you get stuck.
02/13/2011 21:12 WarpGeorge#7
Quote:
Originally Posted by Korvacs View Post
The key to what i posted is the binary reader object, it opens a specific file and you read the data as you need it, since there are many entries you need to read the amount of entries that there are and create some form of loop to read each entry, what you do with the data is then upto you, mine puts the data in a structure and inserts that to a dictionary for later use, be that writing a text file or accessing it while the server is online.

Google binary reader if you get stuck.
Thanks alot! I might get stucked again, I'm not so familiar with C# but I'll not give up until I find a way to solve this :)
02/17/2011 14:26 Korvacs#8
Cleaned.