using System; using System.IO; using System.Collections.Generic; using System.Linq;…
- User
using System; using System.IO; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; // nj josh man's assetbundle namespaces using NJJM.AssetProcessor; using NJJM.Starlite; using NJJM.Internal;
// main program code namespace StarliteExtractor { class Program { static void Main(string[] args) { if (args[0] == null) { Console.WriteLine("usage: moonlite.exe [input path (the folder should have .assets file(s))] [output path (WARNING: everything in this path will be PERMENANTLY removed!!!)]"); }
codeif (File.Exists(args[0])) { if (File.Exists(args[1])) { string iPath = args[0]; string oPath = args[1]; Extract(iPath, oPath); } else { Console.WriteLine("error: output path is incorrect or is not a path"); } } else { Console.WriteLine("error: input path is incorrect or is not a path"); } } // arg1 in arg2 out private static void Extract(string arg1, string arg2) { BinaryReader reader = new BinaryReader(new FileStream(arg1, FileMode.Open)); List<ZstdChunkFrame> frames = new List<ZstdChunkFrame>(); List<DataBlock> output = new List<DataBlock>(); // collect all of the zstd frames ulong idx = 0; while (reader.BaseStream.Position < reader.BaseStream.Length) { frames.Add(new ZstdChunkFrame(reader)); Console.WriteLine("read zstd frame: " + idx + ", " + reader.BaseStream.Position.ToString("x16")); idx++; } BinParse parse = new BinParse(); parse.ParseMain(frames, output); Console.WriteLine("asset count: " + output.Count); ConfigCreator configM = new ConfigCreator(); FileStream file = new FileStream(arg2 + "\\config.njcf", FileMode.Create); configM.CreateConfig(file, arg2); Console.WriteLine("created config file 'config.njcf'"); } } - Assistant