This repository was archived by the owner on Dec 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlib.rs
67 lines (55 loc) · 1.38 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
pub mod config;
pub mod emu;
use config::Config;
use emu::Emu;
pub fn emu64() -> Emu {
let mut emu = Emu::new();
let mut cfg = Config::new();
cfg.is_64bits = true;
emu.set_config(cfg);
emu.disable_ctrlc();
emu
}
pub fn emu32() -> Emu {
let mut emu = Emu::new();
let mut cfg = Config::new();
cfg.is_64bits = false;
emu.set_config(cfg);
emu.disable_ctrlc();
emu
}
#[cfg(test)]
mod tests {
//use super::*;
#[test]
fn test() {
/*
let mut emu = emu64();
emu.set_maps_folder("../scemu/maps64/");
emu.cfg.test_mode = false;
emu.init();
emu.load_code("../scemu/shellcodes64/");
emu.cfg.nocolors = true;
emu.set_verbose(0);
emu.cfg.trace_regs = false;
emu.spawn_console_at(2586);
emu.run(0);*/
assert!(1 == 1);
// cannot do tests, maps folder cannot be predicted on test time.
/*
use crate::emu32;
let mut emu = emu32();
emu.set_maps_folder("/tmp/maps32/");
emu.init();
emu.load_code("/tmp/maps32/test");
emu.run(0x3c00a4);
assert!(emu.regs.get_eax() == 0x75e9395c);
emu = emu64();
emu.set_maps_folder("/tmp/maps64/");
emu.init();
emu.load_code("/tmp/maps64/test");
emu.run(0x3c002b);
assert!(emu.regs.rax == 0x29);
*/
}
}