READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

BF2 - BFP4F DFM Menu files

Get your graphics formats figures out here! Got details for others? Post here!
Post Reply
warrantyvoider
beginner
Posts: 20
Joined: Tue May 03, 2016 2:13 pm
Been thanked: 14 times

BF2 - BFP4F DFM Menu files

Post by warrantyvoider » Thu Jan 24, 2019 10:26 am

someone asked me about this, so I looked into it, its just a simple XOR encryption:

Code: Select all

 class Program
    {
        static byte[] key = { 0x0B, 0xAD, 0xF0, 0x0D };

        static void Main(string[] args)
        {
            if (args.Length != 1 || !File.Exists(args[0]))
            {
                ShowUsage();
                return;
            }
            byte[] input = File.ReadAllBytes(args[0]);
            for (int i = 0; i < input.Length; i++)
                input[i] ^= key[i % 4];
            string name = Path.GetFileNameWithoutExtension(args[0]);
            if (args[0].ToLower().Trim().EndsWith(".dfm"))
                name += ".swf";
            else
                name += ".dfm";
            File.WriteAllBytes(name, input);
        }

        static void ShowUsage()
        {
            Console.WriteLine("DFM Converter Tool by Warranty Voider");
            Console.WriteLine("Usage:");
            Console.WriteLine(" DFMTool filename[.swf|.dfm]");
            Console.WriteLine(" DFMTool input.dfm");
            Console.WriteLine(" DFMTool input.swf");
        }
    }

greetz

Post Reply