Пример #1
0
        static void DIVAFILEEncDec(int I, string file, int code)
        {
            if (File.Exists(file))
            {
                KKtIO  reader = KKtIO.OpenReader(file);
                string header = reader.ReadString(8);
                reader.Close();
                Console.Clear();
                switch (function)
                {
                case "3":
                    if (header.ToUpper() == "DIVAFILE")
                    {
                        DIVAFILE.Decrypt(I, file);
                    }
                    else if (code == 1)
                    {
                        Console.WriteLine("This file isn't DIVAFILE, FARC Archive or F2nd/X DSC.");
                    }
                    else
                    {
                        ReturnCode = 81;
                    }
                    break;

                case "4":
                    if (code != 1)
                    {
                        DIVAFILE.Encrypt(I, file);
                    }
                    break;
                }
            }
            else
            {
                Console.WriteLine("File {0} doesn't exist!", file);
            }
        }
Пример #2
0
        private static void Functions()
        {
            Console.Clear();
            if (choose == null || choose == "")
            {
                return;
            }

            if (choose[0] == '1' || choose[0] == '2')
            {
                FARC.Processor(choose == "1");
            }
            else if (choose[0] == '3')
            {
                Choose(1, "", out string[] FileNames);
                foreach (string FileName in FileNames)
                {
                    DIVAFILE.Decrypt(FileName);
                }
            }
            else if (choose[0] == '4')
            {
                Choose(1, "", out string[] FileNames);
                foreach (string FileName in FileNames)
                {
                    DIVAFILE.Encrypt(FileName);
                }
            }
            else if (choose[0] == '5')
            {
                DataBase.Processor(json, choose.Length > 1 ? choose[1] : '\0');
            }
            else if (choose[0] == '6')
            {
                string localChoose = "";
                if (choose.Length == 1)
                {
                    Console.Clear();
                    Console.Title = "AC/DT/F/AFT Converting Tools";
                    ConsoleDesign(true);
                    ConsoleDesign("               Choose converter:");
                    ConsoleDesign(false);
                    ConsoleDesign("1. A3DA");
                    ConsoleDesign("2. AET");
                    ConsoleDesign("3. DataBank");
                    ConsoleDesign("4. DEX");
                    ConsoleDesign("5. DIVA");
                    ConsoleDesign("6. MotHead");
                    ConsoleDesign("7. MOT");
                    ConsoleDesign("8. STR");
                    ConsoleDesign("9. Table");
                    ConsoleDesign(false);
                    ConsoleDesign("R. Return to Main Menu");
                    ConsoleDesign(false);
                    ConsoleDesign(true);
                    Console.WriteLine();
                    localChoose = Console.ReadLine().ToUpper();
                }
                else
                {
                    localChoose = choose[1].ToString();
                }
                if (localChoose == "1")
                {
                    A3D.Processor(json);
                }
                else if (localChoose == "2")
                {
                    AET.Processor(json);
                }
                else if (localChoose == "3")
                {
                    DB.Processor(json);
                }
                else if (localChoose == "4")
                {
                    DEX.Processor(json);
                }
                else if (localChoose == "5")
                {
                    DIV.Processor();
                }
                else if (localChoose == "6")
                {
                    MHD.Processor(json);
                }
                else if (localChoose == "7")
                {
                    MOT.Processor(json);
                }
                else if (localChoose == "8")
                {
                    STR.Processor(json);
                }
                else if (localChoose == "9")
                {
                    TBL.Processor(json);
                }
                else
                {
                    choose = localChoose;
                }
            }
            else if (choose[0] == '7')
            {
                string localChoose = "";
                if (choose.Length == 1)
                {
                    Console.Clear();
                    Console.Title = "F/F2/FT Converting Tools";
                    ConsoleDesign(true);
                    ConsoleDesign("               Choose converter:");
                    ConsoleDesign(false);
                    ConsoleDesign("1. A3DA");
                    ConsoleDesign("2. Bloom");
                    ConsoleDesign("3. Color Correction");
                    ConsoleDesign("4. DEX");
                    ConsoleDesign("5. DOF");
                    ConsoleDesign("6. Light");
                    ConsoleDesign("7. STR");
                    ConsoleDesign("8. VAG");
                    ConsoleDesign(false);
                    ConsoleDesign("R. Return to Main Menu");
                    ConsoleDesign(false);
                    ConsoleDesign(true);
                    Console.WriteLine();
                    localChoose = Console.ReadLine().ToUpper();
                }
                else
                {
                    localChoose = choose[1].ToString();
                }
                if (localChoose == "1")
                {
                    A3D.Processor(json);
                }
                else if (localChoose == "2")
                {
                    BLT.Processor(json);
                }
                else if (localChoose == "3")
                {
                    CCT.Processor(json);
                }
                else if (localChoose == "4")
                {
                    DEX.Processor(json);
                }
                else if (localChoose == "5")
                {
                    DFT.Processor(json);
                }
                else if (localChoose == "6")
                {
                    LIT.Processor(json);
                }
                else if (localChoose == "7")
                {
                    STR.Processor(json);
                }
                else if (localChoose == "8")
                {
                    VAG.Processor();
                }
                else
                {
                    choose = localChoose;
                }
            }
            else if (choose[0] == '8')
            {
                string localChoose = "";
                if (choose.Length == 1)
                {
                    Console.Clear();
                    Console.Title = "X/XHD Converting Tools";
                    ConsoleDesign(true);
                    ConsoleDesign("               Choose converter:");
                    ConsoleDesign(false);
                    ConsoleDesign("1. A3DA");
                    ConsoleDesign("2. Bloom");
                    ConsoleDesign("3. Color Correction");
                    ConsoleDesign("4. DEX");
                    ConsoleDesign("5. DOF");
                    ConsoleDesign("6. Light");
                    ConsoleDesign("7. VAG");
                    ConsoleDesign(false);
                    ConsoleDesign("R. Return to Main Menu");
                    ConsoleDesign(false);
                    ConsoleDesign(true);
                    Console.WriteLine();
                    localChoose = Console.ReadLine().ToUpper();
                }
                else
                {
                    localChoose = choose[1].ToString();
                }
                if (localChoose == "1")
                {
                    A3D.Processor(json);
                }
                else if (localChoose == "2")
                {
                    BLT.Processor(json);
                }
                else if (localChoose == "3")
                {
                    CCT.Processor(json);
                }
                else if (localChoose == "4")
                {
                    DEX.Processor(json);
                }
                else if (localChoose == "5")
                {
                    DFT.Processor(json);
                }
                else if (localChoose == "6")
                {
                    LIT.Processor(json);
                }
                else if (localChoose == "7")
                {
                    VAG.Processor();
                }
                else
                {
                    choose = localChoose;
                }
            }
            else if (choose[0] == '9')
            {
                string localChoose = "";
                if (choose.Length == 1)
                {
                    Console.Clear();
                    Console.Title = "FT/M39 Converting Tools";
                    ConsoleDesign(true);
                    ConsoleDesign("               Choose converter:");
                    ConsoleDesign(false);
                    ConsoleDesign("1. A3DA");
                    ConsoleDesign("2. AET");
                    ConsoleDesign("3. DEX");
                    ConsoleDesign("4. DIVA");
                    ConsoleDesign("5. MotHead");
                    ConsoleDesign("6. MOT");
                    ConsoleDesign("7. STR");
                    ConsoleDesign("8. Table");
                    ConsoleDesign(false);
                    ConsoleDesign("R. Return to Main Menu");
                    ConsoleDesign(false);
                    ConsoleDesign(true);
                    Console.WriteLine();
                    localChoose = Console.ReadLine().ToUpper();
                }
                else
                {
                    localChoose = choose[1].ToString();
                }
                if (localChoose == "1")
                {
                    A3D.Processor(json);
                }
                else if (localChoose == "2")
                {
                    AET.Processor(json);
                }
                else if (localChoose == "3")
                {
                    DEX.Processor(json);
                }
                else if (localChoose == "4")
                {
                    DIV.Processor();
                }
                else if (localChoose == "5")
                {
                    MHD.Processor(json);
                }
                else if (localChoose == "6")
                {
                    MOT.Processor(json);
                }
                else if (localChoose == "7")
                {
                    STR.Processor(json);
                }
                else if (localChoose == "8")
                {
                    TBL.Processor(json);
                }
                else
                {
                    choose = localChoose;
                }
            }
            else if (choose[0] == 'A')
            {
                Console.Title = json ? "MsgPack to JSON" : "JSON to MsgPack";
                Choose(1, json ? "mp" : "json", out string[] fileNames);
                foreach (string file in fileNames)
                {
                    if (json)
                    {
                        Console.Title = "MsgPack to JSON: " + Path.GetFileNameWithoutExtension(file);
                        Path.RemoveExtension(file).ToJSON();
                    }
                    else
                    {
                        Console.Title = "JSON to MsgPack: " + Path.GetFileNameWithoutExtension(file);
                        Path.RemoveExtension(file).ToMsgPack();
                    }
                }
            }
        }