mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-12-08 06:09:46 +00:00
aparently free/malloc are legal idk, fix a mem reader crash
This commit is contained in:
parent
aae64b63fc
commit
11e0f4c26e
3 changed files with 63 additions and 55 deletions
|
|
@ -38,19 +38,19 @@ fn write(addr: *mut *const usize, new: *const usize) {
|
||||||
|
|
||||||
#[unsafe(no_mangle)]
|
#[unsafe(no_mangle)]
|
||||||
pub extern "stdcall" fn DllMain(_: *const u8, _: u32, _: *const u8) -> u32 {
|
pub extern "stdcall" fn DllMain(_: *const u8, _: u32, _: *const u8) -> u32 {
|
||||||
/*write(
|
write(
|
||||||
0x00f074f0 as *mut *const usize, //malloc
|
0x00f074f0 as *mut *const usize, //malloc
|
||||||
operator_new as *const usize,
|
operator_new as *const usize,
|
||||||
);*/
|
);
|
||||||
write(
|
write(
|
||||||
0x00f07500 as *mut *const usize, //operator_new
|
0x00f07500 as *mut *const usize, //operator_new
|
||||||
operator_new as *const usize,
|
operator_new as *const usize,
|
||||||
);
|
);
|
||||||
|
|
||||||
/*write(
|
write(
|
||||||
0x00f074f4 as *mut *const usize, //free
|
0x00f074f4 as *mut *const usize, //free
|
||||||
operator_delete as *const usize,
|
operator_delete as *const usize,
|
||||||
);*/
|
);
|
||||||
write(
|
write(
|
||||||
0x00f07504 as *mut *const usize, //operator_delete
|
0x00f07504 as *mut *const usize, //operator_delete
|
||||||
operator_delete as *const usize,
|
operator_delete as *const usize,
|
||||||
|
|
|
||||||
|
|
@ -106,20 +106,23 @@ impl eframe::App for App {
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
|ui| {
|
|ui| {
|
||||||
egui::ScrollArea::vertical().id_salt("1").show(ui, |ui| {
|
egui::ScrollArea::vertical()
|
||||||
if let Some(d) = self.elem.show(
|
.id_salt("1")
|
||||||
ui,
|
.auto_shrink([false; 2])
|
||||||
&self.reader,
|
.show(ui, |ui| {
|
||||||
&self.map,
|
if let Some(d) = self.elem.show(
|
||||||
&mut self.elem.reference().map(|a| vec![a]).unwrap_or_default(),
|
ui,
|
||||||
0,
|
&self.reader,
|
||||||
"f0",
|
&self.map,
|
||||||
Vec::new(),
|
&mut self.elem.reference().map(|a| vec![a]).unwrap_or_default(),
|
||||||
self.display_type,
|
0,
|
||||||
) {
|
"f0",
|
||||||
self.data = Some(d);
|
Vec::new(),
|
||||||
}
|
self.display_type,
|
||||||
});
|
) {
|
||||||
|
self.data = Some(d);
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
ui.scope_builder(
|
ui.scope_builder(
|
||||||
|
|
@ -128,44 +131,47 @@ impl eframe::App for App {
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
|ui| {
|
|ui| {
|
||||||
egui::ScrollArea::vertical().id_salt("2").show(ui, |ui| {
|
egui::ScrollArea::vertical()
|
||||||
if let Some(data) = &self.data {
|
.id_salt("2")
|
||||||
match data {
|
.auto_shrink([false; 2])
|
||||||
Data::Values(refs, n) => {
|
.show(ui, |ui| {
|
||||||
if !refs.is_empty() {
|
if let Some(data) = &self.data {
|
||||||
ui.label(
|
match data {
|
||||||
refs.iter()
|
Data::Values(refs, n) => {
|
||||||
.map(|(a, b)| format!("0x{a:08x}->0x{b:08x}"))
|
if !refs.is_empty() {
|
||||||
.collect::<Vec<String>>()
|
ui.label(
|
||||||
.join(","),
|
refs.iter()
|
||||||
);
|
.map(|(a, b)| format!("0x{a:08x}->0x{b:08x}"))
|
||||||
ui.separator();
|
.collect::<Vec<String>>()
|
||||||
|
.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}"));
|
Data::Struct(refs) => {
|
||||||
ui.label(format!("{n:032b}"));
|
if !refs.is_empty() {
|
||||||
ui.label(format!("{n:010}"));
|
ui.label(
|
||||||
if n.cast_signed() < 0 {
|
refs.iter()
|
||||||
ui.label(format!("{:010}", n.cast_signed()));
|
.map(|(a, b)| format!("0x{a:08x}->0x{b:08x}"))
|
||||||
}
|
.collect::<Vec<String>>()
|
||||||
ui.label(f32::from_bits(*n).to_string());
|
.join(","),
|
||||||
if let Ok(v) = String::from_utf8(n.to_le_bytes().to_vec()) {
|
);
|
||||||
ui.label(v);
|
ui.separator();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Data::Struct(refs) => {
|
|
||||||
if !refs.is_empty() {
|
|
||||||
ui.label(
|
|
||||||
refs.iter()
|
|
||||||
.map(|(a, b)| format!("0x{a:08x}->0x{b:08x}"))
|
|
||||||
.collect::<Vec<String>>()
|
|
||||||
.join(","),
|
|
||||||
);
|
|
||||||
ui.separator();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
@ -582,11 +588,13 @@ impl Struct {
|
||||||
s = i;
|
s = i;
|
||||||
not_null = false;
|
not_null = false;
|
||||||
v = None;
|
v = None;
|
||||||
|
null = None
|
||||||
} else {
|
} 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, _): &(String, _) = &fields[i];
|
||||||
let f = f.clone();
|
let f = f.clone();
|
||||||
let arr = fields.drain(i..k).map(|(_, b)| b).collect();
|
let arr: Vec<Elem> = fields.drain(i..v).map(|(_, b)| b).collect();
|
||||||
|
s -= arr.len();
|
||||||
fields.insert(i, (f, Elem::Array(arr)));
|
fields.insert(i, (f, Elem::Array(arr)));
|
||||||
}
|
}
|
||||||
if s - k > 2 {
|
if s - k > 2 {
|
||||||
|
|
@ -602,6 +610,7 @@ impl Struct {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
v = Some(i);
|
v = Some(i);
|
||||||
|
null = None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if not_null {
|
if not_null {
|
||||||
|
|
|
||||||
|
|
@ -332,7 +332,6 @@ pub struct LiquidCellVTable {
|
||||||
#[derive(Clone, Debug, Copy)]
|
#[derive(Clone, Debug, Copy)]
|
||||||
pub struct Cell {
|
pub struct Cell {
|
||||||
pub vtable: CellVTable,
|
pub vtable: CellVTable,
|
||||||
|
|
||||||
pub hp: isize,
|
pub hp: isize,
|
||||||
unknown1: [isize; 2],
|
unknown1: [isize; 2],
|
||||||
pub is_burning: bool,
|
pub is_burning: bool,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue