Skip to main content

libmwemu/
lib.rs

1#![allow(non_snake_case)]
2#![allow(dead_code)]
3#![allow(unused_variables)]
4#![allow(unused_must_use)]
5#![allow(clippy::assertions_on_constants)]
6
7pub mod banzai;
8pub mod breakpoint;
9pub mod colors;
10pub mod config;
11pub mod console;
12pub mod constants;
13pub mod context;
14pub mod definitions;
15pub mod eflags;
16pub mod elf;
17pub mod emu;
18pub mod emu_context;
19pub mod engine;
20pub mod gdb;
21pub mod err;
22pub mod exception;
23pub mod flags;
24pub mod fpu;
25pub mod hooks;
26#[macro_use]
27pub mod macros;
28pub mod crit_state;
29pub mod exception_type;
30pub mod global_locks;
31pub mod kuser_shared;
32pub mod maps;
33pub mod ntapi;
34pub mod pe;
35pub mod peb;
36pub mod regs64;
37pub mod script;
38pub mod serialization;
39pub mod structures;
40pub mod syscall;
41pub mod thread_context;
42pub mod threading;
43pub mod tracing;
44pub mod winapi;
45
46// re-export the helper so the macro can reach it
47pub use utils::color_enabled;
48
49#[cfg(test)]
50mod tests;
51mod utils;
52use config::Config;
53use emu::Emu;
54
55pub fn emu64() -> Emu {
56    let mut emu = Emu::new();
57    let mut cfg = Config::new();
58    cfg.is_64bits = true;
59    emu.set_config(cfg);
60    emu.disable_ctrlc();
61    //tracing::init_tracing("/tmp/mwemu-tracing.bin");
62    emu
63}
64
65pub fn emu32() -> Emu {
66    let mut emu = Emu::new();
67    let mut cfg = Config::new();
68    cfg.is_64bits = false;
69    emu.set_config(cfg);
70    emu.disable_ctrlc();
71    //tracing::init_tracing("/tmp/mwemu-tracing.bin");
72    emu
73}