blob: 6f46c0a2dad6539ebe9566d63d37cd5bd739ba08 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
use anyhow::Result;
use std::{env::args, fs::File, io::BufReader};
use unity_tools::{serialized_file::read_serialized_file_header, unityfs::UnityFS};
fn main() -> Result<()> {
let file = BufReader::new(File::open(args().nth(1).unwrap())?);
let mut fs = UnityFS::open(file)?;
let node = fs.find_main_file().unwrap().to_owned();
let mut cab = fs.read(&node)?;
let ch = read_serialized_file_header(&mut cab)?;
if fs.unity_version.is_ascii() && ch.generator_version.is_ascii() && ch.format < 100 {
println!(
"{}\t{}\t{}\t{}",
fs.file_version, fs.unity_version, ch.format, ch.generator_version
);
}
Ok(())
}
|