Context
Context is a global object used to store information about the target binary and the environment it's being run. There are a number of attributes that can be set.
Primary Attributes
context.arch
context.arch
We can use this to set the architecture of the target binary. This is useful for packing and unpacking data, as well as for shellcode generation.
context.os
context.os
We can use this to set the operating system of the target binary. This is useful for shellcode generation.
context.endian
context.endian
We can use this to set the endianness of the target binary. This is useful for packing and unpacking data.
context.word_size
context.word_size
We can use this to set the word size of the target binary. This is useful for shellcode generation (and packing data with flat
).
Grouping this together
We can simply set context.binary
to the binary we're using, and pwntools will automatically set the architecture, operating system, endianness, and word size.
This takes an ELF
object. More information on the ELF
class here.
Other Attributes
context.log_level
context.log_level
We can set the verbosity of the output logger.
context.terminal
context.terminal
For those that use the tmux
, we can use context.terminal
to set how the window is split.
Last updated