diff --git a/extra/malloc_probe/src/lib.rs b/extra/malloc_probe/src/lib.rs index 37c2cd82..b8a0f67c 100644 --- a/extra/malloc_probe/src/lib.rs +++ b/extra/malloc_probe/src/lib.rs @@ -38,19 +38,19 @@ fn write(addr: *mut *const usize, new: *const usize) { #[unsafe(no_mangle)] pub extern "stdcall" fn DllMain(_: *const u8, _: u32, _: *const u8) -> u32 { - /*write( + write( 0x00f074f0 as *mut *const usize, //malloc operator_new as *const usize, - );*/ + ); write( 0x00f07500 as *mut *const usize, //operator_new operator_new as *const usize, ); - /*write( + write( 0x00f074f4 as *mut *const usize, //free operator_delete as *const usize, - );*/ + ); write( 0x00f07504 as *mut *const usize, //operator_delete operator_delete as *const usize, diff --git a/extra/mem_reader/src/main.rs b/extra/mem_reader/src/main.rs index 0686344c..62849bde 100644 --- a/extra/mem_reader/src/main.rs +++ b/extra/mem_reader/src/main.rs @@ -106,20 +106,23 @@ impl eframe::App for App { ..Default::default() }, |ui| { - egui::ScrollArea::vertical().id_salt("1").show(ui, |ui| { - if let Some(d) = self.elem.show( - ui, - &self.reader, - &self.map, - &mut self.elem.reference().map(|a| vec![a]).unwrap_or_default(), - 0, - "f0", - Vec::new(), - self.display_type, - ) { - self.data = Some(d); - } - }); + egui::ScrollArea::vertical() + .id_salt("1") + .auto_shrink([false; 2]) + .show(ui, |ui| { + if let Some(d) = self.elem.show( + ui, + &self.reader, + &self.map, + &mut self.elem.reference().map(|a| vec![a]).unwrap_or_default(), + 0, + "f0", + Vec::new(), + self.display_type, + ) { + self.data = Some(d); + } + }); }, ); ui.scope_builder( @@ -128,44 +131,47 @@ impl eframe::App for App { ..Default::default() }, |ui| { - egui::ScrollArea::vertical().id_salt("2").show(ui, |ui| { - if let Some(data) = &self.data { - match data { - Data::Values(refs, n) => { - if !refs.is_empty() { - ui.label( - refs.iter() - .map(|(a, b)| format!("0x{a:08x}->0x{b:08x}")) - .collect::>() - .join(","), - ); - ui.separator(); + egui::ScrollArea::vertical() + .id_salt("2") + .auto_shrink([false; 2]) + .show(ui, |ui| { + if let Some(data) = &self.data { + match data { + Data::Values(refs, n) => { + if !refs.is_empty() { + ui.label( + refs.iter() + .map(|(a, b)| format!("0x{a:08x}->0x{b:08x}")) + .collect::>() + .join(","), + ); + ui.separator(); + } + ui.label(format!("0x{n:08x}")); + ui.label(format!("{n:032b}")); + ui.label(format!("{n:010}")); + if n.cast_signed() < 0 { + ui.label(format!("{:010}", n.cast_signed())); + } + ui.label(f32::from_bits(*n).to_string()); + if let Ok(v) = String::from_utf8(n.to_le_bytes().to_vec()) { + ui.label(v); + } } - ui.label(format!("0x{n:08x}")); - ui.label(format!("{n:032b}")); - ui.label(format!("{n:010}")); - if n.cast_signed() < 0 { - ui.label(format!("{:010}", n.cast_signed())); - } - ui.label(f32::from_bits(*n).to_string()); - if let Ok(v) = String::from_utf8(n.to_le_bytes().to_vec()) { - ui.label(v); - } - } - Data::Struct(refs) => { - if !refs.is_empty() { - ui.label( - refs.iter() - .map(|(a, b)| format!("0x{a:08x}->0x{b:08x}")) - .collect::>() - .join(","), - ); - ui.separator(); + Data::Struct(refs) => { + if !refs.is_empty() { + ui.label( + refs.iter() + .map(|(a, b)| format!("0x{a:08x}->0x{b:08x}")) + .collect::>() + .join(","), + ); + ui.separator(); + } } } } - } - }); + }); }, ); }); @@ -582,11 +588,13 @@ impl Struct { s = i; not_null = false; v = None; + null = None } else { - if let Some((i, k)) = mem::take(&mut null) { + if let Some((i, v)) = mem::take(&mut null) { let (f, _): &(String, _) = &fields[i]; let f = f.clone(); - let arr = fields.drain(i..k).map(|(_, b)| b).collect(); + let arr: Vec = fields.drain(i..v).map(|(_, b)| b).collect(); + s -= arr.len(); fields.insert(i, (f, Elem::Array(arr))); } if s - k > 2 { @@ -602,6 +610,7 @@ impl Struct { } } else { v = Some(i); + null = None } } if not_null { diff --git a/noita_api/src/noita/types/world.rs b/noita_api/src/noita/types/world.rs index efbce974..d418db49 100644 --- a/noita_api/src/noita/types/world.rs +++ b/noita_api/src/noita/types/world.rs @@ -332,7 +332,6 @@ pub struct LiquidCellVTable { #[derive(Clone, Debug, Copy)] pub struct Cell { pub vtable: CellVTable, - pub hp: isize, unknown1: [isize; 2], pub is_burning: bool,