Skip to content

Commit

Permalink
i have no clue what comctl64 is
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonros committed Dec 30, 2024
1 parent 7faa273 commit 84b95b3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 24 deletions.
9 changes: 1 addition & 8 deletions libmwemu/src/winapi32/kernel32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,14 +463,7 @@ fn LoadLibraryA(emu: &mut emu::Emu) {

emu.regs.rax = load_library(emu, &dll);

log::info!(
"{}** {} kernel32!LoadLibraryA '{}' =0x{:x} {}",
emu.colors.light_red,
emu.pos,
&dll,
emu.regs.get_eax() as u32,
emu.colors.nc
);
log_red!(emu, "** {} kernel32!LoadLibraryA '{}' =0x{:x} rip: 0x{:x}", emu.pos, &dll, emu.regs.get_eax() as u32, emu.regs.rip);

emu.stack_pop32(false);

Expand Down
23 changes: 23 additions & 0 deletions libmwemu/src/winapi64/comctl64.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use crate::emu;
use crate::serialization;
use crate::winapi64::kernel32;
//use crate::winapi32::helper;

pub fn gateway(addr: u64, emu: &mut emu::Emu) -> String {
let api = kernel32::guess_api_name(emu, addr);
match api.as_str() {
_ => {
if emu.cfg.skip_unimplemented == false {
if emu.cfg.dump_on_exit && emu.cfg.dump_filename.is_some() {
serialization::Serialization::dump_to_file(&emu, emu.cfg.dump_filename.as_ref().unwrap());
}

unimplemented!("atemmpt to call unimplemented API 0x{:x} {}", addr, api);
}
log::warn!("calling unimplemented API 0x{:x} {}", addr, api);
return api;
}
}

String::new()
}
18 changes: 2 additions & 16 deletions libmwemu/src/winapi64/kernel32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,14 +416,7 @@ fn LoadLibraryA(emu: &mut emu::Emu) {

emu.regs.rax = load_library(emu, &dll);

log::info!(
"{}** {} kernel32!LoadLibraryA '{}' =0x{:x} {}",
emu.colors.light_red,
emu.pos,
dll,
emu.regs.rax,
emu.colors.nc
);
log_red!(emu, "** {} kernel32!LoadLibraryA '{}' =0x{:x} rip: 0x{:x}", emu.pos, &dll, emu.regs.get_eax() as u32, emu.regs.rip);
}

fn LoadLibraryW(emu: &mut emu::Emu) {
Expand All @@ -432,14 +425,7 @@ fn LoadLibraryW(emu: &mut emu::Emu) {

emu.regs.rax = load_library(emu, &dll);

log::info!(
"{}** {} kernel32!LoadLibraryA '{}' =0x{:x} {}",
emu.colors.light_red,
emu.pos,
dll,
emu.regs.rax,
emu.colors.nc
);
log_red!(emu, "** {} kernel32!LoadLibraryW '{}' =0x{:x} rip: 0x{:x}", emu.pos, &dll, emu.regs.get_eax() as u32, emu.regs.rip);
}

fn LoadLibraryExA(emu: &mut emu::Emu) {
Expand Down
2 changes: 2 additions & 0 deletions libmwemu/src/winapi64/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod advapi32;
mod comctl32;
mod comctl64;
mod dnsapi;
pub mod kernel32;
mod kernelbase;
Expand Down Expand Up @@ -29,6 +30,7 @@ pub fn gateway(addr: u64, name: String, emu: &mut emu::Emu) {
"winhttp.text" => winhttp::gateway(addr, emu),
"dnsapi.text" => dnsapi::gateway(addr, emu),
"comctl32.text" => comctl32::gateway(addr, emu),
"comctl64.text" => comctl64::gateway(addr, emu),
"shell32.text" => shell32::gateway(addr, emu),
"shlwapi.text" => shlwapi::gateway(addr, emu),
"kernelbase.text" => kernelbase::gateway(addr, emu),
Expand Down

0 comments on commit 84b95b3

Please sign in to comment.