Skip to content

Commit

Permalink
WIP: minor changes for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexodia committed Dec 24, 2024
1 parent 2e4dea3 commit 46c70cc
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ fn new_vm(jit: bool) -> PyResult<Icicle> {
)
}

fn new_trace_vm(jit: bool) -> PyResult<Icicle> {
Icicle::new(
"x86_64".to_string(),
jit,
true,
true,
false,
true,
false,
false,
true,
)
}

fn nx_start() -> PyResult<()> {
let mut vm = new_vm(false)?;
let page = 0x10000;
Expand Down Expand Up @@ -156,9 +170,9 @@ fn rewind() -> PyResult<()> {
}

fn execute_only() -> PyResult<()> {
let mut vm = new_vm(true)?;
let mut vm = new_trace_vm(false)?;

vm.mem_map(0x100, 0x20, MemoryProtection::ExecuteOnly)?;
vm.mem_map(0x100, 0x20, MemoryProtection::ExecuteRead)?;
vm.mem_write(0x100, b"\x90".to_vec())?; // nop
vm.reg_write("rip", 0x100)?;
let status = vm.step(1);
Expand Down

0 comments on commit 46c70cc

Please sign in to comment.