예제 #1
0
        public static void Main(string[] args)
        {
            if (args[0].Length == 0)
            {
                throw new ArgumentException("You must provide a final.redscripts file!");
            }

            byte[] fileBytes = File.ReadAllBytes(args[0]);

            using MemoryStream input  = new MemoryStream(fileBytes, false);
            using MemoryStream output = new MemoryStream();

            cache = CacheFile.Load(input, false);
            cg    = new CodeGenerator();

            CreateNatives();
            CreateFunctions();

            ApplyPatches();

            cache.Save(output);
            output.Flush();

            File.WriteAllBytes("output.redscripts", output.ToArray());
        }