#![feature(array_chunks)] use anyhow::anyhow; use std::{env::args, fs::File, io::BufReader}; use unity_tools::{serialized_file::SerializedFile, unityfs::UnityFS}; fn main() -> anyhow::Result<()> { env_logger::init_from_env("LOG"); let file = || BufReader::new(File::open(args().nth(1).unwrap()).unwrap()); let mut fs = UnityFS::open(file())?; // let mut fs2 = UnityFS::open(file())?; let cabfile = fs .find_main_file() .ok_or(anyhow!("no CAB file found"))? .to_owned(); let mut cab = fs.read(&cabfile)?; let file = SerializedFile::read(&mut cab)?; for _ob in file.objects {} Ok(()) }