Skip to content

Commit

Permalink
Merge branch 'main' of github.com:brandonros/mwemu
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonros committed Dec 28, 2024
2 parents e7043cc + cd3d035 commit 57e9bda
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 20 deletions.
12 changes: 12 additions & 0 deletions libmwemu/src/emu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3644,6 +3644,18 @@ impl Emu {
}
self.seh
}
0x8 => {
if self.cfg.verbose >= 1 {
log::info!("Reading SEH 0x{:x}", self.seh);
}
if self.cfg.is_64bits {
self.maps.get_mem("peb").get_base()
} else {
let teb = self.maps.get_mem("teb");
let teb_struct = structures::TEB::new(teb.get_base() as u32);
teb_struct.thread_id as u64
}
}
_ => {
log::info!("unimplemented gs:[{}]", mem_addr);
return None;
Expand Down
40 changes: 20 additions & 20 deletions libmwemu/src/emu/structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,26 +395,26 @@ impl NtTib32 {
#[derive(Debug)]
pub struct TEB {
pub nt_tib: NtTib32,
environment_pointer: u32,
process_id: u32,
thread_id: u32,
active_rpc_handle: u32,
thread_local_storage_pointer: u32,
process_environment_block: u32, // PEB 0x30
last_error_value: u32,
count_of_owned_critical_sections: u32,
csr_client_thread: u32,
win32_thread_info: u32,
user32_reserved: [u32; 26],
user_reserved: [u32; 6],
wow32_reserved: u32,
current_locale: u32,
fp_software_status_register: u32,
system_reserved1: [u64; 54],
exception_code: u32,
activation_context_stack_pointer: u32,
spare_bytes: [u8; 24],
tx_fs_context: u32,
pub environment_pointer: u32,
pub process_id: u32,
pub thread_id: u32,
pub active_rpc_handle: u32,
pub thread_local_storage_pointer: u32,
pub process_environment_block: u32, // PEB 0x30
pub last_error_value: u32,
pub count_of_owned_critical_sections: u32,
pub csr_client_thread: u32,
pub win32_thread_info: u32,
pub user32_reserved: [u32; 26],
pub user_reserved: [u32; 6],
pub wow32_reserved: u32,
pub current_locale: u32,
pub fp_software_status_register: u32,
pub system_reserved1: [u64; 54],
pub exception_code: u32,
pub activation_context_stack_pointer: u32,
pub spare_bytes: [u8; 24],
pub tx_fs_context: u32,
}

impl TEB {
Expand Down
Empty file added pymwemu/__init__.py
Empty file.

0 comments on commit 57e9bda

Please sign in to comment.