Module context

Source
Expand description

The global (to a given thread) context. Used to set global settings which are used internally by several functions.

§Examples

use pwn::{context, I386};
use pwn::Bits::ThirtyTwo;
context::set_arch(I386);
assert_eq!(context::get_arch(), I386);
assert_eq!(context::get_bits(), ThirtyTwo)

§Warning

context is local to each thread. Context values may need to be re-set when using multi-threaded code.

Structs§

Arch
An architecture, identified by its endianness and word size
Context
The current context, used by most functions for runtime behaviour modification

Enums§

Bits
The word size of a given Arch
Endianness
The word endianness of a given Arch

Constants§

AMD64
The 64-bit version of x86
I386
The 32-bit version of x86

Functions§

get_arch
Get the context’s architecture
get_bits
Get the context’s word size
get_endianess
Get the context’s endianess
set_arch
Set the context’s architecture
set_bits
Set the context’s word size
set_endianess
Set the context’s endianess