Dat File En/Decrypter by Gabrola

11/04/2009 19:32 gabrola#1
Fairly simple no need to explain anything.
Encrypted Dat file to readable txt conversion and vice-versa
Need .NET Framework 3.5 to run it.
11/05/2009 21:36 hecavante#2
so where r the file ?

dont tell me u forgot to upload it ? :D
11/06/2009 01:45 gabrola#3
I uploaded it but for some reason it didn't show =/
Anyway, it's there now :D
12/25/2009 22:54 gabrola#4
Bump
12/26/2009 16:57 Arcо#5
So does this work for any encrypted dat file in the client?
12/26/2009 20:57 gabrola#6
Yep.
12/27/2009 10:53 ~Yuki~#7
Thanks.
My result:
12/31/2009 23:10 gabrola#8
You're doing something wrong for sure, btw it doesn't work on server.dat that doesn't use the same encryption algorithm.
12/31/2009 23:23 InfamousNoone#9
Isn't there like 5k of these of E*PVP?
Code:
    public class JEncryptedDatFile
    {
        private static byte[] Key =
        {
            (byte) 0xAD, (byte) 0x6B, (byte) 0x4F, (byte) 0xFB, (byte) 0xDD, (byte) 0xB8, 
            (byte) 0x0E, (byte) 0x09, (byte) 0x13, (byte) 0x33, (byte) 0x8F, (byte) 0xF5, 
            (byte) 0x43, (byte) 0x09, (byte) 0x15, (byte) 0x88, (byte) 0x5D, (byte) 0x80, 
            (byte) 0xA3, (byte) 0x45, (byte) 0x2D, (byte) 0x42, (byte) 0x08, (byte) 0x56, 
            (byte) 0x80, (byte) 0xF8, (byte) 0x19, (byte) 0xC5, (byte) 0x88, (byte) 0x1B, 
            (byte) 0x3E, (byte) 0xEF, (byte) 0x81, (byte) 0x07, (byte) 0x30, (byte) 0x36, 
            (byte) 0x95, (byte) 0x52, (byte) 0x00, (byte) 0xF7, (byte) 0xFD, (byte) 0x5B, 
            (byte) 0x5C, (byte) 0xBC, (byte) 0x6A, (byte) 0x26, (byte) 0x0E, (byte) 0xB2, 
            (byte) 0xA3, (byte) 0x67, (byte) 0xC5, (byte) 0x5D, (byte) 0x6F, (byte) 0xDC, 
            (byte) 0x18, (byte) 0x8A, (byte) 0xB5, (byte) 0xE0, (byte) 0xC8, (byte) 0x85, 
            (byte) 0xE2, (byte) 0x3E, (byte) 0x45, (byte) 0x8D, (byte) 0x8B, (byte) 0x43, 
            (byte) 0x74, (byte) 0x85, (byte) 0x54, (byte) 0x17, (byte) 0xB0, (byte) 0xEC, 
            (byte) 0x10, (byte) 0x4D, (byte) 0x0F, (byte) 0x0F, (byte) 0x29, (byte) 0xB8, 
            (byte) 0xE6, (byte) 0x7D, (byte) 0x42, (byte) 0x80, (byte) 0x8F, (byte) 0xBC, 
            (byte) 0x1C, (byte) 0x76, (byte) 0x69, (byte) 0x3A, (byte) 0xB6, (byte) 0xA5, 
            (byte) 0x21, (byte) 0x86, (byte) 0xB9, (byte) 0x29, (byte) 0x30, (byte) 0xC0, 
            (byte) 0x12, (byte) 0x45, (byte) 0xA5, (byte) 0x4F, (byte) 0xE1, (byte) 0xAF, 
            (byte) 0x25, (byte) 0xD1, (byte) 0x92, (byte) 0x2E, (byte) 0x30, (byte) 0x58, 
            (byte) 0x49, (byte) 0x67, (byte) 0xA5, (byte) 0xD3, (byte) 0x84, (byte) 0xF4, 
            (byte) 0x89, (byte) 0xCA, (byte) 0xFC, (byte) 0xB7, (byte) 0x04, (byte) 0x4F, 
            (byte) 0xCC, (byte) 0x6E, (byte) 0xAC, (byte) 0x31, (byte) 0xD4, (byte) 0x87, 
            (byte) 0x07, (byte) 0x72
        };

        public string FileName { get; private set; }
        public JEncryptedDatFile(string File)
        {
            this.FileName = File;
        }
        public void Encrypt(string OutputFile)
        {
            byte[] bytes = File.ReadAllBytes(FileName);
            int i = 0;
            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[i % 0x80]);
                i++;
            }
            File.WriteAllBytes(OutputFile, bytes);
        }
        public void Decrypt(string OutputFile)
        {
            byte[] bytes = File.ReadAllBytes(FileName);
            int i = 0;
            int t1 = 0;
            int t2;
            while (i < bytes.Length)
            {
                t1 = ((int)bytes[i] ^ (int)Key[i % 0x80]) & 0xff;
                t2 = i % 0x8;
                bytes[i] = (byte)(((t1 << 0x8 - t2)) | (t1 >> t2));
                i++;
            }
            File.WriteAllBytes(OutputFile, bytes);
        }
    }
12/31/2009 23:44 gabrola#10
Maybe lol
02/16/2010 17:49 MonoLo#11
lol xDDDD