Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
ps1337 committed Jul 25, 2019
1 parent 73ee8fb commit 538512e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Pipfile**
build**
dist**
**.egg**
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# pwntools_r2_tmux
# pwntools-r2

Launch `radare2` from `pwntools` via `tmux`. This *might* also work with other setups without `tmux` but that's not supported currently.
Launch `radare2` from `pwntools`. This has been tested to work in combination with `tmux` - **other combinations may or may not work**. This *might* also work with other setups without `tmux` but that's not supported currently.

## Ok How To Use This?

- Create a new pipenv: `pipenv --python 2.7`
- Install this: `pipenv install pwntools-r2`
- Enter the virtual environment: `pipenv shell`
- Do stuff: `python2.7 ./exploit.py`


## Troubleshooting

- You can debug any errors with `context.log_level = 'DEBUG'` via your `pwntools` python script.
- If no terminal can be found, try setting `context.terminal` accordingly - e.g. to `urxvtc`

Debug any errors with `context.log_level = 'DEBUG'` via your `pwntools` python script.

# Credits

Expand Down
2 changes: 1 addition & 1 deletion pwntools-gdb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import shlex
import os

r2_python_template = """
#!/usr/bin/env python3
#!/usr/bin/env python2
import os, r2pipe
r2 = r2pipe.open()
Expand Down
15 changes: 15 additions & 0 deletions pwntools_r2/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from pwn import gdb


def r2dbg(args,
r2script=None,
exe=None,
ssh=None,
env=None,
sysroot=None,
**kwargs):
gdbscript = ""
if r2script:
gdbscript += '\n'.join(cmd for cmd in r2script.split('\n'))
# this calls pwntools-gdb internally
return gdb.debug(args, gdbscript, exe, ssh, env, sysroot, **kwargs)
6 changes: 0 additions & 6 deletions pwntools_r2_tmux/__init__.py

This file was deleted.

8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='pwntools-r2-tmux',
version='0.1.3.3.7',
name='pwntools-r2',
version='1.3.3.7',
scripts=['pwntools-gdb'] ,
author="ps1337 / @CaptnBanana",
author_email="ps1337@mailbox.org",
description="Debug exploits with Radare2 in pwntools and tmux",
description="Debug exploits like a boss with Radare2 in pwntools",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/ps1337/pwntools_r2_tmux",
url="https://github.com/ps1337/pwntools_r2",
install_requires=["r2pipe", "pwntools"],
packages=setuptools.find_packages(),
classifiers=[
Expand Down

0 comments on commit 538512e

Please sign in to comment.