Skip to content

Commit

Permalink
Add a bit more documentation to context.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
zachriggle committed Jan 23, 2017
1 parent 5106c4e commit 06db497
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/source/context.rst
Expand Up @@ -8,6 +8,27 @@
:mod:`pwnlib.context` --- Setting runtime variables
=====================================================

Many settings in ``pwntools`` are controlled via the global variable :data:`.context, such as the selected target operating system, architecture, and bit-width.
In general, exploits will start with something like:
.. code-block:: python
from pwn import *
context.arch = 'amd64'
Which sets up everything in the exploit for exploiting a 64-bit Intel binary.
The recommended method is to use ``context.binary`` to automagically set all of the appropriate values.

.. code-block:: python
from pwn import *
context.binary = './challenge-binary'
Module Members
=====================================================

.. autodata:: pwnlib.context.context

.. autoclass:: pwnlib.context.ContextType
Expand Down

0 comments on commit 06db497

Please sign in to comment.