Module hooks

Module hooks 

Source
Expand description

Bindings for the PANDA ‘hooks’ plugin, enabling the ability to add callbacks for when a certain instruction is hit.

Recommended usage is via either the #[panda::hook] macro or the hook module.

§Example

use panda::plugins::proc_start_linux::AuxvValues;
use panda::plugins::hooks::Hook;
use panda::prelude::*;

#[panda::hook]
fn entry_hook(_: &mut CPUState, _: &mut TranslationBlock, _: u8, hook: &mut Hook) {
    println!("\n\nHit entry hook!\n");

    // only run hook once
    hook.enabled = false;
}

#[panda::on_rec_auxv]
fn on_proc_start(_: &mut CPUState, _: &mut TranslationBlock, auxv: &AuxvValues) {
    // when a process starts, hook the entrypoint
    entry_hook::hook()
        .after_block_exec()
        .at_addr(auxv.entry)
}

Panda::new()
    .generic("x86_64")
    .replay("test")
    .run();

Modules§

hook
A set of functions for building hooks out of closures.

Structs§

HOOKS
Hook
A hook provided by the hooks plugin, describing the address, asid/process, symbol, etc to hook.
HookBuilder
A builder type for helping construct and install a Hook.
HookBuilderCallbackTypeNeeded
Hooks
HooksPandaCallback
Symbol
SymbolHook

Enums§

KernelMode

Traits§

IntoHookBuilder