Exemple #1
0
        public AL ParseObject(byte[] buffer)
        {
            //到时候这个也要拿走的
            string type = Encoding.ASCII.GetString(buffer.Take(4).ToArray());

            byte[] body = buffer;
            AL     al   = new AL(buffer);

            Console.WriteLine(type);
            switch (type)
            {
            case "ALLZ":
                byte[] decompressedBuffer = ALLZ.Decompress(body);
                AL     result             = ParseObject(decompressedBuffer);
                if (result.GetType().Name != "AL")
                {
                    al = result;
                }
                break;

            case "ALTB":
                al = new ALTB(body);
                break;

            case "ALAR":
                al = new ALAR(body);
                ALAR alar = (ALAR)al;
                for (int i = 0; i < alar.Count; i++)
                {
                    alar.Files[i].ParsedContent = ParseObject(alar.Files[i].Content);
                }
                break;

            case "ALFT":
                al = new ALFT(body);
                break;
            }
            return(al);
        }
Exemple #2
0
        public static byte[] Decompress(byte[] buffer)
        {
            ALLZ obj = new ALLZ(buffer);

            return(obj.Decompress());
        }