Context is a global object used to store information about the target binary and the environment in which it's being run. Several attributes can be set.
context.archThis can be used to set the architecture of the target binary. It is useful for packing and unpacking data and for generation of shellcode.
context.arch = 'i386'
context.osWe can use this to set the operating system of the target binary. This is useful for shellcode generation.
context.os = 'linux'
context.endianWe can use this to set the endianness of the target binary. This is useful for packing and unpacking data.
context.endian = 'little'
context.word_sizeThis can be used to set the word size of the target binary. It is useful for shellcode generation (and packing data with flat).
context.word_size = 32
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 can be found here.
context.binary = ELF('./win32')
context.log_levelWe can set the verbosity of the output logger.
context.log_level = 'debug'
context.terminalFor those that use the tmux, we can use context.terminal to set how the window is split.
context.terminal = ['tmux', 'splitw', '-h']