Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/unicorn/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ extern "C" {
timeout: u64,
count: libc::size_t,
) -> uc_error;
pub fn uc_emu_run(
engine: uc_handle,
until: u64,
timeout: u64,
count: libc::size_t,
) -> uc_error;
pub fn uc_emu_stop(engine: uc_handle) -> uc_error;
pub fn uc_hook_add(
engine: uc_handle,
Expand Down
16 changes: 16 additions & 0 deletions crates/unicorn/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,22 @@
unsafe { uc_emu_start(self.get_handle(), begin, until, timeout, count as _) }.into()
}

/// Emulate machine code starting from the current instruction pointer.
///
/// The emulation stops if `until` is hit. `timeout` specifies a duration in microseconds
/// after which the emulation is stopped (infinite execution if set to 0). `count` is the
/// maximum number of instructions to emulate (emulate all the available instructions if
/// set to 0).
pub fn emu_start(

Check failure on line 1245 in crates/unicorn/src/lib.rs

View workflow job for this annotation

GitHub Actions / Windows x86

duplicate definitions with name `emu_start`

Check failure on line 1245 in crates/unicorn/src/lib.rs

View workflow job for this annotation

GitHub Actions / Ubuntu x86_64

duplicate definitions with name `emu_start`

Check failure on line 1245 in crates/unicorn/src/lib.rs

View workflow job for this annotation

GitHub Actions / Windows x86_64

duplicate definitions with name `emu_start`

Check failure on line 1245 in crates/unicorn/src/lib.rs

View workflow job for this annotation

GitHub Actions / macOS x86_64

duplicate definitions with name `emu_start`
&mut self,
begin: u64,
until: u64,
timeout: u64,
count: usize,
) -> Result<(), uc_error> {
unsafe { uc_emu_run(self.get_handle(), until, timeout, count as _) }.into()

Check failure on line 1252 in crates/unicorn/src/lib.rs

View workflow job for this annotation

GitHub Actions / Windows x86

cannot find function `uc_emu_run` in this scope

Check failure on line 1252 in crates/unicorn/src/lib.rs

View workflow job for this annotation

GitHub Actions / Ubuntu x86_64

cannot find function `uc_emu_run` in this scope

Check failure on line 1252 in crates/unicorn/src/lib.rs

View workflow job for this annotation

GitHub Actions / Windows x86_64

cannot find function `uc_emu_run` in this scope

Check failure on line 1252 in crates/unicorn/src/lib.rs

View workflow job for this annotation

GitHub Actions / macOS x86_64

cannot find function `uc_emu_run` in this scope
}

/// Stop the emulation.
///
/// This is usually called from callback function in hooks.
Expand Down
Loading