Hooks2Callbacks

Trait Hooks2Callbacks 

Source
pub trait Hooks2Callbacks {
    // Required methods
    fn on_process_start<CallbackFn>(self, callback: CallbackFn)
       where CallbackFn: FnMut(&mut CPUState, *const c_char, target_ulong, target_pid_t) + 'static;
    fn on_process_end<CallbackFn>(self, callback: CallbackFn)
       where CallbackFn: FnMut(&mut CPUState, *const c_char, target_ulong, target_pid_t) + 'static;
    fn on_thread_start<CallbackFn>(self, callback: CallbackFn)
       where CallbackFn: FnMut(&mut CPUState, *const c_char, target_ulong, target_pid_t, target_pid_t) + 'static;
    fn on_thread_end<CallbackFn>(self, callback: CallbackFn)
       where CallbackFn: FnMut(&mut CPUState, *const c_char, target_ulong, target_pid_t, target_pid_t) + 'static;
    fn on_mmap_updated<CallbackFn>(self, callback: CallbackFn)
       where CallbackFn: FnMut(&mut CPUState, *const c_char, target_ulong, target_ulong) + 'static;
}
Expand description

A trait for expressing the plugin-to-plugin callbacks provided by the given plugin. See panda::PppCallback for more information, as this is intended to be used as an extension trait for it.

Required Methods§

Source

fn on_process_start<CallbackFn>(self, callback: CallbackFn)
where CallbackFn: FnMut(&mut CPUState, *const c_char, target_ulong, target_pid_t) + 'static,

Installs the given closure over the callback slot provided by the panda::PppCallback this is called on, setting it to be run whenever the on_process_start callback is hit.

§Arguments
  • cpu - & mut CPUState

  • procname - `

  • const c_char `

  • asid - target_ulong

  • pid - target_pid_t

§Example
use panda::PppCallback;
use panda::prelude::*;
use /*...*/::Hooks2Callbacks;

PppCallbacks::new()
   .on_process_start(|cpu: & mut CPUState, procname: * const c_char, asid: target_ulong, pid: target_pid_t, |{
       // callback code
   });
Source

fn on_process_end<CallbackFn>(self, callback: CallbackFn)
where CallbackFn: FnMut(&mut CPUState, *const c_char, target_ulong, target_pid_t) + 'static,

Installs the given closure over the callback slot provided by the panda::PppCallback this is called on, setting it to be run whenever the on_process_end callback is hit.

§Arguments
  • cpu - & mut CPUState

  • procname - `

  • const c_char `

  • asid - target_ulong

  • pid - target_pid_t

§Example
use panda::PppCallback;
use panda::prelude::*;
use /*...*/::Hooks2Callbacks;

PppCallbacks::new()
   .on_process_end(|cpu: & mut CPUState, procname: * const c_char, asid: target_ulong, pid: target_pid_t, |{
       // callback code
   });
Source

fn on_thread_start<CallbackFn>(self, callback: CallbackFn)
where CallbackFn: FnMut(&mut CPUState, *const c_char, target_ulong, target_pid_t, target_pid_t) + 'static,

Installs the given closure over the callback slot provided by the panda::PppCallback this is called on, setting it to be run whenever the on_thread_start callback is hit.

§Arguments
  • cpu - & mut CPUState

  • procname - `

  • const c_char `

  • asid - target_ulong

  • pid - target_pid_t

  • tid - target_pid_t

§Example
use panda::PppCallback;
use panda::prelude::*;
use /*...*/::Hooks2Callbacks;

PppCallbacks::new()
   .on_thread_start(|cpu: & mut CPUState, procname: * const c_char, asid: target_ulong, pid: target_pid_t, tid: target_pid_t, |{
       // callback code
   });
Source

fn on_thread_end<CallbackFn>(self, callback: CallbackFn)
where CallbackFn: FnMut(&mut CPUState, *const c_char, target_ulong, target_pid_t, target_pid_t) + 'static,

Installs the given closure over the callback slot provided by the panda::PppCallback this is called on, setting it to be run whenever the on_thread_end callback is hit.

§Arguments
  • cpu - & mut CPUState

  • procname - `

  • const c_char `

  • asid - target_ulong

  • pid - target_pid_t

  • tid - target_pid_t

§Example
use panda::PppCallback;
use panda::prelude::*;
use /*...*/::Hooks2Callbacks;

PppCallbacks::new()
   .on_thread_end(|cpu: & mut CPUState, procname: * const c_char, asid: target_ulong, pid: target_pid_t, tid: target_pid_t, |{
       // callback code
   });
Source

fn on_mmap_updated<CallbackFn>(self, callback: CallbackFn)
where CallbackFn: FnMut(&mut CPUState, *const c_char, target_ulong, target_ulong) + 'static,

Installs the given closure over the callback slot provided by the panda::PppCallback this is called on, setting it to be run whenever the on_mmap_updated callback is hit.

§Arguments
  • cpu - & mut CPUState

  • libname - `

  • const c_char `

  • base - target_ulong

  • size - target_ulong

§Example
use panda::PppCallback;
use panda::prelude::*;
use /*...*/::Hooks2Callbacks;

PppCallbacks::new()
   .on_mmap_updated(|cpu: & mut CPUState, libname: * const c_char, base: target_ulong, size: target_ulong, |{
       // callback code
   });

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§