Skip to content

Commit

Permalink
Merge branch 'beta' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
zachriggle committed Feb 20, 2018
2 parents 758a954 + 31f7c61 commit b507bd7
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 7 deletions.
21 changes: 21 additions & 0 deletions docs/source/conf.py
Expand Up @@ -24,6 +24,27 @@

import pwnlib

# -- WORK-AROUNDS FOR DEPRECATION ----------------------------------------------
# Deprecated
# 1.6b1
# sphinx.util.compat.Directive class is now deprecated.
# Please use instead docutils.parsers.rst.Directive
#
# Pwntools Note:
# Can't just "do the right thing" since we have dependencies that
# are also affected by this, specifically sphinxcontrib.autoprogram
try:
import sphinx.util.compat
except ImportError:
import sys
import types
import sphinx.util
import docutils.parsers.rst
class compat(types.ModuleType):
Directive = docutils.parsers.rst.Directive
sphinx.util.compat = compat('sphinx.util.compat')
sys.modules['sphinx.util.compat'] = sphinx.util.compat

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down
1 change: 1 addition & 0 deletions docs/source/elf/corefile.rst
@@ -1,5 +1,6 @@
.. testsetup:: *

from glob import glob
from pwn import *

:mod:`pwnlib.elf.corefile` --- Core Files
Expand Down
4 changes: 2 additions & 2 deletions pwnlib/shellcraft/templates/aarch64/linux/open.asm
@@ -1,12 +1,12 @@
<%
from pwnlib import shellcraft
%>
<%page args="filename, mode='O_RDONLY'"/>
<%page args="filename, flags='O_RDONLY', mode=0"/>
<%docstring>
Opens a file
</%docstring>
<%
AT_FDCWD=-100
%>
${shellcraft.pushstr(filename)}
${shellcraft.syscall('SYS_openat', AT_FDCWD, 'sp', mode, 0)}
${shellcraft.syscall('SYS_openat', AT_FDCWD, 'sp', flags, mode)}
2 changes: 1 addition & 1 deletion pwnlib/shellcraft/templates/amd64/linux/cat.asm
Expand Up @@ -8,5 +8,5 @@ Opens a file and writes its contents to the specified file descriptor.
</%docstring>

${pushstr(filename)}
${syscall('SYS_open', 'rsp', 0, 'O_RDONLY')}
${syscall('SYS_open', 'rsp', 'O_RDONLY', 0)}
${syscall('SYS_sendfile', fd, 'rax', 0, 0x7fffffff)}
2 changes: 1 addition & 1 deletion pwnlib/shellcraft/templates/arm/linux/cat.asm
Expand Up @@ -15,5 +15,5 @@ Example:

</%docstring>
${arm.pushstr(filename)}
${arm.linux.open('sp', 0, int(constants.O_RDONLY))}
${arm.linux.open('sp', int(constants.O_RDONLY), 0)}
${arm.linux.sendfile(fd, 'r0', 0, 0x7fffffff)}
2 changes: 1 addition & 1 deletion pwnlib/shellcraft/templates/i386/linux/cat.asm
Expand Up @@ -19,5 +19,5 @@ label = common.label("sendfile_loop")
%>

${sc.pushstr(filename)}
${sc.open('esp', 0, 'O_RDONLY')}
${sc.open('esp', 'O_RDONLY', 0)}
${sc.sendfile(fd, 'eax', 0, 0x7fffffff)}
2 changes: 1 addition & 1 deletion pwnlib/shellcraft/templates/mips/linux/cat.asm
Expand Up @@ -22,5 +22,5 @@ label = common.label("sendfile_loop")
%>

${mips.pushstr(filename)}
${mips.open('$sp', 0, int(constants.O_RDONLY))}
${mips.open('$sp', int(constants.O_RDONLY), 0)}
${mips.sendfile(fd, '$v0', 0, 0x7fffffff)}
2 changes: 1 addition & 1 deletion pwnlib/shellcraft/templates/thumb/linux/cat.asm
Expand Up @@ -20,6 +20,6 @@ label = common.label("sendfile_loop")
%>

${thumb.pushstr(filename)}
${thumb.linux.open('sp', 0, constants.O_RDONLY)}
${thumb.linux.open('sp', constants.O_RDONLY, 0)}
${thumb.mov('r5', 'r0')}
${thumb.linux.sendfile(fd, 'r5', 0, 0x7fffffff)}

0 comments on commit b507bd7

Please sign in to comment.