Skip to content

Commit 7636ad0

Browse files
committed
more structures for DT command, for study exceptions
1 parent 7c74842 commit 7636ad0

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

pics/exception.png

39.4 KB
Loading

src/emu32.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1561,6 +1561,10 @@ impl Emu32 {
15611561
let s = structures::ExceptionPointers::load(addr, &self.maps);
15621562
s.print();
15631563
}
1564+
"eh3_exception_registgration" => {
1565+
let s = structures::Eh3ExceptionRegistration::load(addr, &self.maps);
1566+
s.print();
1567+
}
15641568

15651569
_ => println!("unrecognized structure."),
15661570
}

src/emu32/structures.rs

+34-1
Original file line numberDiff line numberDiff line change
@@ -241,4 +241,37 @@ impl ExceptionPointers {
241241
pub fn print(&self) {
242242
println!("{:#x?}", self);
243243
}
244-
}
244+
}
245+
246+
/*
247+
ypedef struct _EH3_EXCEPTION_REGISTRATION {
248+
struct _EH3_EXCEPTION_REGISTRATION *Next;
249+
PVOID ExceptionHandler;
250+
PSCOPETABLE_ENTRY ScopeTable;
251+
DWORD TryLevel;
252+
} EH3_EXCEPTION_REGISTRATION,
253+
*/
254+
255+
#[derive(Debug)]
256+
pub struct Eh3ExceptionRegistration {
257+
next: u32,
258+
exception_handler: u32,
259+
scope_table: PScopeTableEntry,
260+
try_level: u32,
261+
}
262+
263+
impl Eh3ExceptionRegistration {
264+
pub fn load(addr:u32, maps:&Maps) -> Eh3ExceptionRegistration {
265+
Eh3ExceptionRegistration {
266+
next: maps.read_dword(addr).unwrap(),
267+
exception_handler: maps.read_dword(addr + 4).unwrap(),
268+
scope_table: PScopeTableEntry::load(addr + 8, &maps),
269+
try_level: maps.read_dword(addr + 8 + PScopeTableEntry::size()).unwrap(),
270+
}
271+
}
272+
273+
pub fn print(&self) {
274+
println!("{:#x?}", self);
275+
}
276+
}
277+

0 commit comments

Comments
 (0)