Esempio n. 1
0
        private static void Detect(DetectOptions opt)
        {
            // Get unpacker
            var unpacker = UnpackerRegistry.Get(opt.Directory);

            Console.WriteLine(unpacker.GetType().Name);
        }
Esempio n. 2
0
        private static void Extract(ExtractOptions opt)
        {
            // Get unpacker
            var unpacker = UnpackerRegistry.Get(opt.Directory);

            if (unpacker is null)
            {
                Console.WriteLine("Couldn't find an unpacker for this game/engine.");
                return;
            }

            foreach (IExtractableFile file in unpacker.LoadFiles(opt.Directory))
            {
                if (file.Path is null)
                {
                    // TODO: make up your own path I guess
                    Console.WriteLine("File had no path, not extracting for now!");
                    continue;
                }

                Console.WriteLine("Extracting " + file.Path);

                // could add another directory to this for the game or something
                string fullPath = Path.Combine(Environment.CurrentDirectory, ExtractDirectory, file.Path);

                string fileDir = Path.GetDirectoryName(fullPath) ?? string.Empty;
                if (!Directory.Exists(fileDir))
                {
                    Directory.CreateDirectory(fileDir);
                }

                using (var stream = File.OpenWrite(fullPath))
                    file.WriteToStream(stream);
            }
        }
Esempio n. 3
0
        private static void List(ListOptions opt)
        {
            // Get unpacker
            var unpacker = UnpackerRegistry.Get(opt.Directory);

            foreach (IExtractableFile file in unpacker.LoadFiles(opt.Directory).OrderBy(x => x.Path))
            {
                Console.WriteLine(file.Path);
            }
        }
Esempio n. 4
0
 static Program()
 {
     // Register all types
     UnpackerRegistry.Register <ArtemisUnpacker>(ArtemisUnpacker.IsGameFolder);
     UnpackerRegistry.Register <AIMSUnpacker>(AIMSUnpacker.IsGameFolder);
     UnpackerRegistry.Register <RenPyUnpacker>(RenPyUnpacker.IsGameFolder);
     UnpackerRegistry.Register <CatSystem2Unpacker>(CatSystem2Unpacker.IsGameFolder);
     UnpackerRegistry.Register <MajiroArcUnpacker>(MajiroArcUnpacker.IsGameFolder);
     UnpackerRegistry.Register <AdvHDUnpacker>(AdvHDUnpacker.IsGameFolder);
     UnpackerRegistry.Register <HyPackUnpacker>(HyPackUnpacker.IsGameFolder);
     UnpackerRegistry.Register <NekoPackUnpacker>(NekoPackUnpacker.IsGameFolder);
     UnpackerRegistry.Register <CriUnpacker>(CriUnpacker.IsGameFolder);
 }
Esempio n. 5
0
        private static void Detect(DetectOptions opt)
        {
            // Get unpacker
            var unpacker = UnpackerRegistry.Get(opt.Directory);

            if (unpacker is null)
            {
                Console.WriteLine("Couldn't find an unpacker for this game/engine.");
                return;
            }

            Console.WriteLine(unpacker.GetType().Name);
        }
Esempio n. 6
0
        private static void List(ListOptions opt)
        {
            // Get unpacker
            var unpacker = UnpackerRegistry.Get(opt.Directory);

            if (unpacker is null)
            {
                Console.WriteLine("Couldn't find an unpacker for this game/engine.");
                return;
            }

            foreach (IExtractableFile file in unpacker.LoadFiles(opt.Directory).OrderBy(x => x.Path))
            {
                Console.WriteLine(file.Path);
            }
        }