Skip to content

Commit

Permalink
docs updates + modules docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bannsec committed Aug 25, 2019
1 parent 4e2e81f commit 7dc37d1
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ python:
install:
- method: pip
path: .
extra_requirements:
- dev
1 change: 1 addition & 0 deletions docs/api/native/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Native
exceptions
process
memory
modules
threads
tracing
types
19 changes: 19 additions & 0 deletions docs/api/native/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
=======
Modules
=======

Modules
=======

.. autoclass:: revenge.modules.Modules
:members:
:undoc-members:
:show-inheritance:

Module
======

.. autoclass:: revenge.modules.Module
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions docs/overview/native/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ threading, and any other things that are going to be common among any platform.
exceptions
functions
memory
modules
threads
tracing
49 changes: 49 additions & 0 deletions docs/overview/native/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
=======
Modules
=======

For ``revenge``, a module is any loaded library or shared library.

Listing Modules
===============

.. code-block:: python3
# List current modules
print(process.modules)
"""
+--------------------+----------------+-----------+---------------------------------------------------------------+
| name | base | size | path |
+--------------------+----------------+-----------+---------------------------------------------------------------+
| test2 | 0x557781b84000 | 0x202000 | /home/user/tmp/test2 |
| linux-vdso.so.1 | 0x7ffd3b5ee000 | 0x2000 | linux-vdso.so.1 |
| libc-2.27.so | 0x7fc6a8499000 | 0x3ed000 | /lib/x86_64-linux-gnu/libc-2.27.so |
| ld-2.27.so | 0x7fc6a888a000 | 0x229000 | /lib/x86_64-linux-gnu/ld-2.27.so |
| libpthread-2.27.so | 0x7fc6a827a000 | 0x21b000 | /lib/x86_64-linux-gnu/libpthread-2.27.so |
| frida-agent-64.so | 0x7fc6a6294000 | 0x17ba000 | /tmp/frida-7846ef0864a82f3695599c271bf7b0f1/frida-agent-64.so |
| libresolv-2.27.so | 0x7fc6a6079000 | 0x219000 | /lib/x86_64-linux-gnu/libresolv-2.27.so |
| libdl-2.27.so | 0x7fc6a5e75000 | 0x204000 | /lib/x86_64-linux-gnu/libdl-2.27.so |
| librt-2.27.so | 0x7fc6a5c6d000 | 0x208000 | /lib/x86_64-linux-gnu/librt-2.27.so |
| libm-2.27.so | 0x7fc6a58cf000 | 0x39e000 | /lib/x86_64-linux-gnu/libm-2.27.so |
+--------------------+----------------+-----------+---------------------------------------------------------------+
"""
Module Lookup
=============

Instead of enumerating modules, you can look up a module by it's full name, a
glob name, or by giving an address.

.. code-block:: python3
# Get the base address for specific module
hex(process.modules['test2'].base)
0x557781b84000
# Or by glob
process.modules['libc*']
"""<Module libc-2.27.so @ 0x7f282f7aa000>"""
# Or resolve address into corresponding module
process.modules[0x7f282f7ab123]
"""<Module libc-2.27.so @ 0x7f282f7aa000>"""
3 changes: 3 additions & 0 deletions docs/overview/native/threads.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Examples
for thread in threads:
print(thread)
# If you know the thread id, you can index to it
thread = process.threads[81921]
Tracing
=======

Expand Down

0 comments on commit 7dc37d1

Please sign in to comment.