public static void Processor(bool Extract) { KKdFARC FARC = new KKdFARC(); Console.Clear(); if (Extract) { Console.Title = "FARC Extractor"; Main.Choose(1, "farc", out string[] FileNames); foreach (string FileName in FileNames) { if (FileName != "" && File.Exists(FileName)) { FARC.UnPack(FileName); } } } else { string file = Main.Choose(2, "", out string[] FileNames); Console.Clear(); Console.Title = "FARC Creator"; if (file != "") { Main.ConsoleDesign(true); Main.ConsoleDesign(" Choose type of created FARC:"); Main.ConsoleDesign(false); Main.ConsoleDesign("1. FArc [DT/DT2nd/DTex/F/F2nd/X]"); Main.ConsoleDesign("2. FArC [DT/DT2nd/DTex/F/F2nd/X] (Compressed)"); Main.ConsoleDesign("3. FARC [F/F2nd/X] (Compressed)"); Main.ConsoleDesign("4. FARC [FT] (Compressed)"); Main.ConsoleDesign(false); Main.ConsoleDesign("Note: Creating FT FARCs currently not supported."); Main.ConsoleDesign(false); Main.ConsoleDesign(true); Console.WriteLine(); Console.WriteLine("Choosed folder: {0}", file); Console.WriteLine(); int.TryParse(Console.ReadLine(), out int type); if (type == 1) { FARC.Signature = KKdFARC.Farc.FArc; } else if (type == 3) { FARC.Signature = KKdFARC.Farc.FARC; } else { FARC.Signature = KKdFARC.Farc.FArC; } Console.Clear(); Console.Title = "FARC Creator - Directory: " + Path.GetDirectoryName(file); FARC.Pack(file); } } }
public static void Main(string[] args) { SetProcessDPIAware(); Console.Title = "PD_Tool"; if (args.Length == 0) { while (choose != "Q") { MainMenu(); } Exit(); } long header; Stream reader; foreach (string arg in args) { GC.Collect(); if (Directory.Exists(arg)) { using (KKdFARC FARC = new KKdFARC(arg, true)) FARC.Pack(); } else if (File.Exists(arg) && Path.GetExtension(arg) == ".farc") { using (KKdFARC farc = new KKdFARC(arg)) farc.UnPack(true); } else if (File.Exists(arg)) { using (reader = File.OpenReader(arg)) header = reader.RI64(); if (header == 0x454C494641564944) { KKdMainLib.DIVAFILE.Decrypt(arg); } } } Exit(); }