diff --git a/Cargo.lock b/Cargo.lock index 32406e5..95ecb1b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -742,7 +742,7 @@ dependencies = [ "more-asserts", "nt_hive2", "num", - "num-derive 0.3.3", + "num-derive 0.4.0", "num-traits", "ouroboros", "phf", @@ -1641,8 +1641,6 @@ dependencies = [ [[package]] name = "nt_hive2" version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a05582cdbafd1b4599d5aa871608e80f663fe8bf05e753dd8588322d0fbadc07" dependencies = [ "anyhow", "binread", @@ -1652,6 +1650,7 @@ dependencies = [ "chrono", "derive-getters", "encoding_rs", + "getset", "log", "marvin32", "memoverlay", diff --git a/Cargo.toml b/Cargo.toml index 53af679..2af0aa3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -168,7 +168,8 @@ strum = { version = "0", features = ["derive"], optional=true } strum_macros = {version="0", optional=true} # nt-hive2 -nt_hive2 = {version="4.1.0", optional=true} +#nt_hive2 = {version="4.1.0", optional=true} +nt_hive2 = {path="../nt-hive2", optional=true} # lnk2bodyfile lnk = {version="0.5.1", optional=true} diff --git a/src/bin/hivescan/regtreebuilder.rs b/src/bin/hivescan/regtreebuilder.rs index 70bfb4d..4df1bec 100644 --- a/src/bin/hivescan/regtreebuilder.rs +++ b/src/bin/hivescan/regtreebuilder.rs @@ -48,7 +48,6 @@ impl RegTreeBuilder { B: BinReaderExt, C: Fn(u64), { - let iterator = hive.into_cell_iterator(progress_callback); let mut me = Self { subtrees: HashMap::new(), entries: HashMap::new(), @@ -56,17 +55,17 @@ impl RegTreeBuilder { }; let mut last_offset = Offset(0); - for cell in iterator { + for cell in hive.hivebins().flat_map(|hivebin| hivebin.cells()) { let my_offset = *cell.offset(); let is_deleted = cell.header().is_deleted(); assert_ne!(last_offset, my_offset); log::trace!("found new cell at offset 0x{:x}", my_offset.0); if let Ok(nk) = TryInto::::try_into(cell) { - me.insert_nk(my_offset, nk, is_deleted) - }; - + me.insert_nk(my_offset, nk, is_deleted); + } last_offset = my_offset; + progress_callback(last_offset.0.into()); } me }