Example #1
0
        public List <string> GetFilePaths(BundleFile bundle)
        {
            MemoryReader reader = new(bundle.GetContent(Offset, Size).Span);

            var templates = BuildPathTemplates(ref reader);

            return(BuildFilePaths(ref reader, templates));
        }
Example #2
0
            private static void ExecuteCommand(FileInfo bundleFile, FileInfo outputFile, bool all, int block, string slice)
            {
                var bundle = new BundleFile(bundleFile.FullName);
                ReadOnlyMemory <byte> data;

                if (all)
                {
                    data = bundle.GetContent();
                }
                else if (block > 0)
                {
                    data = bundle.GetContent(block - 1);
                }
                else
                {
                    var parsedSlice = ParseSlice(slice);
                    data = bundle.GetContent(parsedSlice.Item1, parsedSlice.Item2 - parsedSlice.Item1 + 1);
                }

                File.WriteAllBytes(outputFile.FullName, data.ToArray());

                Console.Write($"Wrote {data.Length} bytes to {outputFile.FullName}");
            }