Exemple #1
0
        public static void Main(string[] args)
        {
            Console.Title = "PD_Tool";

            if (args.Length == 0)
            {
                while (function != "Q") MainMenu();
                Exit();
            }

            string header;
            Stream reader;
            KKdFARC Farc;

            foreach (string arg in args)
            {
                Farc = new KKdFARC();
                     if (Directory.Exists(arg)) Farc.Pack(arg);
                else if (File.Exists(arg) && Path.GetExtension(arg) == ".farc") Farc.UnPack(arg, true);
                else if (File.Exists(arg))
                {
                    reader = File.OpenReader(arg);
                    header = reader.ReadString(8);
                    reader.Close();
                    if (header.ToUpper() == "DIVAFILE") DIVAFILE.Decrypt(arg);
                }
            }
            Exit();
        }
Exemple #2
0
 private static void Functions()
 {
     Console.Clear();
     if (function == "1" || function == "2") FARC.Processor(function == "1");
     else if (function == "3" || function == "4")
     {
         KKdMain.Choose(1, "", out string[] FileNames);
         foreach (string FileName in FileNames) DIVAFILE.Decrypt(FileName);
     }
     else if (function == "5") DataBase.Processor(JSON);
     else if (function == "6")
     {
         Console.Clear();
         Console.Title = "Converter Tools";
         KKdMain.ConsoleDesign(true);
         KKdMain.ConsoleDesign("                 Choose tool:");
         KKdMain.ConsoleDesign(false);
         KKdMain.ConsoleDesign("1. A3DA     Converter");
         KKdMain.ConsoleDesign("2. DEX      Converter");
         KKdMain.ConsoleDesign("3. DIVA     Converter");
         KKdMain.ConsoleDesign("4. STR      Converter");
         KKdMain.ConsoleDesign("5. VAG      Converter");
         KKdMain.ConsoleDesign("6. DataBank Converter");
         KKdMain.ConsoleDesign(false);
         KKdMain.ConsoleDesign("R. Return to Main Menu");
         KKdMain.ConsoleDesign(false);
         KKdMain.ConsoleDesign(true);
         Console.WriteLine();
         string Function = Console.ReadLine();
         Console.Clear();
              if (Function == "1") Tools.A3D.Processor(JSON);
         else if (Function == "2") Tools.DEX.Processor(JSON);
         else if (Function == "3") Tools.DIV.Processor();
         else if (Function == "4") Tools.STR.Processor(JSON);
         else if (Function == "5") Tools.VAG.Processor();
         else if (Function == "6") Tools.DB .Processor();
         else     function = Function;
     }
 }
Exemple #3
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);
            }
        }
Exemple #4
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();
                    }
                }
            }
        }
Exemple #5
0
 private static void Functions()
 {
     Console.Clear();
     if (choose == "1" || choose == "2")
     {
         FARC.Processor(choose == "1");
     }
     else if (choose == "3" || choose == "4")
     {
         Choose(1, "", out string[] FileNames);
         foreach (string FileName in FileNames)
         {
             DIVAFILE.Decrypt(FileName);
         }
     }
     else if (choose == "5")
     {
         DataBase.Processor(json);
     }
     else if (choose == "6")
     {
         Console.Clear();
         Console.Title = "AC/DT/F/AFT/FT 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(false);
         ConsoleDesign("R. Return to Main Menu");
         ConsoleDesign(false);
         ConsoleDesign(true);
         Console.WriteLine();
         string localChoose = Console.ReadLine();
         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")
         {
             MOT.Processor(json);
         }
         else if (localChoose == "7")
         {
             STR.Processor(json);
         }
         else
         {
             choose = localChoose;
         }
     }
     else if (choose == "7")
     {
         Console.Clear();
         Console.Title = "F/F2/X/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. Particles");
         ConsoleDesign("8. STR");
         ConsoleDesign("9. VAG");
         ConsoleDesign(false);
         ConsoleDesign("R. Return to Main Menu");
         ConsoleDesign(false);
         ConsoleDesign(true);
         Console.WriteLine();
         string localChoose = Console.ReadLine();
         if (localChoose == "1")
         {
             A3D.Processor(json);
         }
         else if (localChoose == "2")
         {
             BLT.Processor();
         }
         else if (localChoose == "3")
         {
             CCT.Processor();
         }
         else if (localChoose == "4")
         {
             DEX.Processor(json);
         }
         else if (localChoose == "5")
         {
             DFT.Processor();
         }
         else if (localChoose == "6")
         {
             LIT.Processor();
         }
         else if (localChoose == "7")
         {
             STR.Processor(json);
         }
         else if (localChoose == "8")
         {
             VAG.Processor();
         }
         else
         {
             choose = localChoose;
         }
     }
     else if (choose == "8")
     {
         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);
                 file.Replace(Path.GetExtension(file), "").ToJSON();
             }
             else
             {
                 Console.Title = "JSON to MsgPack: " + Path.GetFileNameWithoutExtension(file);
                 file.Replace(Path.GetExtension(file), "").ToMsgPack();
             }
         }
     }
 }
Exemple #6
0
 private static void Functions()
 {
     Console.Clear();
     if (function == "1" || function == "2")
     {
         FARC.Processor(function == "1");
     }
     else if (function == "3" || function == "4")
     {
         KKdMain.Choose(1, "", out string[] FileNames);
         foreach (string FileName in FileNames)
         {
             DIVAFILE.Decrypt(FileName);
         }
     }
     else if (function == "5")
     {
         DataBase.Processor(JSON);
     }
     else if (function == "6")
     {
         Console.Clear();
         Console.Title = "Converter Tools";
         KKdMain.ConsoleDesign(true);
         KKdMain.ConsoleDesign("                 Choose tool:");
         KKdMain.ConsoleDesign(false);
         KKdMain.ConsoleDesign("1. A3DA     Converter");
         KKdMain.ConsoleDesign("2. AET      Converter");
         KKdMain.ConsoleDesign("3. DataBank Converter");
         KKdMain.ConsoleDesign("4. DEX      Converter");
         KKdMain.ConsoleDesign("5. DIVA     Converter");
         KKdMain.ConsoleDesign("6. STR      Converter");
         KKdMain.ConsoleDesign("7. VAG      Converter");
         KKdMain.ConsoleDesign(false);
         KKdMain.ConsoleDesign("R. Return to Main Menu");
         KKdMain.ConsoleDesign(false);
         KKdMain.ConsoleDesign(true);
         Console.WriteLine();
         string Function = Console.ReadLine();
         Console.Clear();
         if (Function == "1")
         {
             Tools.A3D.Processor(JSON);
         }
         else if (Function == "2")
         {
             Tools.AET.Processor(JSON);
         }
         else if (Function == "3")
         {
             Tools.DB.Processor(JSON);
         }
         else if (Function == "4")
         {
             Tools.DEX.Processor(JSON);
         }
         else if (Function == "5")
         {
             Tools.DIV.Processor();
         }
         else if (Function == "6")
         {
             Tools.STR.Processor(JSON);
         }
         else if (Function == "7")
         {
             Tools.VAG.Processor();
         }
         else
         {
             function = Function;
         }
     }
     else if (function == "7")
     {
         KKdMain.Choose(1, JSON ? "mp" : "json", out string[] FileNames);
         if (JSON)
         {
             foreach (string file in FileNames)
             {
                 KKdMainLib.MessagePack.MPExt.ToJSON(file.Replace(Path.GetExtension(file), ""));
             }
         }
         else
         {
             foreach (string file in FileNames)
             {
                 KKdMainLib.MessagePack.MPExt.ToMsgPack(file.Replace(Path.GetExtension(file), ""));
             }
         }
     }
 }