diff --git a/pwnlib/__init__.py b/pwnlib/__init__.py index 3dae1f00f..306dc67f4 100644 --- a/pwnlib/__init__.py +++ b/pwnlib/__init__.py @@ -23,7 +23,6 @@ 'libcdb', 'log', 'memleak', - 'pep237', 'regsort', 'replacements', 'rop', diff --git a/pwnlib/adb/adb.py b/pwnlib/adb/adb.py index 45d27875c..e2d8ebce7 100644 --- a/pwnlib/adb/adb.py +++ b/pwnlib/adb/adb.py @@ -54,7 +54,6 @@ import os import re import shutil -import six import stat import tempfile import time @@ -85,7 +84,7 @@ def adb(argv, *a, **kw): >>> adb.adb(['shell', 'uname']) # it is better to use adb.process b'Linux\n' """ - if isinstance(argv, (bytes, six.text_type)): + if isinstance(argv, (bytes, str)): argv = [argv] log.debug("$ " + ' '.join(context.adb + argv)) @@ -838,7 +837,7 @@ def process(argv, *a, **kw): >>> print(adb.process(['cat','/proc/version']).recvall().decode('utf-8')) # doctest: +ELLIPSIS Linux version ... """ - if isinstance(argv, (bytes, six.text_type)): + if isinstance(argv, (bytes, str)): argv = [argv] message = "Starting %s process %r" % ('Android', argv[0]) @@ -1263,7 +1262,7 @@ def __eq__(self, other): >>> adb.properties.ro.build.version.sdk == "24" True """ - if isinstance(other, six.string_types): + if isinstance(other, str): return str(self) == other return super(Property, self).__eq__(other) diff --git a/pwnlib/adb/bootloader.py b/pwnlib/adb/bootloader.py index 149dd4715..d03a3563a 100644 --- a/pwnlib/adb/bootloader.py +++ b/pwnlib/adb/bootloader.py @@ -4,7 +4,6 @@ import ctypes import io import os -import six import sys from pwnlib.log import getLogger @@ -65,7 +64,7 @@ def extract(self, index_or_name): Returns: Contents of the image. """ - if isinstance(index_or_name, six.integer_types): + if isinstance(index_or_name, int): index = index_or_name else: for i in range(len(self.img_info)): diff --git a/pwnlib/commandline/cyclic.py b/pwnlib/commandline/cyclic.py index c7a5060f6..cfc4b8a39 100644 --- a/pwnlib/commandline/cyclic.py +++ b/pwnlib/commandline/cyclic.py @@ -2,7 +2,6 @@ from __future__ import division import argparse -import six import string import sys @@ -47,6 +46,7 @@ group.add_argument( '-l', '-o', '--offset', '--lookup', dest = 'lookup', + type = str.encode, metavar = 'lookup_value', help = 'Do a lookup instead printing the alphabet', ) @@ -66,9 +66,6 @@ def main(args): if args.lookup: pat = args.lookup - if six.PY3: - pat = bytes(pat, encoding='utf-8') - try: pat = int(pat, 0) pat = pack(pat, 'all') diff --git a/pwnlib/commandline/shellcraft.py b/pwnlib/commandline/shellcraft.py index ae24e4c1f..f5f6fd6cf 100644 --- a/pwnlib/commandline/shellcraft.py +++ b/pwnlib/commandline/shellcraft.py @@ -3,7 +3,6 @@ import argparse import os -import six import sys import types @@ -280,8 +279,8 @@ def main(args): code_array = [] for (name, func, func_args) in funcs: - defargs = len(six.get_function_defaults(func) or ()) - reqargs = six.get_function_code(func).co_argcount - defargs + defargs = len(func.__defaults__ or ()) + reqargs = func.__code__.co_argcount - defargs if len(func_args) < reqargs: if defargs > 0: diff --git a/pwnlib/config.py b/pwnlib/config.py index 06b9514b0..01981ea0b 100644 --- a/pwnlib/config.py +++ b/pwnlib/config.py @@ -35,7 +35,7 @@ from __future__ import absolute_import from __future__ import division -from six.moves import configparser +import configparser import os registered_configs = {} diff --git a/pwnlib/context/__init__.py b/pwnlib/context/__init__.py index 2aebe8dbd..4ffed2cf0 100644 --- a/pwnlib/context/__init__.py +++ b/pwnlib/context/__init__.py @@ -15,7 +15,6 @@ import os.path import platform import shutil -import six import socket import string import sys @@ -1043,7 +1042,7 @@ def log_file(self, value): >>> open(bar_txt).readlines()[-1] #doctest: +ELLIPSIS '...:DEBUG:...:Hello from bar!\n' """ - if isinstance(value, (bytes, six.text_type)): + if isinstance(value, (bytes, str)): # check if mode was specified as "[value],[mode]" from pwnlib.util.packing import _need_text value = _need_text(value) @@ -1261,7 +1260,7 @@ def terminal(self, value): Can be a string or an iterable of strings. In the latter case the first entry is the terminal and the rest are default arguments. """ - if isinstance(value, (bytes, six.text_type)): + if isinstance(value, (bytes, str)): return [value] return value @@ -1342,7 +1341,7 @@ def adb_port(self, value): def device(self, device): """Sets the device being operated on. """ - if isinstance(device, (bytes, six.text_type)): + if isinstance(device, (bytes, str)): device = Device(device) if isinstance(device, Device): self.arch = device.arch or self.arch @@ -1758,7 +1757,7 @@ def update_context_defaults(section): default = ContextType.defaults[key] - if isinstance(default, six.string_types + six.integer_types + (tuple, list, dict)): + if isinstance(default, (str, int, tuple, list, dict)): value = safeeval.expr(value) else: log.warn("Unsupported configuration option %r in section %r" % (key, 'context')) diff --git a/pwnlib/data/syscalls/Makefile b/pwnlib/data/syscalls/Makefile index 4529ffade..22aabfd9a 100644 --- a/pwnlib/data/syscalls/Makefile +++ b/pwnlib/data/syscalls/Makefile @@ -1,5 +1,4 @@ ROOT=$(shell git rev-parse --show-toplevel) -TEMPLATE_DIR="$ROOT/pwnlib/shellcraft/templates/common/linux/syscalls" all: generate.py functions.py python generate.py "$(ROOT)/pwnlib/shellcraft/templates/common/linux/syscalls" diff --git a/pwnlib/data/syscalls/generate.py b/pwnlib/data/syscalls/generate.py index 4ddfdc5a2..9a3af4910 100644 --- a/pwnlib/data/syscalls/generate.py +++ b/pwnlib/data/syscalls/generate.py @@ -10,15 +10,15 @@ # github.com/zachriggle/functions from functions import functions, Function, Argument -ARCHITECTURES = ['i386', 'amd64', 'arm', 'aarch64', 'mips'] +ARCHITECTURES = ['i386', 'amd64', 'arm', 'aarch64', 'mips', 'riscv64', 'powerpc64'] HEADER = ''' <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> ''' @@ -40,7 +40,7 @@ <%page args="{arguments_default_values}"/> """ -CALL = """ +CALL = r""" <% abi = pwnlib.abi.ABI.syscall() stack = abi.stack @@ -76,8 +76,8 @@ # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg @@ -112,7 +112,7 @@ %> /* {name}(${{', '.join(syscall_repr)}}) */ %for name, arg in string_arguments.items(): - ${{pwnlib.shellcraft.pushstr(arg, append_null=(b'\\x00' not in arg))}} + ${{pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))}} ${{pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)}} %endfor %for name, arg in array_arguments.items(): diff --git a/pwnlib/elf/elf.py b/pwnlib/elf/elf.py index 5e74aa506..df8661e45 100644 --- a/pwnlib/elf/elf.py +++ b/pwnlib/elf/elf.py @@ -41,11 +41,10 @@ import mmap import os import re -import six import subprocess import tempfile -from six import BytesIO +from io import BytesIO from collections import namedtuple, defaultdict @@ -266,7 +265,7 @@ def __init__(self, path, checksec=True): #: #: See: :attr:`.ContextType.arch` self.arch = self.get_machine_arch() - if isinstance(self.arch, (bytes, six.text_type)): + if isinstance(self.arch, (bytes, str)): self.arch = self.arch.lower() self._sections = None diff --git a/pwnlib/encoders/i386/ascii_shellcode.py b/pwnlib/encoders/i386/ascii_shellcode.py index 993cfbb1d..7071d30ff 100644 --- a/pwnlib/encoders/i386/ascii_shellcode.py +++ b/pwnlib/encoders/i386/ascii_shellcode.py @@ -6,8 +6,6 @@ from itertools import product -import six - from pwnlib.context import LocalContext from pwnlib.context import context from pwnlib.encoders.encoder import Encoder @@ -43,10 +41,7 @@ def __init__(self, slop=20, max_subs=4): there are, the bigger the packed shellcode will be. Defaults to 4. """ - if six.PY2: - super(AsciiShellcodeEncoder, self).__init__() - elif six.PY3: - super().__init__() + super().__init__() self.slop = slop self.max_subs = max_subs diff --git a/pwnlib/encoders/i386/delta.py b/pwnlib/encoders/i386/delta.py index e3d272917..14d408bd4 100644 --- a/pwnlib/encoders/i386/delta.py +++ b/pwnlib/encoders/i386/delta.py @@ -1,7 +1,6 @@ from __future__ import absolute_import from __future__ import division -import six import collections from random import choice from random import randint @@ -59,7 +58,7 @@ def __call__(self, raw_bytes, avoid, pcreg=''): table = collections.defaultdict(lambda: []) endchar = bytearray() - not_bad = lambda x: six.int2byte(x) not in avoid + not_bad = lambda x: x not in avoid not_bad_or_term = lambda x: not_bad(x) and x != self.terminator for i in filter(not_bad_or_term, range(0, 256)): diff --git a/pwnlib/encoders/mips/xor.py b/pwnlib/encoders/mips/xor.py index bd2fcbc83..9bb4bf6f0 100644 --- a/pwnlib/encoders/mips/xor.py +++ b/pwnlib/encoders/mips/xor.py @@ -25,7 +25,6 @@ from __future__ import absolute_import from __future__ import division -import six from pwnlib import asm from pwnlib import shellcraft from pwnlib.context import context @@ -128,8 +127,8 @@ def __call__(self, raw_bytes, avoid, pcreg=''): sizehi = size >> 8 decoder = decoders[context.endian] - decoder = decoder.replace(b'SIZ1', six.int2byte(sizehi)) - decoder = decoder.replace(b'SIZ2', six.int2byte(sizelo)) + decoder = decoder.replace(b'SIZ1', bytes([sizehi])) + decoder = decoder.replace(b'SIZ2', bytes([sizelo])) key, data = xor_key(raw_bytes, avoid=avoid) diff --git a/pwnlib/filepointer.py b/pwnlib/filepointer.py index 8b05781e3..d92fa72d9 100644 --- a/pwnlib/filepointer.py +++ b/pwnlib/filepointer.py @@ -27,7 +27,6 @@ from pwnlib.context import context from pwnlib.log import getLogger -from pwnlib.util.misc import python_2_bytes_compatible from pwnlib.util.packing import pack log = getLogger(__name__) @@ -98,7 +97,6 @@ def update_var(l): return var -@python_2_bytes_compatible class FileStructure(object): r""" Crafts a FILE structure, with default values for some fields, like _lock which should point to null ideally, set. diff --git a/pwnlib/filesystem/path.py b/pwnlib/filesystem/path.py index 032bf77c6..40c04fc9a 100644 --- a/pwnlib/filesystem/path.py +++ b/pwnlib/filesystem/path.py @@ -1,10 +1,6 @@ -import six import tempfile -if six.PY3: - from pathlib import * -else: - from pathlib2 import * +from pathlib import * @classmethod def mktemp(cls): diff --git a/pwnlib/filesystem/ssh.py b/pwnlib/filesystem/ssh.py index 6cf6626b6..49a91d0fd 100644 --- a/pwnlib/filesystem/ssh.py +++ b/pwnlib/filesystem/ssh.py @@ -5,7 +5,6 @@ Emulates pathlib as much as possible, but does so through duck typing. """ import os -import six import sys import tempfile import time @@ -14,10 +13,7 @@ from pwnlib.util.misc import read, write from pwnlib.util.packing import _encode, _decode -if six.PY3: - from pathlib import * -else: - from pathlib2 import * +from pathlib import * class SSHPath(PosixPath): r"""Represents a file that exists on a remote filesystem. @@ -81,13 +77,8 @@ def _s(self, other): if isinstance(other, str): return other - # We don't want unicode - if isinstance(other, six.text_type): - return str(other) - - # We also don't want binary - if isinstance(other, six.binary_type): - return str(_decode(other)) + # We don't want binary + return _decode(other) def _new(self, path, *a, **kw): kw['ssh'] = self.ssh @@ -399,14 +390,9 @@ def resolve(self, strict=False): path = self.absolute().path path = os.path.normpath(path) - if six.PY2: - error_type = IOError - else: - error_type = FileNotFoundError - try: return self._new(self.ssh.sftp.normalize(path)) - except error_type as e: + except FileNotFoundError as e: raise ValueError("Could not normalize path: %r" % path) def stat(self): diff --git a/pwnlib/fmtstr.py b/pwnlib/fmtstr.py index 975efb250..85e59d1d0 100644 --- a/pwnlib/fmtstr.py +++ b/pwnlib/fmtstr.py @@ -98,7 +98,6 @@ def send_payload(payload): import logging import re from operator import itemgetter -from six.moves import range from sortedcontainers import SortedList from pwnlib.log import getLogger diff --git a/pwnlib/gdb.py b/pwnlib/gdb.py index b69f8ed13..d35920c7b 100644 --- a/pwnlib/gdb.py +++ b/pwnlib/gdb.py @@ -146,8 +146,6 @@ import psutil import random import re -import six -import six.moves import socket import tempfile from threading import Event @@ -233,7 +231,7 @@ def debug_shellcode(data, gdbscript=None, vma=None, api=False): >>> io.recvline() b'Hello world!\n' """ - if isinstance(data, six.text_type): + if isinstance(data, str): log.error("Shellcode is cannot be unicode. Did you mean debug_assembly?") tmp_elf = make_elf(data, extract=False, vma=vma) os.chmod(tmp_elf, 0o777) @@ -627,10 +625,10 @@ def debug(args, gdbscript=None, gdb_args=None, exe=None, ssh=None, env=None, por >>> ssh_io.close() >>> shell.close() """ - if isinstance(args, six.integer_types + (tubes.process.process, tubes.ssh.ssh_channel)): + if isinstance(args, (int, tubes.process.process, tubes.ssh.ssh_channel)): log.error("Use gdb.attach() to debug a running process") - if isinstance(args, (bytes, six.text_type)): + if isinstance(args, (bytes, str)): args = [args] orig_args = args @@ -1133,7 +1131,7 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr # let's see if we can find a pid to attach to pid = None - if isinstance(target, six.integer_types): + if isinstance(target, int): # target is a pid, easy peasy pid = target elif isinstance(target, str): @@ -1306,10 +1304,6 @@ def preexec_fn(): # connect to the GDB Python API bridge from rpyc import BgServingThread from rpyc.utils.factory import unix_connect - if six.PY2: - retriable = socket.error - else: - retriable = ConnectionRefusedError, FileNotFoundError t = Timeout() with t.countdown(10): @@ -1317,7 +1311,7 @@ def preexec_fn(): try: conn = unix_connect(socket_path) break - except retriable: + except (ConnectionRefusedError, FileNotFoundError): time.sleep(0.1) else: # Check to see if RPyC is installed at all in GDB diff --git a/pwnlib/libcdb.py b/pwnlib/libcdb.py index 4f00e677e..bde4f2c56 100644 --- a/pwnlib/libcdb.py +++ b/pwnlib/libcdb.py @@ -6,10 +6,8 @@ import os import time -import six import tempfile import struct -import sys from pwnlib.context import context from pwnlib.elf import ELF @@ -88,7 +86,7 @@ def provider_libcdb(hex_encoded_id, search_type): # Deferred import because it's slow import requests - from six.moves import urllib + import urllib.parse # Build the URL using the requested hash type url_base = "{}/libcdb/libcdb/raw/master/hashes/{}/".format(GITLAB_LIBCDB_URL, search_type) @@ -306,7 +304,7 @@ def _search_debuginfo_by_hash(base_url, hex_encoded_id): """ # Deferred import because it's slow import requests - from six.moves import urllib + import urllib.parse # Check if we tried this buildid before. cache, cache_valid = _check_elf_cache('libcdb_dbg', hex_encoded_id, 'build_id') @@ -441,7 +439,7 @@ def unstrip_libc(filename): return True def _extract_tarfile(cache_dir, data_filename, tarball): - from six import BytesIO + from io import BytesIO import tarfile # Handle zstandard compression, since tarfile only supports gz, bz2, and xz. if data_filename.endswith('.zst') or data_filename.endswith('.zstd'): @@ -453,19 +451,6 @@ def _extract_tarfile(cache_dir, data_filename, tarball): tarball.close() tarball = decompressed_tar - if six.PY2 and data_filename.endswith('.xz'): - # Python 2's tarfile doesn't support xz, so we need to decompress it first. - # Shell out to xz, since the Python 2 pylzma module is broken. - # (https://github.com/fancycode/pylzma/issues/67) - if not which('xz'): - log.error('Couldn\'t find "xz" in PATH. Please install xz first.') - import subprocess - try: - uncompressed_tarball = subprocess.check_output(['xz', '--decompress', '--stdout', tarball.name]) - tarball = BytesIO(uncompressed_tarball) - except subprocess.CalledProcessError: - log.error('Failed to decompress xz archive.') - with tarfile.open(fileobj=tarball) as tar_file: # Find the library folder in the archive (e.g. /lib/x86_64-linux-gnu/) lib_dir = None @@ -499,46 +484,18 @@ def _extract_tarfile(cache_dir, data_filename, tarball): def _extract_debfile(cache_dir, package_filename, package): # Extract data.tar in the .deb archive. - if sys.version_info < (3, 6): - if not which('ar'): - log.error('Missing command line tool "ar" to extract .deb archive. Please install "ar" first.') - - import atexit - import shutil - import subprocess - - # Use mkdtemp instead of TemporaryDirectory because the latter is not available in Python 2. - tempdir = tempfile.mkdtemp(prefix=".pwntools-tmp") - atexit.register(shutil.rmtree, tempdir) - with tempfile.NamedTemporaryFile(mode='wb', dir=tempdir) as debfile: - debfile.write(package) - debfile.flush() - try: - files_in_deb = subprocess.check_output(['ar', 't', debfile.name]).split(b'\n') - except subprocess.CalledProcessError: - log.error('Failed to list files in .deb archive.') - [data_filename] = filter(lambda f: f.startswith(b'data.tar'), files_in_deb) - - try: - subprocess.check_call(['ar', 'x', debfile.name, data_filename], cwd=tempdir) - except subprocess.CalledProcessError: - log.error('Failed to extract data.tar from .deb archive.') - - with open(os.path.join(tempdir, data_filename), 'rb') as tarball: - return _extract_tarfile(cache_dir, data_filename, tarball) - else: - import unix_ar - from six import BytesIO - ar_file = unix_ar.open(BytesIO(package)) - try: - data_filename = next(filter(lambda f: f.name.startswith(b'data.tar'), ar_file.infolist())).name.decode() - tarball = ar_file.open(data_filename) - return _extract_tarfile(cache_dir, data_filename, tarball) - finally: - ar_file.close() + import unix_ar + from io import BytesIO + ar_file = unix_ar.open(BytesIO(package)) + try: + data_filename = next(filter(lambda f: f.name.startswith(b'data.tar'), ar_file.infolist())).name.decode() + tarball = ar_file.open(data_filename) + return _extract_tarfile(cache_dir, data_filename, tarball) + finally: + ar_file.close() def _extract_pkgfile(cache_dir, package_filename, package): - from six import BytesIO + from io import BytesIO return _extract_tarfile(cache_dir, package_filename, BytesIO(package)) def _find_libc_package_lib_url(libc): diff --git a/pwnlib/log.py b/pwnlib/log.py index 317dde44a..21cf8a39f 100644 --- a/pwnlib/log.py +++ b/pwnlib/log.py @@ -98,7 +98,6 @@ import os import random import re -import six import string import sys import threading @@ -284,7 +283,7 @@ def __init__(self, logger=None): self._logger = logger def _getlevel(self, levelString): - if isinstance(levelString, six.integer_types): + if isinstance(levelString, int): return levelString return logging._levelNames[levelString.upper()] diff --git a/pwnlib/memleak.py b/pwnlib/memleak.py index 49909c19b..46871ab26 100644 --- a/pwnlib/memleak.py +++ b/pwnlib/memleak.py @@ -5,9 +5,6 @@ import functools import string -import six -from six.moves import range - from pwnlib.context import context from pwnlib.log import getLogger from pwnlib.util.packing import pack, _p8lu @@ -166,7 +163,7 @@ def field_compare(self, address, obj, expected): the type of ``field``. """ - if isinstance(expected, six.integer_types): + if isinstance(expected, int): expected = pack(expected, bytes=obj.size) elif not isinstance(expected, bytes): raise TypeError("Expected value must be an int or bytes") diff --git a/pwnlib/pep237.py b/pwnlib/pep237.py deleted file mode 100644 index 70212f3be..000000000 --- a/pwnlib/pep237.py +++ /dev/null @@ -1,18 +0,0 @@ -# -# Override the behavior of the built-in hex() method -# to strip the trailing 'L'. -# -# This has no meaning anymore, as of 2006. -# -# https://www.python.org/dev/peps/pep-0237/ -# https://mail.python.org/pipermail/python-dev/2006-June/065918.html -# -from six.moves import builtins - -original_hex = builtins.hex - -def hex(number): - original_hex.__doc__ - return original_hex(number).rstrip('L') - -builtins.hex = hex diff --git a/pwnlib/protocols/adb/__init__.py b/pwnlib/protocols/adb/__init__.py index bf305c74b..f195da53f 100644 --- a/pwnlib/protocols/adb/__init__.py +++ b/pwnlib/protocols/adb/__init__.py @@ -10,7 +10,6 @@ import logging import functools -import six import stat import time @@ -144,7 +143,7 @@ def wrapper(self, *a, **kw): def send(self, *a, **kw): """Sends data to the ADB server""" - if isinstance(a[0], six.text_type): + if isinstance(a[0], str): a = (a[0].encode('utf-8'),) + a[1:] return self.c.adb_send(*a, **kw) @@ -432,7 +431,7 @@ def list(self, path): @_with_transport @_sync def _list(self, path): - if isinstance(path, six.text_type): + if isinstance(path, str): path = path.encode('utf-8') self.c.flat32(b'LIST', len(path), path) files = {} @@ -486,7 +485,7 @@ def stat(self, path): >>> pwnlib.protocols.adb.AdbClient().stat('/does/not/exist') is None True """ - if isinstance(path, six.text_type): + if isinstance(path, str): path = path.encode('utf-8') self.c.flat32(b'STAT', len(path), path) if self.c.recvn(4) != b'STAT': @@ -530,7 +529,7 @@ def write(self, path, data, mode=0o755, timestamp=None, callback=None): @_with_transport @_sync def _write(self, path, data, mode=0o755, timestamp=None, callback=None): - if isinstance(path, six.text_type): + if isinstance(path, str): path = path.encode('utf-8') path += b',%d' % mode @@ -576,7 +575,7 @@ def read(self, path, filesize=0, callback=lambda *a: True): Return: The data received as a string. """ - if isinstance(path, six.text_type): + if isinstance(path, str): path = path.encode('utf-8') self.c.send(b'RECV' + p32(len(path)) + path) diff --git a/pwnlib/rop/call.py b/pwnlib/rop/call.py index 4e7534726..49c852123 100644 --- a/pwnlib/rop/call.py +++ b/pwnlib/rop/call.py @@ -7,9 +7,7 @@ from pwnlib.context import context from pwnlib.util import packing -import six - -from pwnlib.util.misc import python_2_bytes_compatible, align +from pwnlib.util.misc import align class Unresolved(object): @@ -58,7 +56,6 @@ class StackAdjustment(Unresolved): pass -@python_2_bytes_compatible class AppendedArgument(Unresolved): r""" Encapsulates information about a pointer argument, and the data @@ -115,7 +112,7 @@ def __init__(self, value, address = 0): if isinstance(v, (list, tuple)): self.size += context.bytes else: - if isinstance(v, six.text_type): + if isinstance(v, str): v = packing._need_bytes(v) try: self.size += align(context.bytes, len(v)) @@ -173,9 +170,9 @@ def resolve(self, addr=None): self.address = addr rv = [None] * len(self.values) for i, value in enumerate(self.values): - if isinstance(value, six.integer_types): + if isinstance(value, int): rv[i] = value - elif isinstance(value, six.text_type): + elif isinstance(value, str): value = packing._need_bytes(value) if isinstance(value, (bytes, bytearray)): value += b'\x00' @@ -197,7 +194,7 @@ def __bytes__(self): return packing.flat(self.resolve()) def __repr__(self): - if isinstance(self.address, six.integer_types): + if isinstance(self.address, int): return '%s(%r, %#x)' % (self.__class__.__name__, self.values, self.address) else: return '%s(%r, %r)' % (self.__class__.__name__, self.values, self.address) @@ -227,27 +224,26 @@ class Call(object): args = [] def __init__(self, name, target, args, abi=None, before=()): - assert isinstance(name, (bytes, six.text_type)) - # assert isinstance(target, six.integer_types) + assert isinstance(name, (bytes, str)) assert isinstance(args, (list, tuple)) self.abi = abi or ABI.default() self.name = name self.target = target self.args = list(args) for i, arg in enumerate(args): - if not isinstance(arg, six.integer_types+(Unresolved,)): + if not isinstance(arg, (int, Unresolved)): self.args[i] = AppendedArgument(arg) self.stack_arguments_before = before def __repr__(self): - fmt = "%#x" if isinstance(self.target, six.integer_types) else "%r" + fmt = "%#x" if isinstance(self.target, int) else "%r" return '%s(%r, %s, %r)' % (self.__class__.__name__, self.name, fmt % self.target, self.args) def is_flat(self): - if isinstance(self, six.integer_types + (Unresolved,)): + if isinstance(self, (int, Unresolved)): return True if not isinstance(self, Call): return False @@ -271,7 +267,7 @@ def _special_repr(cls, x): return x def __str__(self): - fmt = "%#x" if isinstance(self.target, six.integer_types) else "%r" + fmt = "%#x" if isinstance(self.target, int) else "%r" args = [] for arg in self.args: args.append(self._special_repr(arg)) @@ -279,7 +275,7 @@ def __str__(self): name = self.name or (fmt % self.target) arg_str = [] for arg in args: - if isinstance(arg, six.integer_types) and arg > 0x100: + if isinstance(arg, int) and arg > 0x100: arg_str.append(hex(arg)) else: arg_str.append(str(arg)) diff --git a/pwnlib/rop/gadgets.py b/pwnlib/rop/gadgets.py index 67a6dab01..e8aecf4e0 100644 --- a/pwnlib/rop/gadgets.py +++ b/pwnlib/rop/gadgets.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -import six class Gadget(object): """ @@ -55,12 +54,12 @@ def __repr__(self): def __getitem__(self, key): # Backward compatibility - if isinstance(key, six.integer_types): + if isinstance(key, int): key = self.__indices[key] return getattr(self, key) def __setitem__(self, key, value): # Backward compatibility - if isinstance(key, six.integer_types): + if isinstance(key, int): key = self.__indices[key] return setattr(self, key, value) diff --git a/pwnlib/rop/ret2dlresolve.py b/pwnlib/rop/ret2dlresolve.py index c05fa9e67..2788a0936 100644 --- a/pwnlib/rop/ret2dlresolve.py +++ b/pwnlib/rop/ret2dlresolve.py @@ -65,7 +65,6 @@ True """ -import six from copy import deepcopy from pwnlib.context import context @@ -377,7 +376,7 @@ def _build_args(self): elif isinstance(top, bytes): top = pack(self.data_addr + len(self.payload) + queue.size()) queue.append(MarkedBytes(queue[0])) - elif isinstance(top, six.integer_types): + elif isinstance(top, int): top = pack(top) self.payload += top diff --git a/pwnlib/rop/rop.py b/pwnlib/rop/rop.py index 3a15be29f..5eb94f852 100644 --- a/pwnlib/rop/rop.py +++ b/pwnlib/rop/rop.py @@ -367,7 +367,6 @@ import os import re import shutil -import six import string import struct import sys @@ -392,7 +391,6 @@ from pwnlib.util import packing from pwnlib.util.cyclic import cyclic from pwnlib.util.packing import pack -from pwnlib.util.misc import python_2_bytes_compatible log = getLogger(__name__) __all__ = ['ROP'] @@ -413,7 +411,7 @@ def __init__(self, name=''): self.name = name def _slot_len(x): - if isinstance(x, six.integer_types+(Unresolved, Padding, Gadget)): + if isinstance(x, (int, Unresolved, Padding, Gadget)): return context.bytes else: return len(packing.flat(x)) @@ -456,7 +454,7 @@ def dump(self): line = '0x%04x:' % addr if isinstance(data, (str, bytes)): line += ' %16r' % data - elif isinstance(data, six.integer_types): + elif isinstance(data, int): line += ' %#16x' % data if self.address != 0 and self.address < data < self.next: off = data - addr @@ -473,7 +471,6 @@ def dump(self): return '\n'.join(rv) -@python_2_bytes_compatible class ROP(object): r"""Class which simplifies the generation of ROP-chains. @@ -603,7 +600,7 @@ def __init__(self, elfs, base = None, badchars = b'', **kwargs): # Permit singular ROP(elf) vs ROP([elf]) if isinstance(elfs, ELF): elfs = [elfs] - elif isinstance(elfs, (bytes, six.text_type)): + elif isinstance(elfs, (bytes, str)): elfs = [ELF(elfs)] #: List of individual ROP gadgets, ROP calls, SROP frames, etc. @@ -788,7 +785,7 @@ def resolve(self, resolvable): if resolvable in elf.symbols: return elf.symbols[resolvable] - if isinstance(resolvable, six.integer_types): + if isinstance(resolvable, int): return resolvable def unresolve(self, value): @@ -841,9 +838,9 @@ def describe(self, object): """ if isinstance(object, enums): return str(object) - if isinstance(object, six.integer_types): + if isinstance(object, int): return self.unresolve(object) - if isinstance(object, (bytes, six.text_type)): + if isinstance(object, (bytes, str)): return repr(object) if isinstance(object, Gadget): return '; '.join(object.insns) @@ -886,14 +883,14 @@ def build(self, base = None, description = None): # Integers can just be added. # Do our best to find out what the address is. - if isinstance(slot, six.integer_types): + if isinstance(slot, int): stack.describe(self.describe(slot)) stack.append(slot) # Byte blobs can also be added, however they must be # broken down into pointer-width blobs. - elif isinstance(slot, (bytes, six.text_type)): + elif isinstance(slot, (bytes, str)): stack.describe(self.describe(slot)) if not isinstance(slot, bytes): slot = slot.encode() @@ -1011,10 +1008,10 @@ def build(self, base = None, description = None): size = (stack.next - base) slot_address = base for i, slot in enumerate(stack): - if isinstance(slot, six.integer_types): + if isinstance(slot, int): pass - elif isinstance(slot, (bytes, six.text_type)): + elif isinstance(slot, (bytes, str)): pass elif isinstance(slot, AppendedArgument): @@ -1136,7 +1133,7 @@ def _srop_call(self, resolvable, arguments): SYS_sigreturn = constants.SYS_rt_sigreturn for register, value in zip(frame.arguments, arguments): - if not isinstance(value, six.integer_types + (Unresolved,)): + if not isinstance(value, (int, Unresolved)): frame[register] = AppendedArgument(value) else: frame[register] = value diff --git a/pwnlib/shellcraft/__init__.py b/pwnlib/shellcraft/__init__.py index de1127448..58f20379b 100644 --- a/pwnlib/shellcraft/__init__.py +++ b/pwnlib/shellcraft/__init__.py @@ -4,7 +4,6 @@ import itertools import os import re -import six import sys from types import ModuleType @@ -137,7 +136,7 @@ def templates(self): return templates def eval(self, item): - if isinstance(item, six.integer_types): + if isinstance(item, int): return item return constants.eval(item) @@ -147,7 +146,7 @@ def pretty(self, n, comment=True): if not comment: # then it can be inside a comment! r = r.replace('*/', r'\x2a/') return r - if not isinstance(n, six.integer_types): + if not isinstance(n, int): return n if isinstance(n, constants.Constant): if comment: return '%s /* %s */' % (n,self.pretty(int(n))) @@ -158,7 +157,7 @@ def pretty(self, n, comment=True): return '%#x' % n def okay(self, s, *a, **kw): - if isinstance(s, six.integer_types): + if isinstance(s, int): s = packing.pack(s, *a, **kw) return b'\0' not in s and b'\n' not in s diff --git a/pwnlib/shellcraft/templates/aarch64/darwin/syscall.asm b/pwnlib/shellcraft/templates/aarch64/darwin/syscall.asm index fb3d2318c..d7da7c0f3 100644 --- a/pwnlib/shellcraft/templates/aarch64/darwin/syscall.asm +++ b/pwnlib/shellcraft/templates/aarch64/darwin/syscall.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import aarch64, pretty from pwnlib.constants import Constant from pwnlib.abi import darwin_aarch64_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None"/> <%docstring> @@ -28,7 +27,7 @@ Example: svc 0 <% - if isinstance(syscall, (str, text_type, Constant)) and str(syscall).startswith('SYS_'): + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: diff --git a/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/execve.asm b/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/execve.asm index 1f74b7377..092eb85d2 100644 --- a/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/execve.asm +++ b/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/execve.asm @@ -3,7 +3,6 @@ import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>execve(path, argv, envp) -> str @@ -54,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/exit.asm b/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/exit.asm index 08e080de0..8f194f099 100644 --- a/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/exit.asm +++ b/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/exit.asm @@ -3,7 +3,6 @@ import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>exit(status) -> str @@ -52,8 +51,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/getdirentries64.asm b/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/getdirentries64.asm index 3e12b01f6..1c30947d1 100644 --- a/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/getdirentries64.asm +++ b/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/getdirentries64.asm @@ -3,7 +3,6 @@ import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getdirentries64(fd, buf, bufsize, position) -> str @@ -55,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/getxattr.asm b/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/getxattr.asm index 42806a004..4f4e159d1 100644 --- a/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/getxattr.asm +++ b/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/getxattr.asm @@ -3,7 +3,6 @@ import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getxattr(path, name, value, size) -> str @@ -55,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/lseek.asm b/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/lseek.asm index a5f691716..40e75b3c2 100644 --- a/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/lseek.asm +++ b/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/lseek.asm @@ -3,7 +3,6 @@ import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>lseek(fd, offset, whence) -> str @@ -54,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/read.asm b/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/read.asm index b4fe7b4e8..c4c0de06a 100644 --- a/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/read.asm +++ b/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/read.asm @@ -3,7 +3,6 @@ import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>read(fd, buf, nbytes) -> str @@ -54,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/write.asm b/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/write.asm index a20c06995..9bd2178aa 100644 --- a/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/write.asm +++ b/pwnlib/shellcraft/templates/aarch64/darwin/syscalls/write.asm @@ -3,7 +3,6 @@ import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>write(fd, buf, n) -> str @@ -54,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/aarch64/freebsd/syscall.asm b/pwnlib/shellcraft/templates/aarch64/freebsd/syscall.asm index e08b5b4a2..95960f52e 100644 --- a/pwnlib/shellcraft/templates/aarch64/freebsd/syscall.asm +++ b/pwnlib/shellcraft/templates/aarch64/freebsd/syscall.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import aarch64, pretty from pwnlib.constants import Constant from pwnlib.abi import freebsd_aarch64_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None"/> <%docstring> @@ -28,7 +27,7 @@ Example: svc 0 <% - if isinstance(syscall, (str, text_type, Constant)) and str(syscall).startswith('SYS_'): + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: diff --git a/pwnlib/shellcraft/templates/aarch64/linux/stage.asm b/pwnlib/shellcraft/templates/aarch64/linux/stage.asm index a0e8df3ed..a90eaf36b 100644 --- a/pwnlib/shellcraft/templates/aarch64/linux/stage.asm +++ b/pwnlib/shellcraft/templates/aarch64/linux/stage.asm @@ -1,5 +1,4 @@ <% -import six from pwnlib.shellcraft.aarch64 import mov from pwnlib.shellcraft.aarch64.linux import read, readn, mmap from pwnlib import constants as C @@ -29,7 +28,7 @@ Example: protection = C.PROT_READ | C.PROT_WRITE | C.PROT_EXEC flags = C.MAP_ANONYMOUS | C.MAP_PRIVATE - assert isinstance(fd, six.integer_types) + assert isinstance(fd, int) %> %if length is None: /* How many bytes should we receive? */ diff --git a/pwnlib/shellcraft/templates/aarch64/linux/syscall.asm b/pwnlib/shellcraft/templates/aarch64/linux/syscall.asm index b0acc3068..ee676acff 100644 --- a/pwnlib/shellcraft/templates/aarch64/linux/syscall.asm +++ b/pwnlib/shellcraft/templates/aarch64/linux/syscall.asm @@ -1,8 +1,7 @@ <% from pwnlib.shellcraft import aarch64, pretty - from pwnlib.constants import eval + from pwnlib.constants import Constant from pwnlib.abi import linux_aarch64_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None, arg6 = None"/> <%docstring> @@ -51,8 +50,8 @@ Example: svc 0 <% - if isinstance(syscall, (str, text_type)) and syscall.startswith('SYS_'): - syscall_repr = syscall[4:] + "(%s)" + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): + syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: syscall_repr = 'syscall(%s)' diff --git a/pwnlib/shellcraft/templates/aarch64/mov.asm b/pwnlib/shellcraft/templates/aarch64/mov.asm index 06a3609e0..b83e0fb03 100644 --- a/pwnlib/shellcraft/templates/aarch64/mov.asm +++ b/pwnlib/shellcraft/templates/aarch64/mov.asm @@ -8,7 +8,6 @@ from pwnlib.util.fiddling import xor_pair from pwnlib.shellcraft import pretty from pwnlib.shellcraft.registers import aarch64 as regs - import six log = getLogger('pwnlib.shellcraft.arm.mov') %> <%page args="dst, src"/> @@ -50,7 +49,7 @@ mov_x15 = None xor = None -if isinstance(src, six.integer_types): +if isinstance(src, int): lobits = dst not in ('x0', 'x10') packed = pack(src) words = group(2, packed) @@ -93,7 +92,7 @@ if dst == 'x15': add ${dst}, ${src}, xzr %elif src == 'x0': add ${dst}, ${src}, xzr, lsl #1 -%elif not isinstance(src, six.integer_types): +%elif not isinstance(src, int): mov ${dst}, ${src} %else: %if src == 0: diff --git a/pwnlib/shellcraft/templates/aarch64/pushstr.asm b/pwnlib/shellcraft/templates/aarch64/pushstr.asm index c5cf0e15d..06a320974 100644 --- a/pwnlib/shellcraft/templates/aarch64/pushstr.asm +++ b/pwnlib/shellcraft/templates/aarch64/pushstr.asm @@ -1,6 +1,5 @@ <% from pwnlib.util import lists, packing, fiddling %> <% from pwnlib import shellcraft %> -<% import six %> <%page args="string, append_null = True, register1='x14', register2='x15', pretty=None"/> <%docstring> Pushes a string onto the stack. @@ -30,7 +29,7 @@ Examples: b'Hello, world! This is a long string! Wow!' <% -if isinstance(string, six.text_type): +if isinstance(string, str): string = string.encode('utf-8') if append_null and not string.endswith(b'\x00'): diff --git a/pwnlib/shellcraft/templates/aarch64/pushstr_array.asm b/pwnlib/shellcraft/templates/aarch64/pushstr_array.asm index 7b5ed7302..e03a0fac6 100644 --- a/pwnlib/shellcraft/templates/aarch64/pushstr_array.asm +++ b/pwnlib/shellcraft/templates/aarch64/pushstr_array.asm @@ -3,7 +3,6 @@ from pwnlib.shellcraft import pretty from pwnlib.util.iters import group from pwnlib.util.packing import _need_bytes - from six import text_type, binary_type %> <%docstring> Pushes an array/envp-style array of pointers onto the stack. @@ -24,7 +23,7 @@ Example: <%page args="reg, array, register1='x14', register2='x15'"/> <% -if isinstance(array, (binary_type, text_type)): +if isinstance(array, (bytes, str)): array = [array] # Convert all items to strings diff --git a/pwnlib/shellcraft/templates/aarch64/xor.asm b/pwnlib/shellcraft/templates/aarch64/xor.asm index 7a5e95611..32fc47426 100644 --- a/pwnlib/shellcraft/templates/aarch64/xor.asm +++ b/pwnlib/shellcraft/templates/aarch64/xor.asm @@ -1,5 +1,4 @@ <% - import six from pwnlib.shellcraft import pretty, common, aarch64, registers from pwnlib.shellcraft.registers import aarch64 as regs from pwnlib.util.packing import pack, unpack @@ -40,7 +39,7 @@ if not key in regs: key_str = key key_int = key - if isinstance(key, six.integer_types): + if isinstance(key, int): key_str = pack(key, bytes=4) else: key_int = unpack(key, 'all') diff --git a/pwnlib/shellcraft/templates/amd64/darwin/syscall.asm b/pwnlib/shellcraft/templates/amd64/darwin/syscall.asm index 526d9a4d1..eb9328fb6 100644 --- a/pwnlib/shellcraft/templates/amd64/darwin/syscall.asm +++ b/pwnlib/shellcraft/templates/amd64/darwin/syscall.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import amd64, pretty from pwnlib.constants import Constant from pwnlib.abi import darwin_amd64_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None"/> <%docstring> @@ -82,7 +81,7 @@ Example: <% append_cdq = False - if isinstance(syscall, (str, text_type, Constant)) and str(syscall).startswith('SYS_'): + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: diff --git a/pwnlib/shellcraft/templates/amd64/darwin/syscalls/execve.asm b/pwnlib/shellcraft/templates/amd64/darwin/syscalls/execve.asm index 1f74b7377..092eb85d2 100644 --- a/pwnlib/shellcraft/templates/amd64/darwin/syscalls/execve.asm +++ b/pwnlib/shellcraft/templates/amd64/darwin/syscalls/execve.asm @@ -3,7 +3,6 @@ import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>execve(path, argv, envp) -> str @@ -54,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/amd64/darwin/syscalls/exit.asm b/pwnlib/shellcraft/templates/amd64/darwin/syscalls/exit.asm index 08e080de0..8f194f099 100644 --- a/pwnlib/shellcraft/templates/amd64/darwin/syscalls/exit.asm +++ b/pwnlib/shellcraft/templates/amd64/darwin/syscalls/exit.asm @@ -3,7 +3,6 @@ import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>exit(status) -> str @@ -52,8 +51,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/amd64/darwin/syscalls/getdirentries64.asm b/pwnlib/shellcraft/templates/amd64/darwin/syscalls/getdirentries64.asm index 3e12b01f6..1c30947d1 100644 --- a/pwnlib/shellcraft/templates/amd64/darwin/syscalls/getdirentries64.asm +++ b/pwnlib/shellcraft/templates/amd64/darwin/syscalls/getdirentries64.asm @@ -3,7 +3,6 @@ import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getdirentries64(fd, buf, bufsize, position) -> str @@ -55,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/amd64/darwin/syscalls/getxattr.asm b/pwnlib/shellcraft/templates/amd64/darwin/syscalls/getxattr.asm index 42806a004..4f4e159d1 100644 --- a/pwnlib/shellcraft/templates/amd64/darwin/syscalls/getxattr.asm +++ b/pwnlib/shellcraft/templates/amd64/darwin/syscalls/getxattr.asm @@ -3,7 +3,6 @@ import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getxattr(path, name, value, size) -> str @@ -55,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/amd64/darwin/syscalls/lseek.asm b/pwnlib/shellcraft/templates/amd64/darwin/syscalls/lseek.asm index a5f691716..40e75b3c2 100644 --- a/pwnlib/shellcraft/templates/amd64/darwin/syscalls/lseek.asm +++ b/pwnlib/shellcraft/templates/amd64/darwin/syscalls/lseek.asm @@ -3,7 +3,6 @@ import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>lseek(fd, offset, whence) -> str @@ -54,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/amd64/darwin/syscalls/read.asm b/pwnlib/shellcraft/templates/amd64/darwin/syscalls/read.asm index b4fe7b4e8..c4c0de06a 100644 --- a/pwnlib/shellcraft/templates/amd64/darwin/syscalls/read.asm +++ b/pwnlib/shellcraft/templates/amd64/darwin/syscalls/read.asm @@ -3,7 +3,6 @@ import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>read(fd, buf, nbytes) -> str @@ -54,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/amd64/darwin/syscalls/write.asm b/pwnlib/shellcraft/templates/amd64/darwin/syscalls/write.asm index a20c06995..9bd2178aa 100644 --- a/pwnlib/shellcraft/templates/amd64/darwin/syscalls/write.asm +++ b/pwnlib/shellcraft/templates/amd64/darwin/syscalls/write.asm @@ -3,7 +3,6 @@ import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>write(fd, buf, n) -> str @@ -54,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/amd64/freebsd/syscall.asm b/pwnlib/shellcraft/templates/amd64/freebsd/syscall.asm index c33ea8a97..25bbe1fb9 100644 --- a/pwnlib/shellcraft/templates/amd64/freebsd/syscall.asm +++ b/pwnlib/shellcraft/templates/amd64/freebsd/syscall.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import amd64, pretty from pwnlib.constants import Constant from pwnlib.abi import freebsd_amd64_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None"/> <%docstring> @@ -71,7 +70,7 @@ Example: syscall <% - if isinstance(syscall, (str, text_type, Constant)) and str(syscall).startswith('SYS_'): + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: diff --git a/pwnlib/shellcraft/templates/amd64/linux/egghunter.asm b/pwnlib/shellcraft/templates/amd64/linux/egghunter.asm index fcfecfbc5..d2a573a15 100644 --- a/pwnlib/shellcraft/templates/amd64/linux/egghunter.asm +++ b/pwnlib/shellcraft/templates/amd64/linux/egghunter.asm @@ -1,5 +1,4 @@ <% -import six from pwnlib.shellcraft import amd64, pretty, common from pwnlib.util.packing import pack, unpack from pwnlib.util.lists import group @@ -25,7 +24,7 @@ done = common.label('egghunter_done') next_page = common.label('egghunter_nextpage') egg_str = egg -if isinstance(egg, six.integer_types): +if isinstance(egg, int): egg_str = pack(egg, bytes=4) if len(egg_str) % 4: diff --git a/pwnlib/shellcraft/templates/amd64/linux/stage.asm b/pwnlib/shellcraft/templates/amd64/linux/stage.asm index 6c5a9b4b1..b06a3004e 100644 --- a/pwnlib/shellcraft/templates/amd64/linux/stage.asm +++ b/pwnlib/shellcraft/templates/amd64/linux/stage.asm @@ -1,5 +1,4 @@ <% -import six from pwnlib.shellcraft.amd64 import push from pwnlib.shellcraft.amd64.linux import read, readn, mmap from pwnlib import constants as C @@ -29,7 +28,7 @@ Example: protection = C.PROT_READ | C.PROT_WRITE | C.PROT_EXEC flags = C.MAP_ANONYMOUS | C.MAP_PRIVATE - assert isinstance(fd, six.integer_types) + assert isinstance(fd, int) %> %if length is None: /* How many bytes should we receive? */ diff --git a/pwnlib/shellcraft/templates/amd64/linux/syscall.asm b/pwnlib/shellcraft/templates/amd64/linux/syscall.asm index a1c971a1f..f3381901e 100644 --- a/pwnlib/shellcraft/templates/amd64/linux/syscall.asm +++ b/pwnlib/shellcraft/templates/amd64/linux/syscall.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import amd64, pretty from pwnlib.constants import Constant from pwnlib.abi import linux_amd64_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None"/> <%docstring> @@ -101,7 +100,7 @@ Example: <% append_cdq = False - if isinstance(syscall, (str, text_type, Constant)) and str(syscall).startswith('SYS_'): + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: diff --git a/pwnlib/shellcraft/templates/amd64/mov.asm b/pwnlib/shellcraft/templates/amd64/mov.asm index e661bc120..a8016809c 100644 --- a/pwnlib/shellcraft/templates/amd64/mov.asm +++ b/pwnlib/shellcraft/templates/amd64/mov.asm @@ -4,7 +4,6 @@ from pwnlib.log import getLogger from pwnlib.shellcraft import eval, pretty, okay from pwnlib.shellcraft.registers import get_register, is_register, bits_required - import six log = getLogger('pwnlib.shellcraft.amd64.mov') %> <%page args="dest, src, stack_allowed = True"/> @@ -149,7 +148,7 @@ else: % else: mov ${dest}, ${src} % endif -% elif isinstance(src, six.integer_types): +% elif isinstance(src, int): ## Special case for zeroes ## XORing the 32-bit register clears the high 32 bits as well % if src == 0: diff --git a/pwnlib/shellcraft/templates/amd64/push.asm b/pwnlib/shellcraft/templates/amd64/push.asm index 1792f7ca6..e02d6bab6 100644 --- a/pwnlib/shellcraft/templates/amd64/push.asm +++ b/pwnlib/shellcraft/templates/amd64/push.asm @@ -5,7 +5,6 @@ from pwnlib import constants from pwnlib.shellcraft.registers import amd64 as regs from pwnlib.context import context as ctx # Ugly hack, mako will not let it be called context - from six import text_type import re %> <%page args="value"/> @@ -50,7 +49,7 @@ Example: is_reg = False if value in regs: is_reg = True - if not is_reg and isinstance(value, (str, text_type)): + if not is_reg and isinstance(value, (str, str)): try: with ctx.local(arch = 'amd64'): value = constants.eval(value) diff --git a/pwnlib/shellcraft/templates/amd64/pushstr.asm b/pwnlib/shellcraft/templates/amd64/pushstr.asm index 104ae2c51..6c35743a9 100644 --- a/pwnlib/shellcraft/templates/amd64/pushstr.asm +++ b/pwnlib/shellcraft/templates/amd64/pushstr.asm @@ -1,7 +1,6 @@ <% from pwnlib.util import lists, packing, fiddling from pwnlib.shellcraft import pretty - import six %>\ <%page args="string, append_null = True"/> <%docstring> @@ -62,7 +61,7 @@ Args: append_null (bool): Whether to append a single NULL-byte before pushing. <% - if isinstance(string, six.text_type): + if isinstance(string, str): string = string.encode('utf-8') if append_null and not string.endswith(b'\x00'): string += b'\x00' @@ -72,7 +71,7 @@ Args: def okay(s): return b'\n' not in s and b'\0' not in s - if six.indexbytes(string, -1) >= 128: + if string[-1] >= 128: extend = b'\xff' else: extend = b'\x00' diff --git a/pwnlib/shellcraft/templates/amd64/setregs.asm b/pwnlib/shellcraft/templates/amd64/setregs.asm index 11e8a430c..f7a424095 100644 --- a/pwnlib/shellcraft/templates/amd64/setregs.asm +++ b/pwnlib/shellcraft/templates/amd64/setregs.asm @@ -1,5 +1,4 @@ <% - import six from pwnlib.regsort import regsort from pwnlib.shellcraft import registers, eval from pwnlib.shellcraft.amd64 import mov @@ -51,7 +50,7 @@ if isinstance(edx, str): except NameError: pass -if isinstance(eax, six.integer_types) and isinstance(edx, six.integer_types) and eax >> 63 == edx: +if isinstance(eax, int) and isinstance(edx, int) and eax >> 63 == edx: cdq = True reg_context.pop('rdx') diff --git a/pwnlib/shellcraft/templates/amd64/xor.asm b/pwnlib/shellcraft/templates/amd64/xor.asm index 6e10f811f..e57db734e 100644 --- a/pwnlib/shellcraft/templates/amd64/xor.asm +++ b/pwnlib/shellcraft/templates/amd64/xor.asm @@ -1,5 +1,4 @@ <% - import six from pwnlib.shellcraft import pretty, common, amd64, registers from pwnlib.util.packing import pack, unpack from pwnlib.context import context as ctx @@ -46,7 +45,7 @@ else: key_str = key key_int = key - if isinstance(key, six.integer_types): + if isinstance(key, int): key_str = pack(key, bytes=4) else: key_int = unpack(key, 'all') diff --git a/pwnlib/shellcraft/templates/arm/freebsd/syscall.asm b/pwnlib/shellcraft/templates/arm/freebsd/syscall.asm index 421f1f1ae..14772e630 100644 --- a/pwnlib/shellcraft/templates/arm/freebsd/syscall.asm +++ b/pwnlib/shellcraft/templates/arm/freebsd/syscall.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import arm, pretty from pwnlib.constants import Constant from pwnlib.abi import freebsd_arm_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None"/> <%docstring> @@ -28,7 +27,7 @@ Example: svc 0 <% - if isinstance(syscall, (str, text_type, Constant)) and str(syscall).startswith('SYS_'): + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: diff --git a/pwnlib/shellcraft/templates/arm/linux/egghunter.asm b/pwnlib/shellcraft/templates/arm/linux/egghunter.asm index 52ef1f6f8..79d8f8d8c 100644 --- a/pwnlib/shellcraft/templates/arm/linux/egghunter.asm +++ b/pwnlib/shellcraft/templates/arm/linux/egghunter.asm @@ -1,4 +1,3 @@ -<% import six %> <% from pwnlib.shellcraft.arm import mov %> <% from pwnlib.util.packing import unpack %> <% from pwnlib import constants %> @@ -15,7 +14,7 @@ first address of the page that contains that address. <% - if not isinstance(egg, six.integer_types): + if not isinstance(egg, int): if not len(egg) == 4: raise Exception('Egg should be either an integer or a four byte string') egg = unpack(egg) diff --git a/pwnlib/shellcraft/templates/arm/linux/open_file.asm b/pwnlib/shellcraft/templates/arm/linux/open_file.asm index ed914e188..50b62665b 100644 --- a/pwnlib/shellcraft/templates/arm/linux/open_file.asm +++ b/pwnlib/shellcraft/templates/arm/linux/open_file.asm @@ -1,4 +1,3 @@ -<% import six %> <%page args="filepath, flags = 'O_RDONLY', mode = 0644"/> <%docstring>Opens a file. Leaves the file descriptor in r0. @@ -21,7 +20,7 @@ Args: break filepath_out = ', '.join(filepath_out) - if isinstance(mode, six.integer_types): + if isinstance(mode, int): mode = hex(mode) %> %if expr(cpp("%s & O_CREAT" % flags, arch = 'arm', os = 'linux')): diff --git a/pwnlib/shellcraft/templates/arm/linux/syscall.asm b/pwnlib/shellcraft/templates/arm/linux/syscall.asm index de3f89ad3..ed7113b0a 100644 --- a/pwnlib/shellcraft/templates/arm/linux/syscall.asm +++ b/pwnlib/shellcraft/templates/arm/linux/syscall.asm @@ -1,8 +1,7 @@ <% from pwnlib.shellcraft import arm, pretty - from pwnlib.constants import eval + from pwnlib.constants import Constant from pwnlib.abi import linux_arm_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None, arg6 = None"/> <%docstring> @@ -49,8 +48,8 @@ Example: svc 0 <% - if isinstance(syscall, (str, text_type)) and syscall.startswith('SYS_'): - syscall_repr = syscall[4:] + "(%s)" + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): + syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: syscall_repr = 'syscall(%s)' diff --git a/pwnlib/shellcraft/templates/arm/mov.asm b/pwnlib/shellcraft/templates/arm/mov.asm index a030fbccb..615f065d5 100644 --- a/pwnlib/shellcraft/templates/arm/mov.asm +++ b/pwnlib/shellcraft/templates/arm/mov.asm @@ -4,7 +4,6 @@ from pwnlib.log import getLogger from pwnlib.shellcraft.registers import arm as regs from pwnlib.util import fiddling - import six log = getLogger('pwnlib.shellcraft.arm.mov') %> <%page args="dst, src"/> @@ -86,7 +85,7 @@ if not src in regs: %> %if src == dst: /* mov ${dst}, ${src} */ -%elif not isinstance(src, six.integer_types): +%elif not isinstance(src, int): mov ${dst}, ${src} %else: %if src == 0: diff --git a/pwnlib/shellcraft/templates/arm/pushstr.asm b/pwnlib/shellcraft/templates/arm/pushstr.asm index 8975a4d28..02391c23f 100644 --- a/pwnlib/shellcraft/templates/arm/pushstr.asm +++ b/pwnlib/shellcraft/templates/arm/pushstr.asm @@ -1,7 +1,6 @@ <% from pwnlib.util import lists, packing, fiddling %> <% from pwnlib.shellcraft.arm import push %> <% from pwnlib.shellcraft import pretty %> -<% import six %> <%page args="string, append_null = True, register='r7'"/> <%docstring> Pushes a string onto the stack. @@ -24,7 +23,7 @@ Examples: <% - if isinstance(string, six.text_type): + if isinstance(string, str): string = string.encode('utf-8') if append_null: diff --git a/pwnlib/shellcraft/templates/arm/xor.asm b/pwnlib/shellcraft/templates/arm/xor.asm index 6caf7435b..f83ce71bd 100644 --- a/pwnlib/shellcraft/templates/arm/xor.asm +++ b/pwnlib/shellcraft/templates/arm/xor.asm @@ -1,5 +1,4 @@ <% - import six from pwnlib.shellcraft import pretty, common, arm, registers from pwnlib.shellcraft.registers import arm as regs from pwnlib.util.packing import pack, unpack @@ -40,7 +39,7 @@ if not key in regs: key_str = key key_int = key - if isinstance(key, six.integer_types): + if isinstance(key, int): key_str = pack(key, bytes=4) else: key_int = unpack(key, 'all') diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/_llseek.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/_llseek.asm index 3eedc9c04..16486d575 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/_llseek.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/_llseek.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>_llseek(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/_newselect.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/_newselect.asm index 59d3f454d..8088d55fb 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/_newselect.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/_newselect.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>_newselect(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/_sysctl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/_sysctl.asm index c3084db0c..0a09d1204 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/_sysctl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/_sysctl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>_sysctl(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/accept.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/accept.asm index e4810e139..583488472 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/accept.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/accept.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>accept(fd, addr, addr_len) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/accept4.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/accept4.asm index d6a635dba..a5e32b84f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/accept4.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/accept4.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>accept4(fd, addr, addr_len, flags) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/access.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/access.asm index f3fd88e0d..5bda13773 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/access.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/access.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>access(name, type) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/acct.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/acct.asm index c62eb386f..48c2e7d11 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/acct.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/acct.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>acct(name) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/add_key.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/add_key.asm index a9133a04f..f7fe92c26 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/add_key.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/add_key.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>add_key(type, description, payload, plen, keyring) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/adjtimex.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/adjtimex.asm index b170de61e..ba9cac4b7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/adjtimex.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/adjtimex.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>adjtimex(ntx) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/afs_syscall.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/afs_syscall.asm index 1da013333..d267537e0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/afs_syscall.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/afs_syscall.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>afs_syscall(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/alarm.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/alarm.asm index df6c709dd..f77384ca9 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/alarm.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/alarm.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>alarm(seconds) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/arch_prctl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/arch_prctl.asm index 9b8f42e79..8a148134d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/arch_prctl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/arch_prctl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>arch_prctl(code, addr) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/arch_specific_syscall.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/arch_specific_syscall.asm index 35736ab83..d7960ccb0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/arch_specific_syscall.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/arch_specific_syscall.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>arch_specific_syscall(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/arm_fadvise64_64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/arm_fadvise64_64.asm index b1d4aa1d4..46ad1c2dd 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/arm_fadvise64_64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/arm_fadvise64_64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>arm_fadvise64_64(fd, advice, offset, length) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/arm_sync_file_range.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/arm_sync_file_range.asm index e65f4afb3..9a6c69ea4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/arm_sync_file_range.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/arm_sync_file_range.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>arm_sync_file_range(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/bdflush.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/bdflush.asm index 27eff5293..d5f3aacd9 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/bdflush.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/bdflush.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>bdflush(func, data) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/bind.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/bind.asm index 0d4823ec4..8c05d947a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/bind.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/bind.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>bind(fd, addr, length) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/bpf.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/bpf.asm index ef074304c..ffc4085f2 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/bpf.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/bpf.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>bpf(cmd, attr, size) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/break_.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/break_.asm index 1a3154c3b..ac92f53ad 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/break_.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/break_.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>break(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/brk.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/brk.asm index 8d0004dbd..26c72ac16 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/brk.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/brk.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>brk(addr) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/cachectl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/cachectl.asm index bdf66609a..7db8dfe3f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/cachectl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/cachectl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>cachectl(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/cacheflush.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/cacheflush.asm index 9515bf466..6d2e3146c 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/cacheflush.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/cacheflush.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>cacheflush(addr, nbytes, cache) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/capget.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/capget.asm index ba767931b..c059d4610 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/capget.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/capget.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>capget(hdrp, datap) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/capset.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/capset.asm index 446741a7e..68e9e4271 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/capset.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/capset.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>capset(hdrp, datap) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/chdir.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/chdir.asm index 0ae1b46a3..0bbefe6d0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/chdir.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/chdir.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>chdir(path) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/chmod.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/chmod.asm index 894bd3fbe..9d6a78c92 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/chmod.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/chmod.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>chmod(file, mode) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/chown.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/chown.asm index df3b319d5..bf5970978 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/chown.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/chown.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>chown(file, owner, group) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/chown32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/chown32.asm index 037bcb418..9a28a5270 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/chown32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/chown32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>chown32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/chroot.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/chroot.asm index eabaf7f52..27828eccb 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/chroot.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/chroot.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>chroot(path) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_adjtime.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_adjtime.asm index 203d9eee9..bbeb27b89 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_adjtime.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_adjtime.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>clock_adjtime(clock_id, utx) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_adjtime64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_adjtime64.asm index 99f2c5d4b..760457fed 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_adjtime64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_adjtime64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>clock_adjtime64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_getres.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_getres.asm index 1d457df04..51a2683d9 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_getres.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_getres.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>clock_getres(clock_id, res) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_getres_time64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_getres_time64.asm index 8498e48c5..f0e3e0b6d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_getres_time64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_getres_time64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>clock_getres_time64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_gettime.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_gettime.asm index 248180a7c..2cd18e11b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_gettime.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_gettime.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>clock_gettime(clock_id, tp) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_gettime64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_gettime64.asm index 89d1596ef..6ac9896cd 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_gettime64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_gettime64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>clock_gettime64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_nanosleep.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_nanosleep.asm index bd9b1df65..9153a04e2 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_nanosleep.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_nanosleep.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>clock_nanosleep(clock_id, flags, req, rem) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_nanosleep_time64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_nanosleep_time64.asm index 85bda7c76..a63a7f015 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_nanosleep_time64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_nanosleep_time64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>clock_nanosleep_time64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_settime.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_settime.asm index 03addde39..db9e2326f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_settime.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_settime.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>clock_settime(clock_id, tp) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_settime64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_settime64.asm index c5f9f772f..65d7cc9af 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/clock_settime64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/clock_settime64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>clock_settime64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/clone.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/clone.asm index 00a037dd6..85499d45f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/clone.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/clone.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>clone(fn, child_stack, flags, arg, vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/clone3.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/clone3.asm index 11003f6bd..782032f9a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/clone3.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/clone3.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>clone3(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/close.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/close.asm index ea9c2c6d5..bcf9fd289 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/close.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/close.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>close(fd) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/close_range.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/close_range.asm index ecb77a9b6..8e6ee2fe3 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/close_range.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/close_range.asm @@ -1,11 +1,11 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> -<%docstring>close_range(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4) -> str +<%docstring>close_range(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str Invokes the syscall close_range. @@ -16,7 +16,7 @@ Arguments: Returns: long -<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None"/> +<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None, vararg_5=None"/> <% abi = pwnlib.abi.ABI.syscall() stack = abi.stack @@ -26,8 +26,8 @@ Returns: can_pushstr = [] can_pushstr_array = [] - argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4'] - argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4] + argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4', 'vararg_5'] + argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5] # Load all of the arguments into their destination registers / stack slots. register_arguments = dict() @@ -48,12 +48,12 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[index] = arg + stack_arguments[name] = arg # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg @@ -76,7 +76,7 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[target] = arg + stack_arguments[name] = arg # Some syscalls have different names on various architectures. # Determine which syscall number to use for the current architecture. @@ -84,7 +84,7 @@ Returns: if hasattr(pwnlib.constants, syscall): break else: - raise Exception("Could not locate any syscalls: %r" % syscalls) + raise Exception("Could not locate any syscalls: %r" % ['SYS_close_range']) %> /* close_range(${', '.join(syscall_repr)}) */ %for name, arg in string_arguments.items(): diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/connect.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/connect.asm index a52f14952..e9f6d386f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/connect.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/connect.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>connect(fd, addr, length) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/copy_file_range.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/copy_file_range.asm index 98554b265..10705cf05 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/copy_file_range.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/copy_file_range.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>copy_file_range(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/creat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/creat.asm index 960f62087..b60173160 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/creat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/creat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>creat(file, mode) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/create_module.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/create_module.asm index 945cf2416..61db44cb1 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/create_module.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/create_module.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>create_module(name, size) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/delete_module.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/delete_module.asm index 922a3d06d..4e2e3dc31 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/delete_module.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/delete_module.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>delete_module(name) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/dup.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/dup.asm index 60b0d8b05..d5711e282 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/dup.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/dup.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>dup(fd) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/dup2.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/dup2.asm index f235bc3b4..9d3f79d7d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/dup2.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/dup2.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>dup2(fd, fd2) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/dup3.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/dup3.asm index e5f64888e..e85d14515 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/dup3.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/dup3.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>dup3(fd, fd2, flags) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_create.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_create.asm index a5fa95d3d..c4be353b4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_create.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_create.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>epoll_create(size) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_create1.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_create1.asm index aa174e1d8..ebe40f5fb 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_create1.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_create1.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>epoll_create1(flags) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_ctl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_ctl.asm index 09a3bcf98..5152052b4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_ctl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_ctl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>epoll_ctl(epfd, op, fd, event) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_ctl_old.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_ctl_old.asm index a90c18ac8..bccf9e185 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_ctl_old.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_ctl_old.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>epoll_ctl_old(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_pwait.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_pwait.asm index fd8e87fc0..57d85e000 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_pwait.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_pwait.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>epoll_pwait(epfd, events, maxevents, timeout, ss) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_pwait2.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_pwait2.asm index a06777704..175cfa104 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_pwait2.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_pwait2.asm @@ -1,11 +1,11 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> -<%docstring>epoll_pwait2(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4) -> str +<%docstring>epoll_pwait2(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str Invokes the syscall epoll_pwait2. @@ -16,7 +16,7 @@ Arguments: Returns: long -<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None"/> +<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None, vararg_5=None"/> <% abi = pwnlib.abi.ABI.syscall() stack = abi.stack @@ -26,8 +26,8 @@ Returns: can_pushstr = [] can_pushstr_array = [] - argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4'] - argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4] + argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4', 'vararg_5'] + argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5] # Load all of the arguments into their destination registers / stack slots. register_arguments = dict() @@ -48,12 +48,12 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[index] = arg + stack_arguments[name] = arg # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg @@ -76,7 +76,7 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[target] = arg + stack_arguments[name] = arg # Some syscalls have different names on various architectures. # Determine which syscall number to use for the current architecture. @@ -84,7 +84,7 @@ Returns: if hasattr(pwnlib.constants, syscall): break else: - raise Exception("Could not locate any syscalls: %r" % syscalls) + raise Exception("Could not locate any syscalls: %r" % ['SYS_epoll_pwait2']) %> /* epoll_pwait2(${', '.join(syscall_repr)}) */ %for name, arg in string_arguments.items(): diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_wait.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_wait.asm index f6f44ba71..2704f873f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_wait.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_wait.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>epoll_wait(epfd, events, maxevents, timeout) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_wait_old.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_wait_old.asm index 49d2afe21..3caa809ca 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_wait_old.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/epoll_wait_old.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>epoll_wait_old(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/eventfd.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/eventfd.asm index 6291327bb..36fcd6f5a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/eventfd.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/eventfd.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>eventfd(count, flags) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/eventfd2.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/eventfd2.asm index c280701f7..8ad2a42e8 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/eventfd2.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/eventfd2.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>eventfd2(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/execve.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/execve.asm index 56df88bcc..43b0458a9 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/execve.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/execve.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>execve(path, argv, envp) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/execveat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/execveat.asm index 473eee7f0..c2b8c4264 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/execveat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/execveat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>execveat(dirfd, pathname, argv, envp, flags) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/exit.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/exit.asm index 60b8d4a23..16d8b9b61 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/exit.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/exit.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>exit(status) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/exit_group.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/exit_group.asm index f2e5ed35e..a0e180d6c 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/exit_group.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/exit_group.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>exit_group(status) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/faccessat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/faccessat.asm index a1c015538..eceda32fc 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/faccessat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/faccessat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>faccessat(fd, file, type, flag) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/faccessat2.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/faccessat2.asm index 5d6f05d18..0eafe64a7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/faccessat2.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/faccessat2.asm @@ -1,11 +1,11 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> -<%docstring>faccessat2(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4) -> str +<%docstring>faccessat2(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str Invokes the syscall faccessat2. @@ -16,7 +16,7 @@ Arguments: Returns: long -<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None"/> +<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None, vararg_5=None"/> <% abi = pwnlib.abi.ABI.syscall() stack = abi.stack @@ -26,8 +26,8 @@ Returns: can_pushstr = [] can_pushstr_array = [] - argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4'] - argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4] + argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4', 'vararg_5'] + argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5] # Load all of the arguments into their destination registers / stack slots. register_arguments = dict() @@ -48,12 +48,12 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[index] = arg + stack_arguments[name] = arg # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg @@ -76,7 +76,7 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[target] = arg + stack_arguments[name] = arg # Some syscalls have different names on various architectures. # Determine which syscall number to use for the current architecture. @@ -84,7 +84,7 @@ Returns: if hasattr(pwnlib.constants, syscall): break else: - raise Exception("Could not locate any syscalls: %r" % syscalls) + raise Exception("Could not locate any syscalls: %r" % ['SYS_faccessat2']) %> /* faccessat2(${', '.join(syscall_repr)}) */ %for name, arg in string_arguments.items(): diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fadvise64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fadvise64.asm index d364aa019..76dac2355 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fadvise64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fadvise64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fadvise64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fadvise64_64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fadvise64_64.asm index 4d4f99609..a374ff7af 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fadvise64_64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fadvise64_64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fadvise64_64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fallocate.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fallocate.asm index 9a4fae4dc..c6132d0a3 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fallocate.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fallocate.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fallocate(fd, mode, offset, length) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fanotify_init.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fanotify_init.asm index 8e26f9fb5..7a6fd7e2a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fanotify_init.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fanotify_init.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fanotify_init(flags, event_f_flags) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fanotify_mark.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fanotify_mark.asm index 573f017e1..24fcd2fef 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fanotify_mark.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fanotify_mark.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fanotify_mark(fanotify_fd, flags, mask, dfd, pathname) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fchdir.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fchdir.asm index b15b46ae9..cdcdf9646 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fchdir.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fchdir.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fchdir(fd) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fchmod.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fchmod.asm index 1e0f14d42..c12e8eddb 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fchmod.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fchmod.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fchmod(fd, mode) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fchmodat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fchmodat.asm index e1505fafe..2fc52b712 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fchmodat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fchmodat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fchmodat(fd, file, mode, flag) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fchown.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fchown.asm index b7ece230c..55c4fd5b4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fchown.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fchown.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fchown(fd, owner, group) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fchown32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fchown32.asm index 5dd88c2ac..e34a2bfc5 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fchown32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fchown32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fchown32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fchownat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fchownat.asm index ff3b2cef7..423e8a0e2 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fchownat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fchownat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fchownat(fd, file, owner, group, flag) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fcntl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fcntl.asm index 9a51d22fc..a056eb73b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fcntl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fcntl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fcntl(fd, cmd, vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fcntl64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fcntl64.asm index c237bb20e..7e3e044e5 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fcntl64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fcntl64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fcntl64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fdatasync.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fdatasync.asm index 39ed0e3f5..1d32ed1df 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fdatasync.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fdatasync.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fdatasync(fildes) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fgetxattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fgetxattr.asm index 804d7dd04..7bf41a574 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fgetxattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fgetxattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fgetxattr(fd, name, value, size) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/finit_module.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/finit_module.asm index 645f36f8a..204ac1978 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/finit_module.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/finit_module.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>finit_module(fd, param_values, flags) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/flistxattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/flistxattr.asm index 4e0bd4f7f..b86006498 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/flistxattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/flistxattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>flistxattr(fd, list, size) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/flock.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/flock.asm index 3670f5a42..8719d6a59 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/flock.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/flock.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>flock(fd, operation) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fork.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fork.asm index dedebd9ca..23f0e23ca 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fork.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fork.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fork() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fremovexattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fremovexattr.asm index 019d6752e..c05c49ad7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fremovexattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fremovexattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fremovexattr(fd, name) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fsconfig.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fsconfig.asm index 80bb5882e..da16decd8 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fsconfig.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fsconfig.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fsconfig(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fsetxattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fsetxattr.asm index 8ea87914c..fff9d0c24 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fsetxattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fsetxattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fsetxattr(fd, name, value, size, flags) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fsmount.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fsmount.asm index 5b9c1c2e3..52386947e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fsmount.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fsmount.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fsmount(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fsopen.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fsopen.asm index fe1ea366e..04709419a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fsopen.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fsopen.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fsopen(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fspick.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fspick.asm index e415cb9e7..4c890ed83 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fspick.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fspick.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fspick(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fstat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fstat.asm index 62b18ab5f..d7e31487f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fstat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fstat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fstat(fd, buf) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fstat64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fstat64.asm index 610dbcaee..937698853 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fstat64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fstat64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fstat64(fd, buf) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fstatat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fstatat.asm index 9996e8bdd..efa345a81 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fstatat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fstatat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fstatat(fd, file, buf, flag) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fstatat64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fstatat64.asm index 1ba1bd221..d31c2455c 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fstatat64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fstatat64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fstatat64(fd, file, buf, flag) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fstatfs.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fstatfs.asm index 36b4f7ff9..aefded3fe 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fstatfs.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fstatfs.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fstatfs(fildes, buf) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fstatfs64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fstatfs64.asm index 9f353280b..dfe0c9842 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fstatfs64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fstatfs64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fstatfs64(fildes, buf) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/fsync.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/fsync.asm index ef0d54195..04cd60ac4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/fsync.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/fsync.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>fsync(fd) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ftime.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ftime.asm index 60648689a..5332a6c55 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ftime.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ftime.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ftime(timebuf) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ftruncate.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ftruncate.asm index f8fe31d3f..81ca30945 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ftruncate.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ftruncate.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ftruncate(fd, length) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ftruncate64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ftruncate64.asm index 0b0a56a76..35d47afa4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ftruncate64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ftruncate64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ftruncate64(fd, length) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/futex.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/futex.asm index 6512f2fd2..d0161b10e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/futex.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/futex.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>futex(uaddr, futex_op, val, timeout, uaddr2, val3) -> str @@ -57,8 +57,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/futex_time64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/futex_time64.asm index 2aff8eb8d..0f6a3ac44 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/futex_time64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/futex_time64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>futex_time64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/futimesat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/futimesat.asm index 6f8df453d..275cf0ea8 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/futimesat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/futimesat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>futimesat(fd, file, tvp) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/get_kernel_syms.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/get_kernel_syms.asm index 5caafed4d..808fca45d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/get_kernel_syms.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/get_kernel_syms.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>get_kernel_syms(table) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/get_mempolicy.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/get_mempolicy.asm index a9295e468..462bc2826 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/get_mempolicy.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/get_mempolicy.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>get_mempolicy(mode, nodemask, maxnode, addr, flags) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/get_robust_list.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/get_robust_list.asm index 2c86b91ef..dc4b5fe1b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/get_robust_list.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/get_robust_list.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>get_robust_list(pid, head_ptr, len_ptr) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/get_thread_area.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/get_thread_area.asm index 14bb85b4f..019ccd7ff 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/get_thread_area.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/get_thread_area.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>get_thread_area(u_info) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getcpu.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getcpu.asm index 02f86d445..9b07aef33 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getcpu.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getcpu.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getcpu(cpu, node, tcache) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getcwd.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getcwd.asm index f98346bf3..ab21a10a1 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getcwd.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getcwd.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getcwd(buf, size) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getdents.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getdents.asm index 0a1818af1..4c46a0002 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getdents.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getdents.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getdents(fd, dirp, count) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getdents64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getdents64.asm index ea51af8d0..624c7e766 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getdents64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getdents64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getdents64(fd, dirp, count) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getegid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getegid.asm index f2e01cfc5..92325ba83 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getegid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getegid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getegid() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getegid32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getegid32.asm index fde842aa6..a42da03fc 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getegid32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getegid32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getegid32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/geteuid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/geteuid.asm index ae78ab76d..0b9eab4de 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/geteuid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/geteuid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>geteuid() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/geteuid32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/geteuid32.asm index 2aed2b383..34de0dfbe 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/geteuid32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/geteuid32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>geteuid32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getgid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getgid.asm index 2e800d370..1521a6ab5 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getgid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getgid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getgid() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getgid32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getgid32.asm index 74bb0f55d..7f305f727 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getgid32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getgid32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getgid32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getgroups.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getgroups.asm index 5b8a42ef7..629eed721 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getgroups.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getgroups.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getgroups(size, list) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getgroups32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getgroups32.asm index be2695244..b84b853c7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getgroups32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getgroups32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getgroups32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getitimer.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getitimer.asm index 8f40e60ed..9b3740286 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getitimer.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getitimer.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getitimer(which, value) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getpeername.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getpeername.asm index f9a0ea4ed..fcdd0a307 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getpeername.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getpeername.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getpeername(fd, addr, length) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getpgid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getpgid.asm index 7663b2885..50ebd4720 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getpgid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getpgid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getpgid(pid) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getpgrp.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getpgrp.asm index 6b39026c0..a0282c14f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getpgrp.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getpgrp.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getpgrp() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getpid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getpid.asm index 60b16f950..5fc3701a3 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getpid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getpid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getpid() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getpmsg.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getpmsg.asm index db65c32db..fc9e20674 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getpmsg.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getpmsg.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getpmsg(fildes, ctlptr, dataptr, bandp, flagsp) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getppid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getppid.asm index 0d5328462..7610341b0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getppid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getppid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getppid() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getpriority.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getpriority.asm index 8087531ef..9f0e611f5 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getpriority.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getpriority.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getpriority(which, who) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getrandom.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getrandom.asm index 67aa065c3..39107040f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getrandom.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getrandom.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getrandom(buf, buflen, flags) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getresgid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getresgid.asm index 7dbf29dfc..44c14efe7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getresgid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getresgid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getresgid(rgid, egid, sgid) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getresgid32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getresgid32.asm index f44acdb4f..ab69bbad5 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getresgid32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getresgid32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getresgid32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getresuid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getresuid.asm index 88bfbf3db..9c0019ab4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getresuid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getresuid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getresuid(ruid, euid, suid) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getresuid32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getresuid32.asm index ee04bbdbd..e7322b349 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getresuid32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getresuid32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getresuid32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getrlimit.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getrlimit.asm index 9ad22fffe..0d5244343 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getrlimit.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getrlimit.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getrlimit(resource, rlimits) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getrusage.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getrusage.asm index bee4d43f6..b9b62a2e6 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getrusage.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getrusage.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getrusage(who, usage) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getsid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getsid.asm index 07a0f6bc9..ff5362030 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getsid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getsid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getsid(pid) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getsockname.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getsockname.asm index b2334aa11..05f1cbbd0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getsockname.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getsockname.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getsockname(fd, addr, length) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getsockopt.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getsockopt.asm index c8f07d5e3..b25b01e79 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getsockopt.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getsockopt.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getsockopt(fd, level, optname, optval, optlen) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/gettid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/gettid.asm index da4575ba2..1488caecf 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/gettid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/gettid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>gettid() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/gettimeofday.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/gettimeofday.asm index 7be2da334..f875cb8b5 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/gettimeofday.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/gettimeofday.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>gettimeofday(tv, tz) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getuid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getuid.asm index 69c3a0b5c..8a4c98426 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getuid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getuid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getuid() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getuid32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getuid32.asm index 9f9dc2dfb..1a07613a6 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getuid32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getuid32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getuid32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/getxattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/getxattr.asm index 74c9b57a2..0536657cd 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/getxattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/getxattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>getxattr(path, name, value, size) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/gtty.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/gtty.asm index 33eacdcb6..f7de16d19 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/gtty.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/gtty.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>gtty(fd, params) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_arch_prctl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_arch_prctl.asm index 189916cce..75cf529a8 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_arch_prctl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_arch_prctl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ia32_arch_prctl(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_io_pgetevents.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_io_pgetevents.asm index 4b6955231..2e43aeeb4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_io_pgetevents.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_io_pgetevents.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ia32_io_pgetevents(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_rseq.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_rseq.asm index b6c1e2ae2..cecc10f06 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_rseq.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_rseq.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ia32_rseq(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_statx.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_statx.asm index e4102c40b..a1fec2f91 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_statx.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ia32_statx.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ia32_statx(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/idle.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/idle.asm index 3b95bd578..ac2c7f552 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/idle.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/idle.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>idle() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/init_module.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/init_module.asm index fd9f99455..f81379256 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/init_module.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/init_module.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>init_module(name, image) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_add_watch.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_add_watch.asm index 4475ac40a..e9b29d6b2 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_add_watch.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_add_watch.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>inotify_add_watch(fd, name, mask) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_init.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_init.asm index 50ecf6f6b..344e2e05f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_init.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_init.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>inotify_init() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_init1.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_init1.asm index 438d17a1a..05a57efa4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_init1.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_init1.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>inotify_init1(flags) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_rm_watch.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_rm_watch.asm index 0dcf795ae..e5e409054 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_rm_watch.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/inotify_rm_watch.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>inotify_rm_watch(fd, wd) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/io_cancel.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/io_cancel.asm index 1a058fea9..cc4201986 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/io_cancel.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/io_cancel.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>io_cancel(ctx_id, iocb, result) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/io_destroy.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/io_destroy.asm index d2227f9da..906e28840 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/io_destroy.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/io_destroy.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>io_destroy(ctx_id) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/io_getevents.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/io_getevents.asm index 45e5309e5..d34b524da 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/io_getevents.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/io_getevents.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>io_getevents(ctx_id, min_nr, nr, events, timeout) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/io_pgetevents.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/io_pgetevents.asm index bd04fa70d..b0d13fc83 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/io_pgetevents.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/io_pgetevents.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>io_pgetevents(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/io_pgetevents_time64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/io_pgetevents_time64.asm index a710c44d8..28d22b0f0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/io_pgetevents_time64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/io_pgetevents_time64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>io_pgetevents_time64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/io_setup.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/io_setup.asm index d1b89c2f0..ba66169d3 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/io_setup.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/io_setup.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>io_setup(nr_events, ctx_idp) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/io_submit.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/io_submit.asm index 3d7ee9386..939adcb9a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/io_submit.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/io_submit.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>io_submit(ctx_id, nr, iocbpp) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/io_uring_enter.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/io_uring_enter.asm index fd6c60c5f..7414b0393 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/io_uring_enter.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/io_uring_enter.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>io_uring_enter(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/io_uring_register.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/io_uring_register.asm index 1e8fbe0b9..7357ccb38 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/io_uring_register.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/io_uring_register.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>io_uring_register(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/io_uring_setup.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/io_uring_setup.asm index 80038170f..97532ea1d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/io_uring_setup.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/io_uring_setup.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>io_uring_setup(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ioctl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ioctl.asm index 5d6ddf920..366748092 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ioctl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ioctl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ioctl(fd, request, vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ioperm.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ioperm.asm index b07f0ff1b..4ff6036d6 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ioperm.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ioperm.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ioperm(from_, num, turn_on) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/iopl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/iopl.asm index e3a906816..96902ca1b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/iopl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/iopl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>iopl(level) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ioprio_get.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ioprio_get.asm index 8115fddd5..6c38e513a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ioprio_get.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ioprio_get.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ioprio_get(which, who) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ioprio_set.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ioprio_set.asm index e0e84503d..503fedee9 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ioprio_set.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ioprio_set.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ioprio_set(which, who, ioprio) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ipc.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ipc.asm index 0fe71e4e1..56f5c1575 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ipc.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ipc.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ipc(call, first, second, third, ptr, fifth) -> str @@ -57,8 +57,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/kcmp.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/kcmp.asm index 5dccefea3..671638f17 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/kcmp.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/kcmp.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>kcmp(pid1, pid2, type, idx1, idx2) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/kexec_file_load.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/kexec_file_load.asm index bc839851d..7fbb05073 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/kexec_file_load.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/kexec_file_load.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>kexec_file_load(kernel_fd, initrd_fd, cmdline_len, cmdline, flags) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/kexec_load.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/kexec_load.asm index 92820b487..fb8214b10 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/kexec_load.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/kexec_load.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>kexec_load(entry, nr_segments, segments, flags) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/keyctl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/keyctl.asm index 77603e94b..3b090f99e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/keyctl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/keyctl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>keyctl(cmd, vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/kill.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/kill.asm index 05a1ca3be..f17201398 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/kill.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/kill.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>kill(pid, sig) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/landlock_add_rule.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/landlock_add_rule.asm index 920d91e97..84d52dd1e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/landlock_add_rule.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/landlock_add_rule.asm @@ -1,11 +1,11 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> -<%docstring>landlock_add_rule(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4) -> str +<%docstring>landlock_add_rule(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str Invokes the syscall landlock_add_rule. @@ -16,7 +16,7 @@ Arguments: Returns: long -<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None"/> +<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None, vararg_5=None"/> <% abi = pwnlib.abi.ABI.syscall() stack = abi.stack @@ -26,8 +26,8 @@ Returns: can_pushstr = [] can_pushstr_array = [] - argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4'] - argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4] + argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4', 'vararg_5'] + argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5] # Load all of the arguments into their destination registers / stack slots. register_arguments = dict() @@ -48,12 +48,12 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[index] = arg + stack_arguments[name] = arg # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg @@ -76,7 +76,7 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[target] = arg + stack_arguments[name] = arg # Some syscalls have different names on various architectures. # Determine which syscall number to use for the current architecture. @@ -84,7 +84,7 @@ Returns: if hasattr(pwnlib.constants, syscall): break else: - raise Exception("Could not locate any syscalls: %r" % syscalls) + raise Exception("Could not locate any syscalls: %r" % ['SYS_landlock_add_rule']) %> /* landlock_add_rule(${', '.join(syscall_repr)}) */ %for name, arg in string_arguments.items(): diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/landlock_create_ruleset.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/landlock_create_ruleset.asm index 179d2f7f7..aaa28192c 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/landlock_create_ruleset.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/landlock_create_ruleset.asm @@ -1,11 +1,11 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> -<%docstring>landlock_create_ruleset(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4) -> str +<%docstring>landlock_create_ruleset(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str Invokes the syscall landlock_create_ruleset. @@ -16,7 +16,7 @@ Arguments: Returns: long -<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None"/> +<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None, vararg_5=None"/> <% abi = pwnlib.abi.ABI.syscall() stack = abi.stack @@ -26,8 +26,8 @@ Returns: can_pushstr = [] can_pushstr_array = [] - argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4'] - argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4] + argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4', 'vararg_5'] + argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5] # Load all of the arguments into their destination registers / stack slots. register_arguments = dict() @@ -48,12 +48,12 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[index] = arg + stack_arguments[name] = arg # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg @@ -76,7 +76,7 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[target] = arg + stack_arguments[name] = arg # Some syscalls have different names on various architectures. # Determine which syscall number to use for the current architecture. @@ -84,7 +84,7 @@ Returns: if hasattr(pwnlib.constants, syscall): break else: - raise Exception("Could not locate any syscalls: %r" % syscalls) + raise Exception("Could not locate any syscalls: %r" % ['SYS_landlock_create_ruleset']) %> /* landlock_create_ruleset(${', '.join(syscall_repr)}) */ %for name, arg in string_arguments.items(): diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/landlock_restrict_self.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/landlock_restrict_self.asm index 0a138bcc2..4a71d8acf 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/landlock_restrict_self.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/landlock_restrict_self.asm @@ -1,11 +1,11 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> -<%docstring>landlock_restrict_self(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4) -> str +<%docstring>landlock_restrict_self(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str Invokes the syscall landlock_restrict_self. @@ -16,7 +16,7 @@ Arguments: Returns: long -<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None"/> +<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None, vararg_5=None"/> <% abi = pwnlib.abi.ABI.syscall() stack = abi.stack @@ -26,8 +26,8 @@ Returns: can_pushstr = [] can_pushstr_array = [] - argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4'] - argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4] + argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4', 'vararg_5'] + argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5] # Load all of the arguments into their destination registers / stack slots. register_arguments = dict() @@ -48,12 +48,12 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[index] = arg + stack_arguments[name] = arg # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg @@ -76,7 +76,7 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[target] = arg + stack_arguments[name] = arg # Some syscalls have different names on various architectures. # Determine which syscall number to use for the current architecture. @@ -84,7 +84,7 @@ Returns: if hasattr(pwnlib.constants, syscall): break else: - raise Exception("Could not locate any syscalls: %r" % syscalls) + raise Exception("Could not locate any syscalls: %r" % ['SYS_landlock_restrict_self']) %> /* landlock_restrict_self(${', '.join(syscall_repr)}) */ %for name, arg in string_arguments.items(): diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/lchown.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/lchown.asm index 1698624ac..aa0c21ec9 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/lchown.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/lchown.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>lchown(file, owner, group) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/lchown32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/lchown32.asm index 768ab6604..657fb6e01 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/lchown32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/lchown32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>lchown32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/lgetxattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/lgetxattr.asm index 8917d528d..d558d153d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/lgetxattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/lgetxattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>lgetxattr(path, name, value, size) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/link.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/link.asm index e334411be..53645e24b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/link.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/link.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>link(from_, to) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/linkat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/linkat.asm index d297b2a6f..8b5cec9df 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/linkat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/linkat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>linkat(fromfd, from_, tofd, to, flags) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/listen.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/listen.asm index 27e653036..e92eece37 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/listen.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/listen.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>listen(fd, n) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/listxattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/listxattr.asm index f5759491b..9e1acdceb 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/listxattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/listxattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>listxattr(path, list, size) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/llistxattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/llistxattr.asm index e88e1e05c..32b93ab41 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/llistxattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/llistxattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>llistxattr(path, list, size) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/lock.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/lock.asm index db1075cbc..bcae2a859 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/lock.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/lock.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>lock(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/lookup_dcookie.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/lookup_dcookie.asm index 3413214a1..09502d4fe 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/lookup_dcookie.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/lookup_dcookie.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>lookup_dcookie(cookie, buffer, length) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/lremovexattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/lremovexattr.asm index 58a8ad722..a489edf0a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/lremovexattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/lremovexattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>lremovexattr(path, name) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/lseek.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/lseek.asm index f367e155f..71ecdeaa0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/lseek.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/lseek.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>lseek(fd, offset, whence) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/lsetxattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/lsetxattr.asm index f7956d934..f749be612 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/lsetxattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/lsetxattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>lsetxattr(path, name, value, size, flags) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/lstat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/lstat.asm index 9bb908cd6..bb7b52f70 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/lstat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/lstat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>lstat(file, buf) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/lstat64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/lstat64.asm index b03993f28..98c19b5e3 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/lstat64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/lstat64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>lstat64(file, buf) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/madvise.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/madvise.asm index 622c4666c..de9e3f719 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/madvise.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/madvise.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>madvise(addr, length, advice) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/madvise1.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/madvise1.asm index d9e067a34..26cfe31d7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/madvise1.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/madvise1.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>madvise1(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mbind.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mbind.asm index c5b8ee210..22e05a434 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mbind.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mbind.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mbind(addr, length, mode, nodemask, maxnode, flags) -> str @@ -57,8 +57,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/membarrier.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/membarrier.asm index 6dc94e17d..9c3a1832f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/membarrier.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/membarrier.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>membarrier(cmd, flags) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/memfd_create.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/memfd_create.asm index 63cbd15db..5d49ebc25 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/memfd_create.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/memfd_create.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>memfd_create(name, flags) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/migrate_pages.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/migrate_pages.asm index 56b1d95a5..1c89ac92e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/migrate_pages.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/migrate_pages.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>migrate_pages(pid, maxnode, old_nodes, new_nodes) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mincore.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mincore.asm index f11c171ad..f5994e94d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mincore.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mincore.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mincore(start, length, vec) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mkdir.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mkdir.asm index 6d4184054..841196f05 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mkdir.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mkdir.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mkdir(path, mode) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mkdirat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mkdirat.asm index ad58eb582..aa31096dd 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mkdirat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mkdirat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mkdirat(fd, path, mode) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mknod.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mknod.asm index ea011bae8..c9a73b22d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mknod.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mknod.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mknod(path, mode, dev) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mknodat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mknodat.asm index 283b824a3..e6a39f0d7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mknodat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mknodat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mknodat(fd, path, mode, dev) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mlock.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mlock.asm index a033065a8..43bf32c88 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mlock.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mlock.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mlock(addr, length) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mlock2.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mlock2.asm index 8ee17fefe..dd312d06f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mlock2.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mlock2.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mlock2(addr, length, flags) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mlockall.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mlockall.asm index 92cbe1a00..2ed0ac691 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mlockall.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mlockall.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mlockall(flags) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mmap.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mmap.asm index 266bb7df5..bbd7932f0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mmap.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mmap.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mmap(addr, length, prot, flags, fd, offset) -> str @@ -57,8 +57,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mmap2.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mmap2.asm index b510af4c0..746486803 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mmap2.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mmap2.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mmap2(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/modify_ldt.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/modify_ldt.asm index d1f7e1f1d..3add61ad2 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/modify_ldt.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/modify_ldt.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>modify_ldt(func, ptr, bytecount) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mount.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mount.asm index 4b8edba80..a1aa2226e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mount.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mount.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mount(special_file, dir, fstype, rwflag, data) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mount_setattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mount_setattr.asm index 33cc2f5af..2e4c2aecc 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mount_setattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mount_setattr.asm @@ -1,11 +1,11 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> -<%docstring>mount_setattr(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4) -> str +<%docstring>mount_setattr(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str Invokes the syscall mount_setattr. @@ -16,7 +16,7 @@ Arguments: Returns: long -<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None"/> +<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None, vararg_5=None"/> <% abi = pwnlib.abi.ABI.syscall() stack = abi.stack @@ -26,8 +26,8 @@ Returns: can_pushstr = [] can_pushstr_array = [] - argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4'] - argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4] + argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4', 'vararg_5'] + argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5] # Load all of the arguments into their destination registers / stack slots. register_arguments = dict() @@ -48,12 +48,12 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[index] = arg + stack_arguments[name] = arg # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg @@ -76,7 +76,7 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[target] = arg + stack_arguments[name] = arg # Some syscalls have different names on various architectures. # Determine which syscall number to use for the current architecture. @@ -84,7 +84,7 @@ Returns: if hasattr(pwnlib.constants, syscall): break else: - raise Exception("Could not locate any syscalls: %r" % syscalls) + raise Exception("Could not locate any syscalls: %r" % ['SYS_mount_setattr']) %> /* mount_setattr(${', '.join(syscall_repr)}) */ %for name, arg in string_arguments.items(): diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/move_mount.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/move_mount.asm index df5d0474c..8e4609dce 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/move_mount.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/move_mount.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>move_mount(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/move_pages.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/move_pages.asm index 2642cd97e..7c5bf0ea7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/move_pages.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/move_pages.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>move_pages(pid, count, pages, nodes, status, flags) -> str @@ -57,8 +57,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mprotect.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mprotect.asm index 9a17360d0..123f02216 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mprotect.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mprotect.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mprotect(addr, length, prot) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mpx.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mpx.asm index 9cf1c128d..01fa857ff 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mpx.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mpx.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mpx(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_getsetattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_getsetattr.asm index fd25c20f6..e1b1e0dca 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_getsetattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_getsetattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mq_getsetattr(mqdes, newattr, oldattr) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_notify.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_notify.asm index 0173bd900..b221e7bc5 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_notify.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_notify.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mq_notify(mqdes, notification) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_open.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_open.asm index d01e5c367..a77e0b846 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_open.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_open.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mq_open(name, oflag, vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedreceive.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedreceive.asm index 9923b112f..e99d07ab4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedreceive.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedreceive.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mq_timedreceive(mqdes, msg_ptr, msg_len, msg_prio, abs_timeout) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedreceive_time64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedreceive_time64.asm index 547189127..fdb617e01 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedreceive_time64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedreceive_time64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mq_timedreceive_time64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedsend.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedsend.asm index 0d955e259..ec68adf25 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedsend.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedsend.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mq_timedsend(mqdes, msg_ptr, msg_len, msg_prio, abs_timeout) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedsend_time64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedsend_time64.asm index 7d8f3dc76..51b288bcb 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedsend_time64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_timedsend_time64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mq_timedsend_time64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_unlink.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_unlink.asm index 210664eac..cb6a3dd4e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mq_unlink.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mq_unlink.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mq_unlink(name) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/mremap.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/mremap.asm index 68c3312ef..b7a49c46d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/mremap.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/mremap.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>mremap(addr, old_len, new_len, flags, vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/msgctl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/msgctl.asm index 4ea7f03be..34ba959b4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/msgctl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/msgctl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>msgctl(msqid, cmd, buf) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/msgget.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/msgget.asm index 56a6debb1..224db3891 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/msgget.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/msgget.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>msgget(key, msgflg) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/msgrcv.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/msgrcv.asm index adcb1b2f7..3848b9202 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/msgrcv.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/msgrcv.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>msgrcv(msqid, msgp, msgsz, msgtyp, msgflg) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/msgsnd.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/msgsnd.asm index 9656f0c3f..c23d09e50 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/msgsnd.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/msgsnd.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>msgsnd(msqid, msgp, msgsz, msgflg) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/msync.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/msync.asm index 7e7bd2247..333deadca 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/msync.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/msync.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>msync(addr, length, flags) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/multiplexer.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/multiplexer.asm new file mode 100644 index 000000000..d81e734cf --- /dev/null +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/multiplexer.asm @@ -0,0 +1,101 @@ +<% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! +import collections +import pwnlib.abi +import pwnlib.constants +import pwnlib.shellcraft +%> +<%docstring>multiplexer(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str + +Invokes the syscall multiplexer. + +See 'man 2 multiplexer' for more information. + +Arguments: + vararg(int): vararg +Returns: + long + +<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None, vararg_5=None"/> +<% + abi = pwnlib.abi.ABI.syscall() + stack = abi.stack + regs = abi.register_arguments[1:] + allregs = pwnlib.shellcraft.registers.current() + + can_pushstr = [] + can_pushstr_array = [] + + argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4', 'vararg_5'] + argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5] + + # Load all of the arguments into their destination registers / stack slots. + register_arguments = dict() + stack_arguments = collections.OrderedDict() + string_arguments = dict() + dict_arguments = dict() + array_arguments = dict() + syscall_repr = [] + + for name, arg in zip(argument_names, argument_values): + if arg is not None: + syscall_repr.append('%s=%s' % (name, pwnlib.shellcraft.pretty(arg, False))) + + # If the argument itself (input) is a register... + if arg in allregs: + index = argument_names.index(name) + if index < len(regs): + target = regs[index] + register_arguments[target] = arg + elif arg is not None: + stack_arguments[name] = arg + + # The argument is not a register. It is a string value, and we + # are expecting a string value + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): + arg = arg.encode('utf-8') + string_arguments[name] = arg + + # The argument is not a register. It is a dictionary, and we are + # expecting K:V paris. + elif name in can_pushstr_array and isinstance(arg, dict): + array_arguments[name] = ['%s=%s' % (k,v) for (k,v) in arg.items()] + + # The arguent is not a register. It is a list, and we are expecting + # a list of arguments. + elif name in can_pushstr_array and isinstance(arg, (list, tuple)): + array_arguments[name] = arg + + # The argument is not a register, string, dict, or list. + # It could be a constant string ('O_RDONLY') for an integer argument, + # an actual integer value, or a constant. + else: + index = argument_names.index(name) + if index < len(regs): + target = regs[index] + register_arguments[target] = arg + elif arg is not None: + stack_arguments[name] = arg + + # Some syscalls have different names on various architectures. + # Determine which syscall number to use for the current architecture. + for syscall in ['SYS_multiplexer']: + if hasattr(pwnlib.constants, syscall): + break + else: + raise Exception("Could not locate any syscalls: %r" % ['SYS_multiplexer']) +%> + /* multiplexer(${', '.join(syscall_repr)}) */ +%for name, arg in string_arguments.items(): + ${pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))} + ${pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)} +%endfor +%for name, arg in array_arguments.items(): + ${pwnlib.shellcraft.pushstr_array(regs[argument_names.index(name)], arg)} +%endfor +%for name, arg in stack_arguments.items(): + ${pwnlib.shellcraft.push(arg)} +%endfor + ${pwnlib.shellcraft.setregs(register_arguments)} + ${pwnlib.shellcraft.syscall(syscall)} diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/munlock.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/munlock.asm index ce5e529bb..b478c551f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/munlock.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/munlock.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>munlock(addr, length) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/munlockall.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/munlockall.asm index 89c2cb620..6eaf69e55 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/munlockall.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/munlockall.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>munlockall() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/munmap.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/munmap.asm index 9fe5f2022..92e14930d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/munmap.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/munmap.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>munmap(addr, length) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/name_to_handle_at.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/name_to_handle_at.asm index 5890a006e..5094dd0ad 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/name_to_handle_at.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/name_to_handle_at.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>name_to_handle_at(dfd, name, handle, mnt_id, flags) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/nanosleep.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/nanosleep.asm index 7605a85b5..5e9366217 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/nanosleep.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/nanosleep.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>nanosleep(requested_time, remaining) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/newfstatat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/newfstatat.asm index caac21dbc..a106f7a8f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/newfstatat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/newfstatat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>newfstatat(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/nfsservctl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/nfsservctl.asm index 0e703ef4c..2ed2dd833 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/nfsservctl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/nfsservctl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>nfsservctl(cmd, argp, resp) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/nice.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/nice.asm index 50f1698e2..653d0d1ad 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/nice.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/nice.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>nice(inc) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/oldfstat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/oldfstat.asm index f6e6e8c65..5e2beeedc 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/oldfstat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/oldfstat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>oldfstat(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/oldlstat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/oldlstat.asm index 630e68a0c..19422950b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/oldlstat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/oldlstat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>oldlstat(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/oldolduname.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/oldolduname.asm index edd8ba6cc..0a5bc135e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/oldolduname.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/oldolduname.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>oldolduname(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/oldstat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/oldstat.asm index eb6cdb9cf..42c4bd56e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/oldstat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/oldstat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>oldstat(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/olduname.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/olduname.asm index 0b64e97c8..d7f321855 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/olduname.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/olduname.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>olduname(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/open.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/open.asm index 297ee9488..04115bffd 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/open.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/open.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>open(file, oflag, mode) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/open_by_handle_at.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/open_by_handle_at.asm index ace6e8874..688de7af1 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/open_by_handle_at.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/open_by_handle_at.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>open_by_handle_at(mountdirfd, handle, flags) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/open_tree.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/open_tree.asm index 39360db42..493a07644 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/open_tree.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/open_tree.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>open_tree(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/openat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/openat.asm index bb4c119fc..059f1f9de 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/openat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/openat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>openat(fd, file, oflag, vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/openat2.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/openat2.asm index b32d8b148..7d412e657 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/openat2.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/openat2.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>openat2(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pause.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pause.asm index ede24fab7..d62d43c13 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pause.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pause.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pause() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pciconfig_iobase.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pciconfig_iobase.asm index f9e95552c..2ee0edc05 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pciconfig_iobase.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pciconfig_iobase.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pciconfig_iobase(which, bus, devfn) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pciconfig_read.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pciconfig_read.asm index f43526b18..09f550a13 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pciconfig_read.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pciconfig_read.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pciconfig_read(bus, dfn, off, length, buf) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pciconfig_write.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pciconfig_write.asm index 866f30c52..479c439c5 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pciconfig_write.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pciconfig_write.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pciconfig_write(bus, dfn, off, length, buf) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/perf_event_open.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/perf_event_open.asm index 963e5065f..3feb197ae 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/perf_event_open.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/perf_event_open.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>perf_event_open(attr, pid, cpu, group_fd, flags) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/personality.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/personality.asm index 8337eaef9..e2c347215 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/personality.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/personality.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>personality(persona) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pidfd_getfd.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pidfd_getfd.asm index 0ae267b6b..bd05ac068 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pidfd_getfd.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pidfd_getfd.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pidfd_getfd(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pidfd_open.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pidfd_open.asm index cbc72413d..40db93fc1 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pidfd_open.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pidfd_open.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pidfd_open(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pidfd_send_signal.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pidfd_send_signal.asm index aa7a169d5..a0b413c1a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pidfd_send_signal.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pidfd_send_signal.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pidfd_send_signal(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pipe.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pipe.asm index 1872488ba..73f3cddcd 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pipe.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pipe.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pipe(pipedes) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pipe2.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pipe2.asm index 40ac96098..de1e300fc 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pipe2.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pipe2.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pipe2(pipedes, flags) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pivot_root.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pivot_root.asm index 4fb910f08..d96e9cbb3 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pivot_root.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pivot_root.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pivot_root(new_root, put_old) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pkey_alloc.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pkey_alloc.asm index bd8a8d53a..c2d198abd 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pkey_alloc.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pkey_alloc.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pkey_alloc(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pkey_free.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pkey_free.asm index e105aff82..133ee9095 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pkey_free.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pkey_free.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pkey_free(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pkey_mprotect.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pkey_mprotect.asm index e1d04165d..cc15fdc4f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pkey_mprotect.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pkey_mprotect.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pkey_mprotect(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/poll.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/poll.asm index c5dfdfd86..da8281f54 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/poll.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/poll.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>poll(fds, nfds, timeout) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ppoll.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ppoll.asm index 0cdae7946..bb0be39ee 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ppoll.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ppoll.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ppoll(fds, nfds, timeout, ss) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ppoll_time64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ppoll_time64.asm index e21ad0f1e..53b6510e7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ppoll_time64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ppoll_time64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ppoll_time64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/prctl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/prctl.asm index 7b803fa16..3aacf2bea 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/prctl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/prctl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>prctl(option, vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pread.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pread.asm index 621493ead..57567bb39 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pread.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pread.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pread(fd, buf, nbytes, offset) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pread64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pread64.asm index b18fcd3db..2b31f7b78 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pread64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pread64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pread64(fd, buf, nbytes, offset) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/preadv.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/preadv.asm index b008afdbf..c92d481b1 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/preadv.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/preadv.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>preadv(fd, iovec, count, offset) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/preadv2.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/preadv2.asm index dfeb1ee86..d19f5f358 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/preadv2.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/preadv2.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>preadv2(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/prlimit64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/prlimit64.asm index 3ee6c82b8..5795f0e18 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/prlimit64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/prlimit64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>prlimit64(pid, resource, new_limit, old_limit) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/process_madvise.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/process_madvise.asm index 6a6357a2c..b3af59569 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/process_madvise.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/process_madvise.asm @@ -1,11 +1,11 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> -<%docstring>process_madvise(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4) -> str +<%docstring>process_madvise(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str Invokes the syscall process_madvise. @@ -16,7 +16,7 @@ Arguments: Returns: long -<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None"/> +<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None, vararg_5=None"/> <% abi = pwnlib.abi.ABI.syscall() stack = abi.stack @@ -26,8 +26,8 @@ Returns: can_pushstr = [] can_pushstr_array = [] - argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4'] - argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4] + argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4', 'vararg_5'] + argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5] # Load all of the arguments into their destination registers / stack slots. register_arguments = dict() @@ -48,12 +48,12 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[index] = arg + stack_arguments[name] = arg # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg @@ -76,7 +76,7 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[target] = arg + stack_arguments[name] = arg # Some syscalls have different names on various architectures. # Determine which syscall number to use for the current architecture. @@ -84,7 +84,7 @@ Returns: if hasattr(pwnlib.constants, syscall): break else: - raise Exception("Could not locate any syscalls: %r" % syscalls) + raise Exception("Could not locate any syscalls: %r" % ['SYS_process_madvise']) %> /* process_madvise(${', '.join(syscall_repr)}) */ %for name, arg in string_arguments.items(): diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/process_vm_readv.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/process_vm_readv.asm index 338b4751f..f9d3a2628 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/process_vm_readv.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/process_vm_readv.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>process_vm_readv(pid, lvec, liovcnt, rvec, riovcnt, flags) -> str @@ -57,8 +57,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/process_vm_writev.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/process_vm_writev.asm index d621ea8ef..0ce517fc0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/process_vm_writev.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/process_vm_writev.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>process_vm_writev(pid, lvec, liovcnt, rvec, riovcnt, flags) -> str @@ -57,8 +57,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/prof.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/prof.asm index ff04c92a9..1c3f599b9 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/prof.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/prof.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>prof(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/profil.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/profil.asm index 4fdf729c8..caa929952 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/profil.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/profil.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>profil(sample_buffer, size, offset, scale) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pselect6.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pselect6.asm index bf3c0066c..33fa2f6d3 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pselect6.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pselect6.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pselect6(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pselect6_time64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pselect6_time64.asm index c7d657798..43f4fa34a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pselect6_time64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pselect6_time64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pselect6_time64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ptrace.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ptrace.asm index bb145c804..48270cdae 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ptrace.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ptrace.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ptrace(request, vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/putpmsg.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/putpmsg.asm index 566e21649..57eb29a1e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/putpmsg.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/putpmsg.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>putpmsg(fildes, ctlptr, dataptr, band, flags) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pwrite.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pwrite.asm index bf3c03cc6..39ba9b742 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pwrite.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pwrite.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pwrite(fd, buf, n, offset) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pwrite64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pwrite64.asm index e55e74d72..13e8aeaae 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pwrite64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pwrite64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pwrite64(fd, buf, n, offset) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pwritev.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pwritev.asm index 72bd4aaca..22d70f473 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pwritev.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pwritev.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pwritev(fd, iovec, count, offset) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/pwritev2.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/pwritev2.asm index 2f55f2db6..4276f0987 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/pwritev2.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/pwritev2.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>pwritev2(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/query_module.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/query_module.asm index 17fac6174..edeecb167 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/query_module.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/query_module.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>query_module(name, which, buf, bufsize, ret) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/quotactl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/quotactl.asm index 486c56f51..faeec2503 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/quotactl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/quotactl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>quotactl(cmd, special, id, addr) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/read.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/read.asm index e6df22e8a..d7f285c12 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/read.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/read.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>read(fd, buf, nbytes) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/readahead.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/readahead.asm index 1efe333e3..520721057 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/readahead.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/readahead.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>readahead(fd, offset, count) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/readdir.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/readdir.asm index a776721d5..e3af9d44f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/readdir.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/readdir.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>readdir(dirp) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/readlink.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/readlink.asm index 4c0aadef5..c95e44891 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/readlink.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/readlink.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>readlink(path, buf, length) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/readlinkat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/readlinkat.asm index e8729579e..9fa7e2aa4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/readlinkat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/readlinkat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>readlinkat(fd, path, buf, length) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/readv.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/readv.asm index 5369ca059..16f159342 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/readv.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/readv.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>readv(fd, iovec, count) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/reboot.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/reboot.asm index 6864700d9..13aa123a7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/reboot.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/reboot.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>reboot(howto) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/recv.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/recv.asm index fdc2a03f6..ab49aa4c6 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/recv.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/recv.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>recv(fd, buf, n, flags) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/recvfrom.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/recvfrom.asm index 85621b800..4947dd9a6 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/recvfrom.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/recvfrom.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>recvfrom(fd, buf, n, flags, addr, addr_len) -> str @@ -57,8 +57,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/recvmmsg.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/recvmmsg.asm index ad072d59f..7b1c021df 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/recvmmsg.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/recvmmsg.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>recvmmsg(fd, vmessages, vlen, flags, tmo) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/recvmmsg_time64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/recvmmsg_time64.asm index 05d465111..c5e408e57 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/recvmmsg_time64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/recvmmsg_time64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>recvmmsg_time64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/recvmsg.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/recvmsg.asm index a83867418..aed191e4a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/recvmsg.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/recvmsg.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>recvmsg(fd, message, flags) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/remap_file_pages.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/remap_file_pages.asm index 1cd3d128f..40c60c2bc 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/remap_file_pages.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/remap_file_pages.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>remap_file_pages(start, size, prot, pgoff, flags) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/removexattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/removexattr.asm index 46eff9307..fd8634bc3 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/removexattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/removexattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>removexattr(path, name) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/rename.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/rename.asm index a7d357413..7426ba50f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/rename.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/rename.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>rename(old, new) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/renameat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/renameat.asm index 1d44b10b9..b0e9706e4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/renameat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/renameat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>renameat(oldfd, old, newfd, new) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/renameat2.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/renameat2.asm index 8a7ac1529..4f13a83af 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/renameat2.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/renameat2.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>renameat2(olddirfd, oldpath, newdirfd, newpath, flags) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/request_key.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/request_key.asm index 30daef5a9..1bb88b2c5 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/request_key.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/request_key.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>request_key(type, description, callout_info, keyring) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/reserved221.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/reserved221.asm index acbd67929..12c54ceea 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/reserved221.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/reserved221.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>reserved221(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/reserved82.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/reserved82.asm index fd2d049ed..357daae55 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/reserved82.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/reserved82.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>reserved82(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/restart_syscall.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/restart_syscall.asm index 36f093533..cb55dc9f0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/restart_syscall.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/restart_syscall.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>restart_syscall() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/riscv_flush_icache.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/riscv_flush_icache.asm index 532c6802b..572d11d2b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/riscv_flush_icache.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/riscv_flush_icache.asm @@ -1,11 +1,11 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> -<%docstring>riscv_flush_icache(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4) -> str +<%docstring>riscv_flush_icache(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str Invokes the syscall riscv_flush_icache. @@ -16,7 +16,7 @@ Arguments: Returns: long -<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None"/> +<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None, vararg_5=None"/> <% abi = pwnlib.abi.ABI.syscall() stack = abi.stack @@ -26,8 +26,8 @@ Returns: can_pushstr = [] can_pushstr_array = [] - argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4'] - argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4] + argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4', 'vararg_5'] + argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5] # Load all of the arguments into their destination registers / stack slots. register_arguments = dict() @@ -48,12 +48,12 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[index] = arg + stack_arguments[name] = arg # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg @@ -76,7 +76,7 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[target] = arg + stack_arguments[name] = arg # Some syscalls have different names on various architectures. # Determine which syscall number to use for the current architecture. @@ -84,7 +84,7 @@ Returns: if hasattr(pwnlib.constants, syscall): break else: - raise Exception("Could not locate any syscalls: %r" % syscalls) + raise Exception("Could not locate any syscalls: %r" % ['SYS_riscv_flush_icache']) %> /* riscv_flush_icache(${', '.join(syscall_repr)}) */ %for name, arg in string_arguments.items(): diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/rmdir.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/rmdir.asm index effc01603..05f6f40e7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/rmdir.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/rmdir.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>rmdir(path) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/rseq.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/rseq.asm index 934466fb1..9a2016d13 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/rseq.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/rseq.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>rseq(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/rtas.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/rtas.asm new file mode 100644 index 000000000..37add7a20 --- /dev/null +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/rtas.asm @@ -0,0 +1,101 @@ +<% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! +import collections +import pwnlib.abi +import pwnlib.constants +import pwnlib.shellcraft +%> +<%docstring>rtas(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str + +Invokes the syscall rtas. + +See 'man 2 rtas' for more information. + +Arguments: + vararg(int): vararg +Returns: + long + +<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None, vararg_5=None"/> +<% + abi = pwnlib.abi.ABI.syscall() + stack = abi.stack + regs = abi.register_arguments[1:] + allregs = pwnlib.shellcraft.registers.current() + + can_pushstr = [] + can_pushstr_array = [] + + argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4', 'vararg_5'] + argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5] + + # Load all of the arguments into their destination registers / stack slots. + register_arguments = dict() + stack_arguments = collections.OrderedDict() + string_arguments = dict() + dict_arguments = dict() + array_arguments = dict() + syscall_repr = [] + + for name, arg in zip(argument_names, argument_values): + if arg is not None: + syscall_repr.append('%s=%s' % (name, pwnlib.shellcraft.pretty(arg, False))) + + # If the argument itself (input) is a register... + if arg in allregs: + index = argument_names.index(name) + if index < len(regs): + target = regs[index] + register_arguments[target] = arg + elif arg is not None: + stack_arguments[name] = arg + + # The argument is not a register. It is a string value, and we + # are expecting a string value + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): + arg = arg.encode('utf-8') + string_arguments[name] = arg + + # The argument is not a register. It is a dictionary, and we are + # expecting K:V paris. + elif name in can_pushstr_array and isinstance(arg, dict): + array_arguments[name] = ['%s=%s' % (k,v) for (k,v) in arg.items()] + + # The arguent is not a register. It is a list, and we are expecting + # a list of arguments. + elif name in can_pushstr_array and isinstance(arg, (list, tuple)): + array_arguments[name] = arg + + # The argument is not a register, string, dict, or list. + # It could be a constant string ('O_RDONLY') for an integer argument, + # an actual integer value, or a constant. + else: + index = argument_names.index(name) + if index < len(regs): + target = regs[index] + register_arguments[target] = arg + elif arg is not None: + stack_arguments[name] = arg + + # Some syscalls have different names on various architectures. + # Determine which syscall number to use for the current architecture. + for syscall in ['SYS_rtas']: + if hasattr(pwnlib.constants, syscall): + break + else: + raise Exception("Could not locate any syscalls: %r" % ['SYS_rtas']) +%> + /* rtas(${', '.join(syscall_repr)}) */ +%for name, arg in string_arguments.items(): + ${pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))} + ${pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)} +%endfor +%for name, arg in array_arguments.items(): + ${pwnlib.shellcraft.pushstr_array(regs[argument_names.index(name)], arg)} +%endfor +%for name, arg in stack_arguments.items(): + ${pwnlib.shellcraft.push(arg)} +%endfor + ${pwnlib.shellcraft.setregs(register_arguments)} + ${pwnlib.shellcraft.syscall(syscall)} diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_get_priority_max.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_get_priority_max.asm index bc7db37d4..21201f74b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_get_priority_max.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_get_priority_max.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sched_get_priority_max(algorithm) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_get_priority_min.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_get_priority_min.asm index 98b5f3b09..453487392 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_get_priority_min.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_get_priority_min.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sched_get_priority_min(algorithm) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getaffinity.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getaffinity.asm index be2045848..35a5fc21b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getaffinity.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getaffinity.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sched_getaffinity(pid, cpusetsize, cpuset) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getattr.asm index aaa683f9a..92803fc05 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sched_getattr(pid, attr, size, flags) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getparam.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getparam.asm index ab2c2a295..c4a8d8aa6 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getparam.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getparam.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sched_getparam(pid, param) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getscheduler.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getscheduler.asm index 785352d91..b49fe5c4c 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getscheduler.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_getscheduler.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sched_getscheduler(pid) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_rr_get_interval.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_rr_get_interval.asm index 4410a54b8..2527ef276 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_rr_get_interval.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_rr_get_interval.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sched_rr_get_interval(pid, t) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_rr_get_interval_time64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_rr_get_interval_time64.asm index 8f8fc4d1d..a45e88b17 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_rr_get_interval_time64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_rr_get_interval_time64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sched_rr_get_interval_time64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setaffinity.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setaffinity.asm index 430b15ca6..a2bf83e52 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setaffinity.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setaffinity.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sched_setaffinity(pid, cpusetsize, cpuset) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setattr.asm index c252381ee..cfaa41b14 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sched_setattr(pid, attr, flags) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setparam.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setparam.asm index b830473e9..699a4fec0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setparam.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setparam.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sched_setparam(pid, param) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setscheduler.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setscheduler.asm index 70bca5a1f..903b975ff 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setscheduler.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_setscheduler.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sched_setscheduler(pid, policy, param) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_yield.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_yield.asm index ce9b5a744..f2abed71c 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sched_yield.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sched_yield.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sched_yield() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/seccomp.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/seccomp.asm index e34561170..cfe505738 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/seccomp.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/seccomp.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>seccomp(operation, flags, args) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/security.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/security.asm index 590b155f7..22f7b7217 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/security.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/security.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>security(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/select.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/select.asm index f79e38bff..a9349f750 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/select.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/select.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>select(nfds, readfds, writefds, exceptfds, timeout) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/semctl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/semctl.asm index 10f618d19..e4eb3a29c 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/semctl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/semctl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>semctl(semid, semnum, cmd, vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/semget.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/semget.asm index 0ebbc25cd..d806c735c 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/semget.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/semget.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>semget(key, nsems, semflg) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/semop.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/semop.asm index 442c33e8d..1ccf8e8c5 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/semop.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/semop.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>semop(semid, sops, nsops) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/semtimedop.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/semtimedop.asm index d05d8eace..f5168ffe2 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/semtimedop.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/semtimedop.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>semtimedop(semid, sops, nsops, timeout) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/semtimedop_time64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/semtimedop_time64.asm index 426e835a3..65ba7653d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/semtimedop_time64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/semtimedop_time64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>semtimedop_time64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/send.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/send.asm index 2004a1849..e8c7f2747 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/send.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/send.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>send(fd, buf, n, flags) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sendfile.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sendfile.asm index 7239231de..4ca4996e0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sendfile.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sendfile.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sendfile(out_fd, in_fd, offset, count) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sendfile64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sendfile64.asm index 5c2e76143..c2c83f18c 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sendfile64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sendfile64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sendfile64(out_fd, in_fd, offset, count) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sendmmsg.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sendmmsg.asm index f0789ce1d..b307ce4b1 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sendmmsg.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sendmmsg.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sendmmsg(fd, vmessages, vlen, flags) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sendmsg.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sendmsg.asm index b4f06d1c6..0499ea895 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sendmsg.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sendmsg.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sendmsg(fd, message, flags) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sendto.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sendto.asm index 39d2ddd21..aed643252 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sendto.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sendto.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sendto(fd, buf, n, flags, addr, addr_len) -> str @@ -57,8 +57,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/set_mempolicy.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/set_mempolicy.asm index afae84492..64eadc3e8 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/set_mempolicy.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/set_mempolicy.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>set_mempolicy(mode, nodemask, maxnode) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/set_robust_list.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/set_robust_list.asm index e18a6f191..4e72d85a4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/set_robust_list.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/set_robust_list.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>set_robust_list(head, length) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/set_thread_area.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/set_thread_area.asm index 7338af023..84081fa9e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/set_thread_area.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/set_thread_area.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>set_thread_area(u_info) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/set_tid_address.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/set_tid_address.asm index 11ff295be..423d3afb0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/set_tid_address.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/set_tid_address.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>set_tid_address(tidptr) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setdomainname.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setdomainname.asm index 2f6ad3a38..09ef7b53b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setdomainname.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setdomainname.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setdomainname(name, length) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setfsgid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setfsgid.asm index 64a5f507c..e467f561e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setfsgid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setfsgid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setfsgid(gid) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setfsgid32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setfsgid32.asm index ca825877a..0210db4c3 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setfsgid32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setfsgid32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setfsgid32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setfsuid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setfsuid.asm index 8b4b176c4..59597ea0b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setfsuid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setfsuid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setfsuid(uid) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setfsuid32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setfsuid32.asm index d94023391..b75d3e90d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setfsuid32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setfsuid32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setfsuid32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setgid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setgid.asm index 76c967155..0238b18b4 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setgid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setgid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setgid(gid) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setgid32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setgid32.asm index 68e460152..15b98fa11 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setgid32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setgid32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setgid32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setgroups.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setgroups.asm index 74962f67d..0ec219829 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setgroups.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setgroups.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setgroups(n, groups) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setgroups32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setgroups32.asm index e4bac6045..c5c62db31 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setgroups32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setgroups32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setgroups32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sethostname.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sethostname.asm index f1ce026e7..7b2f52251 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sethostname.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sethostname.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sethostname(name, length) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setitimer.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setitimer.asm index 4c74e4cd9..dd5befe6b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setitimer.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setitimer.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setitimer(which, new, old) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setns.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setns.asm index 15de2a88b..f1d6db05d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setns.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setns.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setns(fd, nstype) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setpgid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setpgid.asm index 2e52b89be..64bf684c2 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setpgid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setpgid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setpgid(pid, pgid) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setpriority.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setpriority.asm index 2529371da..377000695 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setpriority.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setpriority.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setpriority(which, who, prio) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setregid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setregid.asm index f6a3f7aaf..fb28cc15d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setregid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setregid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setregid(rgid, egid) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setregid32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setregid32.asm index fa6c87207..5b13a672d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setregid32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setregid32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setregid32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setresgid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setresgid.asm index f6dd87cba..6dfca72a9 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setresgid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setresgid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setresgid(rgid, egid, sgid) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setresgid32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setresgid32.asm index 437a7e712..8e8e76d28 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setresgid32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setresgid32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setresgid32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setresuid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setresuid.asm index 521fdedff..435b30f7b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setresuid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setresuid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setresuid(ruid, euid, suid) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setresuid32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setresuid32.asm index d8402fc50..2c9af542b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setresuid32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setresuid32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setresuid32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setreuid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setreuid.asm index 1846c3338..5f40eeaeb 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setreuid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setreuid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setreuid(ruid, euid) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setreuid32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setreuid32.asm index 533a719c0..376a666d3 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setreuid32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setreuid32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setreuid32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setrlimit.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setrlimit.asm index 0bec32588..f4ad1e5b6 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setrlimit.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setrlimit.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setrlimit(resource, rlimits) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setsid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setsid.asm index 215180fc0..f8bf32c4a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setsid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setsid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setsid() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setsockopt.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setsockopt.asm index bf81f45c4..5f5818e22 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setsockopt.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setsockopt.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setsockopt(fd, level, optname, optval, optlen) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/settimeofday.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/settimeofday.asm index c05371680..50c037a66 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/settimeofday.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/settimeofday.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>settimeofday(tv, tz) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setuid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setuid.asm index db7e485ed..298650bbd 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setuid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setuid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setuid(uid) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setuid32.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setuid32.asm index e1a0d0209..3c317048b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setuid32.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setuid32.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setuid32(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/setxattr.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/setxattr.asm index 2b5cb11d5..26cdf8fb2 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/setxattr.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/setxattr.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>setxattr(path, name, value, size, flags) -> str @@ -56,8 +56,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sgetmask.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sgetmask.asm index 3580171a7..da04f13c3 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sgetmask.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sgetmask.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sgetmask() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/shmat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/shmat.asm index 5b15dee8d..f44b5a8a7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/shmat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/shmat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>shmat(shmid, shmaddr, shmflg) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/shmctl.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/shmctl.asm index eb2a0fa5e..1a57433ec 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/shmctl.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/shmctl.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>shmctl(shmid, cmd, buf) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/shmdt.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/shmdt.asm index 932a96427..3da8141ea 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/shmdt.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/shmdt.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>shmdt(shmaddr) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/shmget.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/shmget.asm index d4f0b8422..299c71354 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/shmget.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/shmget.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>shmget(key, size, shmflg) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/shutdown.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/shutdown.asm index 581c79e5d..7a45cc6b7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/shutdown.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/shutdown.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>shutdown(ctx) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sigaction.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sigaction.asm index 95be329dd..669f52568 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sigaction.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sigaction.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sigaction(sig, act, oact) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sigaltstack.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sigaltstack.asm index b6cc7fe32..f40827cd2 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sigaltstack.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sigaltstack.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sigaltstack(ss, oss) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/signal.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/signal.asm index 17d775caf..cc67743f9 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/signal.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/signal.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>signal(sig, handler) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/signalfd.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/signalfd.asm index aad39bbfa..a9d501c18 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/signalfd.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/signalfd.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>signalfd(fd, mask, flags) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/signalfd4.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/signalfd4.asm index e9baec77f..e34d3a734 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/signalfd4.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/signalfd4.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>signalfd4(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sigpending.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sigpending.asm index bdfbcfb5d..a4e193961 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sigpending.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sigpending.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sigpending(set) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sigprocmask.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sigprocmask.asm index 676b30028..e23c8c731 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sigprocmask.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sigprocmask.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sigprocmask(how, set, oset) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sigqueueinfo.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sigqueueinfo.asm index 8f6101bdd..e96ded219 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sigqueueinfo.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sigqueueinfo.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sigqueueinfo(tgid, sig, uinfo) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sigreturn.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sigreturn.asm index 1610c58e2..622837bbe 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sigreturn.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sigreturn.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sigreturn(scp) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sigsuspend.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sigsuspend.asm index 8ecdf2818..f4d61505d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sigsuspend.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sigsuspend.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sigsuspend(set) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sigtimedwait.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sigtimedwait.asm index bfd1dca32..87e09ca3e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sigtimedwait.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sigtimedwait.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sigtimedwait(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sigtimedwait_time64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sigtimedwait_time64.asm index b8e6800a0..ecd2f3c1e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sigtimedwait_time64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sigtimedwait_time64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sigtimedwait_time64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socket.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socket.asm index 082764e97..0d6e7b1eb 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socket.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socket.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socket(domain, type, protocol) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall.asm index 7bc3fa69a..e4b6da6ee 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall(call, args) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_accept.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_accept.asm index f935c7290..66e005af9 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_accept.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_accept.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_accept(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_bind.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_bind.asm index 57096bdcd..a7577165e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_bind.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_bind.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_bind(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_connect.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_connect.asm index a52a450e3..2d7c4c685 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_connect.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_connect.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_connect(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_getpeername.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_getpeername.asm index 88366bf8e..cc821013e 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_getpeername.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_getpeername.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_getpeername(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_getsockname.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_getsockname.asm index 8e5d86405..1ed786ac1 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_getsockname.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_getsockname.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_getsockname(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_getsockopt.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_getsockopt.asm index 9a29e9281..d284a1dcc 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_getsockopt.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_getsockopt.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_getsockopt(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_listen.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_listen.asm index a7b00be1f..dd99b1f5d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_listen.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_listen.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_listen(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_recv.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_recv.asm index a85eefb01..1028808df 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_recv.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_recv.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_recv(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_recvfrom.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_recvfrom.asm index 67a461e75..f229970b7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_recvfrom.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_recvfrom.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_recvfrom(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_recvmsg.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_recvmsg.asm index 1701d4f8b..f323bf7a7 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_recvmsg.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_recvmsg.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_recvmsg(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_send.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_send.asm index c283bd3bc..9ef633f99 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_send.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_send.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_send(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_sendmsg.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_sendmsg.asm index 602ead26e..ccb538aef 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_sendmsg.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_sendmsg.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_sendmsg(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_sendto.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_sendto.asm index 0d8e37f24..1c2ffcd2d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_sendto.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_sendto.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_sendto(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_setsockopt.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_setsockopt.asm index aeda36e92..7c536a61b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_setsockopt.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_setsockopt.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_setsockopt(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_shutdown.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_shutdown.asm index 96d4b9262..603f9a0d9 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_shutdown.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_shutdown.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_shutdown(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_socket.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_socket.asm index dbdb9e315..ee1548b12 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_socket.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_socket.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_socket(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_socketpair.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_socketpair.asm index bd2d2cf3c..0631c6439 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_socketpair.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketcall_socketpair.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketcall_socketpair(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/socketpair.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/socketpair.asm index 666d0fb7e..848701892 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/socketpair.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/socketpair.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>socketpair(domain, type, protocol, fds) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/splice.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/splice.asm index df825e874..7fdd6f08b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/splice.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/splice.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>splice(fdin, offin, fdout, offout, length, flags) -> str @@ -57,8 +57,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/spu_create.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/spu_create.asm new file mode 100644 index 000000000..6caeed723 --- /dev/null +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/spu_create.asm @@ -0,0 +1,104 @@ +<% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! +import collections +import pwnlib.abi +import pwnlib.constants +import pwnlib.shellcraft +%> +<%docstring>spu_create(pathname, flags, mode, neighbor_fd) -> str + +Invokes the syscall spu_create. + +See 'man 2 spu_create' for more information. + +Arguments: + pathname(char*): pathname + flags(int): flags + mode(mode_t): mode + neighbor_fd(int): neighbor_fd +Returns: + int + +<%page args="pathname=0, flags=0, mode=0, neighbor_fd=0"/> +<% + abi = pwnlib.abi.ABI.syscall() + stack = abi.stack + regs = abi.register_arguments[1:] + allregs = pwnlib.shellcraft.registers.current() + + can_pushstr = ['pathname'] + can_pushstr_array = [] + + argument_names = ['pathname', 'flags', 'mode', 'neighbor_fd'] + argument_values = [pathname, flags, mode, neighbor_fd] + + # Load all of the arguments into their destination registers / stack slots. + register_arguments = dict() + stack_arguments = collections.OrderedDict() + string_arguments = dict() + dict_arguments = dict() + array_arguments = dict() + syscall_repr = [] + + for name, arg in zip(argument_names, argument_values): + if arg is not None: + syscall_repr.append('%s=%s' % (name, pwnlib.shellcraft.pretty(arg, False))) + + # If the argument itself (input) is a register... + if arg in allregs: + index = argument_names.index(name) + if index < len(regs): + target = regs[index] + register_arguments[target] = arg + elif arg is not None: + stack_arguments[name] = arg + + # The argument is not a register. It is a string value, and we + # are expecting a string value + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): + arg = arg.encode('utf-8') + string_arguments[name] = arg + + # The argument is not a register. It is a dictionary, and we are + # expecting K:V paris. + elif name in can_pushstr_array and isinstance(arg, dict): + array_arguments[name] = ['%s=%s' % (k,v) for (k,v) in arg.items()] + + # The arguent is not a register. It is a list, and we are expecting + # a list of arguments. + elif name in can_pushstr_array and isinstance(arg, (list, tuple)): + array_arguments[name] = arg + + # The argument is not a register, string, dict, or list. + # It could be a constant string ('O_RDONLY') for an integer argument, + # an actual integer value, or a constant. + else: + index = argument_names.index(name) + if index < len(regs): + target = regs[index] + register_arguments[target] = arg + elif arg is not None: + stack_arguments[name] = arg + + # Some syscalls have different names on various architectures. + # Determine which syscall number to use for the current architecture. + for syscall in ['SYS_spu_create']: + if hasattr(pwnlib.constants, syscall): + break + else: + raise Exception("Could not locate any syscalls: %r" % ['SYS_spu_create']) +%> + /* spu_create(${', '.join(syscall_repr)}) */ +%for name, arg in string_arguments.items(): + ${pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))} + ${pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)} +%endfor +%for name, arg in array_arguments.items(): + ${pwnlib.shellcraft.pushstr_array(regs[argument_names.index(name)], arg)} +%endfor +%for name, arg in stack_arguments.items(): + ${pwnlib.shellcraft.push(arg)} +%endfor + ${pwnlib.shellcraft.setregs(register_arguments)} + ${pwnlib.shellcraft.syscall(syscall)} diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/spu_run.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/spu_run.asm new file mode 100644 index 000000000..9d8b54e41 --- /dev/null +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/spu_run.asm @@ -0,0 +1,103 @@ +<% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! +import collections +import pwnlib.abi +import pwnlib.constants +import pwnlib.shellcraft +%> +<%docstring>spu_run(fd, npc, event) -> str + +Invokes the syscall spu_run. + +See 'man 2 spu_run' for more information. + +Arguments: + fd(int): fd + npc(unsigned*): npc + event(unsigned*): event +Returns: + int + +<%page args="fd=0, npc=0, event=0"/> +<% + abi = pwnlib.abi.ABI.syscall() + stack = abi.stack + regs = abi.register_arguments[1:] + allregs = pwnlib.shellcraft.registers.current() + + can_pushstr = [] + can_pushstr_array = [] + + argument_names = ['fd', 'npc', 'event'] + argument_values = [fd, npc, event] + + # Load all of the arguments into their destination registers / stack slots. + register_arguments = dict() + stack_arguments = collections.OrderedDict() + string_arguments = dict() + dict_arguments = dict() + array_arguments = dict() + syscall_repr = [] + + for name, arg in zip(argument_names, argument_values): + if arg is not None: + syscall_repr.append('%s=%s' % (name, pwnlib.shellcraft.pretty(arg, False))) + + # If the argument itself (input) is a register... + if arg in allregs: + index = argument_names.index(name) + if index < len(regs): + target = regs[index] + register_arguments[target] = arg + elif arg is not None: + stack_arguments[name] = arg + + # The argument is not a register. It is a string value, and we + # are expecting a string value + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): + arg = arg.encode('utf-8') + string_arguments[name] = arg + + # The argument is not a register. It is a dictionary, and we are + # expecting K:V paris. + elif name in can_pushstr_array and isinstance(arg, dict): + array_arguments[name] = ['%s=%s' % (k,v) for (k,v) in arg.items()] + + # The arguent is not a register. It is a list, and we are expecting + # a list of arguments. + elif name in can_pushstr_array and isinstance(arg, (list, tuple)): + array_arguments[name] = arg + + # The argument is not a register, string, dict, or list. + # It could be a constant string ('O_RDONLY') for an integer argument, + # an actual integer value, or a constant. + else: + index = argument_names.index(name) + if index < len(regs): + target = regs[index] + register_arguments[target] = arg + elif arg is not None: + stack_arguments[name] = arg + + # Some syscalls have different names on various architectures. + # Determine which syscall number to use for the current architecture. + for syscall in ['SYS_spu_run']: + if hasattr(pwnlib.constants, syscall): + break + else: + raise Exception("Could not locate any syscalls: %r" % ['SYS_spu_run']) +%> + /* spu_run(${', '.join(syscall_repr)}) */ +%for name, arg in string_arguments.items(): + ${pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))} + ${pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)} +%endfor +%for name, arg in array_arguments.items(): + ${pwnlib.shellcraft.pushstr_array(regs[argument_names.index(name)], arg)} +%endfor +%for name, arg in stack_arguments.items(): + ${pwnlib.shellcraft.push(arg)} +%endfor + ${pwnlib.shellcraft.setregs(register_arguments)} + ${pwnlib.shellcraft.syscall(syscall)} diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ssetmask.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ssetmask.asm index 9e6623c16..eba536956 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ssetmask.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ssetmask.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ssetmask(newmask) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/stat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/stat.asm index 3be17fbe9..83a882222 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/stat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/stat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>stat(file, buf) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/stat64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/stat64.asm index 2b6896671..b0b07f925 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/stat64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/stat64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>stat64(file, buf) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/statfs.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/statfs.asm index dbf242535..8122fc67f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/statfs.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/statfs.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>statfs(file, buf) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/statfs64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/statfs64.asm index 30b0e5ca8..907371f64 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/statfs64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/statfs64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>statfs64(file, buf) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/statx.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/statx.asm index c8a693a04..ec3db668f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/statx.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/statx.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>statx(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/stime.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/stime.asm index a729df423..41d524087 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/stime.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/stime.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>stime(when) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/stty.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/stty.asm index 5a2b8ccaa..7df96d658 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/stty.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/stty.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>stty(fd, params) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/subpage_prot.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/subpage_prot.asm new file mode 100644 index 000000000..3bfd54a87 --- /dev/null +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/subpage_prot.asm @@ -0,0 +1,103 @@ +<% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! +import collections +import pwnlib.abi +import pwnlib.constants +import pwnlib.shellcraft +%> +<%docstring>subpage_prot(addr, length, map) -> str + +Invokes the syscall subpage_prot. + +See 'man 2 subpage_prot' for more information. + +Arguments: + addr(unsigned): addr + length(unsigned): length + map(uint32_t*): map +Returns: + long + +<%page args="addr=0, length=0, map=0"/> +<% + abi = pwnlib.abi.ABI.syscall() + stack = abi.stack + regs = abi.register_arguments[1:] + allregs = pwnlib.shellcraft.registers.current() + + can_pushstr = [] + can_pushstr_array = [] + + argument_names = ['addr', 'length', 'map'] + argument_values = [addr, length, map] + + # Load all of the arguments into their destination registers / stack slots. + register_arguments = dict() + stack_arguments = collections.OrderedDict() + string_arguments = dict() + dict_arguments = dict() + array_arguments = dict() + syscall_repr = [] + + for name, arg in zip(argument_names, argument_values): + if arg is not None: + syscall_repr.append('%s=%s' % (name, pwnlib.shellcraft.pretty(arg, False))) + + # If the argument itself (input) is a register... + if arg in allregs: + index = argument_names.index(name) + if index < len(regs): + target = regs[index] + register_arguments[target] = arg + elif arg is not None: + stack_arguments[name] = arg + + # The argument is not a register. It is a string value, and we + # are expecting a string value + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): + arg = arg.encode('utf-8') + string_arguments[name] = arg + + # The argument is not a register. It is a dictionary, and we are + # expecting K:V paris. + elif name in can_pushstr_array and isinstance(arg, dict): + array_arguments[name] = ['%s=%s' % (k,v) for (k,v) in arg.items()] + + # The arguent is not a register. It is a list, and we are expecting + # a list of arguments. + elif name in can_pushstr_array and isinstance(arg, (list, tuple)): + array_arguments[name] = arg + + # The argument is not a register, string, dict, or list. + # It could be a constant string ('O_RDONLY') for an integer argument, + # an actual integer value, or a constant. + else: + index = argument_names.index(name) + if index < len(regs): + target = regs[index] + register_arguments[target] = arg + elif arg is not None: + stack_arguments[name] = arg + + # Some syscalls have different names on various architectures. + # Determine which syscall number to use for the current architecture. + for syscall in ['SYS_subpage_prot']: + if hasattr(pwnlib.constants, syscall): + break + else: + raise Exception("Could not locate any syscalls: %r" % ['SYS_subpage_prot']) +%> + /* subpage_prot(${', '.join(syscall_repr)}) */ +%for name, arg in string_arguments.items(): + ${pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))} + ${pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)} +%endfor +%for name, arg in array_arguments.items(): + ${pwnlib.shellcraft.pushstr_array(regs[argument_names.index(name)], arg)} +%endfor +%for name, arg in stack_arguments.items(): + ${pwnlib.shellcraft.push(arg)} +%endfor + ${pwnlib.shellcraft.setregs(register_arguments)} + ${pwnlib.shellcraft.syscall(syscall)} diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/swapcontext.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/swapcontext.asm new file mode 100644 index 000000000..afebb938e --- /dev/null +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/swapcontext.asm @@ -0,0 +1,102 @@ +<% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! +import collections +import pwnlib.abi +import pwnlib.constants +import pwnlib.shellcraft +%> +<%docstring>swapcontext(oucp, ucp) -> str + +Invokes the syscall swapcontext. + +See 'man 2 swapcontext' for more information. + +Arguments: + oucp(ucontext_t*): oucp + ucp(ucontext_t*): ucp +Returns: + int + +<%page args="oucp=0, ucp=0"/> +<% + abi = pwnlib.abi.ABI.syscall() + stack = abi.stack + regs = abi.register_arguments[1:] + allregs = pwnlib.shellcraft.registers.current() + + can_pushstr = [] + can_pushstr_array = [] + + argument_names = ['oucp', 'ucp'] + argument_values = [oucp, ucp] + + # Load all of the arguments into their destination registers / stack slots. + register_arguments = dict() + stack_arguments = collections.OrderedDict() + string_arguments = dict() + dict_arguments = dict() + array_arguments = dict() + syscall_repr = [] + + for name, arg in zip(argument_names, argument_values): + if arg is not None: + syscall_repr.append('%s=%s' % (name, pwnlib.shellcraft.pretty(arg, False))) + + # If the argument itself (input) is a register... + if arg in allregs: + index = argument_names.index(name) + if index < len(regs): + target = regs[index] + register_arguments[target] = arg + elif arg is not None: + stack_arguments[name] = arg + + # The argument is not a register. It is a string value, and we + # are expecting a string value + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): + arg = arg.encode('utf-8') + string_arguments[name] = arg + + # The argument is not a register. It is a dictionary, and we are + # expecting K:V paris. + elif name in can_pushstr_array and isinstance(arg, dict): + array_arguments[name] = ['%s=%s' % (k,v) for (k,v) in arg.items()] + + # The arguent is not a register. It is a list, and we are expecting + # a list of arguments. + elif name in can_pushstr_array and isinstance(arg, (list, tuple)): + array_arguments[name] = arg + + # The argument is not a register, string, dict, or list. + # It could be a constant string ('O_RDONLY') for an integer argument, + # an actual integer value, or a constant. + else: + index = argument_names.index(name) + if index < len(regs): + target = regs[index] + register_arguments[target] = arg + elif arg is not None: + stack_arguments[name] = arg + + # Some syscalls have different names on various architectures. + # Determine which syscall number to use for the current architecture. + for syscall in ['SYS_swapcontext']: + if hasattr(pwnlib.constants, syscall): + break + else: + raise Exception("Could not locate any syscalls: %r" % ['SYS_swapcontext']) +%> + /* swapcontext(${', '.join(syscall_repr)}) */ +%for name, arg in string_arguments.items(): + ${pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))} + ${pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)} +%endfor +%for name, arg in array_arguments.items(): + ${pwnlib.shellcraft.pushstr_array(regs[argument_names.index(name)], arg)} +%endfor +%for name, arg in stack_arguments.items(): + ${pwnlib.shellcraft.push(arg)} +%endfor + ${pwnlib.shellcraft.setregs(register_arguments)} + ${pwnlib.shellcraft.syscall(syscall)} diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/swapoff.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/swapoff.asm index 7988e9512..f48d89f18 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/swapoff.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/swapoff.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>swapoff(path) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/swapon.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/swapon.asm index 966f5e719..e0490d942 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/swapon.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/swapon.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>swapon(path, flags) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/switch_endian.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/switch_endian.asm new file mode 100644 index 000000000..9165a01ee --- /dev/null +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/switch_endian.asm @@ -0,0 +1,101 @@ +<% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! +import collections +import pwnlib.abi +import pwnlib.constants +import pwnlib.shellcraft +%> +<%docstring>switch_endian(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str + +Invokes the syscall switch_endian. + +See 'man 2 switch_endian' for more information. + +Arguments: + vararg(int): vararg +Returns: + long + +<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None, vararg_5=None"/> +<% + abi = pwnlib.abi.ABI.syscall() + stack = abi.stack + regs = abi.register_arguments[1:] + allregs = pwnlib.shellcraft.registers.current() + + can_pushstr = [] + can_pushstr_array = [] + + argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4', 'vararg_5'] + argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5] + + # Load all of the arguments into their destination registers / stack slots. + register_arguments = dict() + stack_arguments = collections.OrderedDict() + string_arguments = dict() + dict_arguments = dict() + array_arguments = dict() + syscall_repr = [] + + for name, arg in zip(argument_names, argument_values): + if arg is not None: + syscall_repr.append('%s=%s' % (name, pwnlib.shellcraft.pretty(arg, False))) + + # If the argument itself (input) is a register... + if arg in allregs: + index = argument_names.index(name) + if index < len(regs): + target = regs[index] + register_arguments[target] = arg + elif arg is not None: + stack_arguments[name] = arg + + # The argument is not a register. It is a string value, and we + # are expecting a string value + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): + arg = arg.encode('utf-8') + string_arguments[name] = arg + + # The argument is not a register. It is a dictionary, and we are + # expecting K:V paris. + elif name in can_pushstr_array and isinstance(arg, dict): + array_arguments[name] = ['%s=%s' % (k,v) for (k,v) in arg.items()] + + # The arguent is not a register. It is a list, and we are expecting + # a list of arguments. + elif name in can_pushstr_array and isinstance(arg, (list, tuple)): + array_arguments[name] = arg + + # The argument is not a register, string, dict, or list. + # It could be a constant string ('O_RDONLY') for an integer argument, + # an actual integer value, or a constant. + else: + index = argument_names.index(name) + if index < len(regs): + target = regs[index] + register_arguments[target] = arg + elif arg is not None: + stack_arguments[name] = arg + + # Some syscalls have different names on various architectures. + # Determine which syscall number to use for the current architecture. + for syscall in ['SYS_switch_endian']: + if hasattr(pwnlib.constants, syscall): + break + else: + raise Exception("Could not locate any syscalls: %r" % ['SYS_switch_endian']) +%> + /* switch_endian(${', '.join(syscall_repr)}) */ +%for name, arg in string_arguments.items(): + ${pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))} + ${pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)} +%endfor +%for name, arg in array_arguments.items(): + ${pwnlib.shellcraft.pushstr_array(regs[argument_names.index(name)], arg)} +%endfor +%for name, arg in stack_arguments.items(): + ${pwnlib.shellcraft.push(arg)} +%endfor + ${pwnlib.shellcraft.setregs(register_arguments)} + ${pwnlib.shellcraft.syscall(syscall)} diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/symlink.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/symlink.asm index 6d7bdec87..ea11db9db 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/symlink.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/symlink.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>symlink(from_, to) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/symlinkat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/symlinkat.asm index 44a146b94..29b37b8fe 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/symlinkat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/symlinkat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>symlinkat(from_, tofd, to) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sync.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sync.asm index 244804221..67f24693f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sync.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sync.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sync() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sync_file_range.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sync_file_range.asm index 106f2cdfd..9f32d9ec5 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sync_file_range.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sync_file_range.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sync_file_range(fd, offset, count, flags) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sync_file_range2.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sync_file_range2.asm index a516eea19..4cf1da7cc 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sync_file_range2.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sync_file_range2.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sync_file_range2(fd, flags, offset, nbytes) -> str @@ -51,12 +51,12 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[index] = arg + stack_arguments[name] = arg # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg @@ -79,7 +79,7 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[target] = arg + stack_arguments[name] = arg # Some syscalls have different names on various architectures. # Determine which syscall number to use for the current architecture. @@ -87,7 +87,7 @@ Returns: if hasattr(pwnlib.constants, syscall): break else: - raise Exception("Could not locate any syscalls: %r" % syscalls) + raise Exception("Could not locate any syscalls: %r" % ['SYS_sync_file_range2']) %> /* sync_file_range2(${', '.join(syscall_repr)}) */ %for name, arg in string_arguments.items(): diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/syncfs.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/syncfs.asm index 77894516b..63c966ba0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/syncfs.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/syncfs.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>syncfs(fd) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sys_kexec_load.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sys_kexec_load.asm index c67f2dd42..61c6c6919 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sys_kexec_load.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sys_kexec_load.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sys_kexec_load(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/syscall.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/syscall.asm index 03c6ec0e2..ed24b86c3 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/syscall.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/syscall.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>syscall(sysno, vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sysfs.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sysfs.asm index c2b3aaa74..a28834fef 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sysfs.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sysfs.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sysfs(option) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sysinfo.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sysinfo.asm index a756a0b2d..4fd0480d5 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sysinfo.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sysinfo.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sysinfo(info) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/syslog.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/syslog.asm index 19cb3b51d..1ae00efdd 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/syslog.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/syslog.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>syslog(pri, fmt, vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sysmips.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sysmips.asm index cea4f4e21..9500ef235 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sysmips.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sysmips.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>sysmips(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/sysriscv.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/sysriscv.asm index d65886016..ce7c33dda 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/sysriscv.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/sysriscv.asm @@ -1,11 +1,11 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> -<%docstring>sysriscv(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4) -> str +<%docstring>sysriscv(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str Invokes the syscall sysriscv. @@ -16,7 +16,7 @@ Arguments: Returns: long -<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None"/> +<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None, vararg_5=None"/> <% abi = pwnlib.abi.ABI.syscall() stack = abi.stack @@ -26,8 +26,8 @@ Returns: can_pushstr = [] can_pushstr_array = [] - argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4'] - argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4] + argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4', 'vararg_5'] + argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5] # Load all of the arguments into their destination registers / stack slots. register_arguments = dict() @@ -48,12 +48,12 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[index] = arg + stack_arguments[name] = arg # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg @@ -76,7 +76,7 @@ Returns: target = regs[index] register_arguments[target] = arg elif arg is not None: - stack_arguments[target] = arg + stack_arguments[name] = arg # Some syscalls have different names on various architectures. # Determine which syscall number to use for the current architecture. @@ -84,7 +84,7 @@ Returns: if hasattr(pwnlib.constants, syscall): break else: - raise Exception("Could not locate any syscalls: %r" % syscalls) + raise Exception("Could not locate any syscalls: %r" % ['SYS_sysriscv']) %> /* sysriscv(${', '.join(syscall_repr)}) */ %for name, arg in string_arguments.items(): diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/tee.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/tee.asm index 3e45f1246..c6163ffd6 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/tee.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/tee.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>tee(fdin, fdout, length, flags) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/tgkill.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/tgkill.asm index f8d81c40d..7adc249bc 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/tgkill.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/tgkill.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>tgkill(tgid, tid, sig) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/tgsigqueueinfo.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/tgsigqueueinfo.asm index 2cbb2fb48..133cb5f50 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/tgsigqueueinfo.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/tgsigqueueinfo.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>tgsigqueueinfo(tgid, tid, sig, uinfo) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/time.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/time.asm index fb47c7616..8c531bf31 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/time.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/time.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>time(timer) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/timer_create.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/timer_create.asm index 587fffc00..4c1d2a11d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/timer_create.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/timer_create.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>timer_create(clock_id, evp, timerid) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/timer_delete.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/timer_delete.asm index 048c02465..25c90a1ba 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/timer_delete.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/timer_delete.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>timer_delete(timerid) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/timer_getoverrun.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/timer_getoverrun.asm index e00097653..9296bb661 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/timer_getoverrun.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/timer_getoverrun.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>timer_getoverrun(timerid) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/timer_gettime.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/timer_gettime.asm index 6e0d9b984..7838427af 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/timer_gettime.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/timer_gettime.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>timer_gettime(timerid, value) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/timer_gettime64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/timer_gettime64.asm index 2eca15382..23508a763 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/timer_gettime64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/timer_gettime64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>timer_gettime64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/timer_settime.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/timer_settime.asm index 2297b341c..b28433885 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/timer_settime.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/timer_settime.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>timer_settime(timerid, flags, value, ovalue) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/timer_settime64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/timer_settime64.asm index 6d2445a43..2f6e76182 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/timer_settime64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/timer_settime64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>timer_settime64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd.asm index b55c6a3c9..eb3ae0e41 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>timerfd(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_create.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_create.asm index 5f4ffe1a0..fe8fa2fa9 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_create.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_create.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>timerfd_create(clock_id, flags) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_gettime.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_gettime.asm index eafdab35d..377feb381 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_gettime.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_gettime.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>timerfd_gettime(ufd, otmr) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_gettime64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_gettime64.asm index 7bb53b938..175ecde7a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_gettime64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_gettime64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>timerfd_gettime64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_settime.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_settime.asm index a10932e40..47e73dc44 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_settime.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_settime.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>timerfd_settime(ufd, flags, utmr, otmr) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_settime64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_settime64.asm index 52f33750a..9a77e41c5 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_settime64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/timerfd_settime64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>timerfd_settime64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/times.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/times.asm index 055bbffb0..5c7feb756 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/times.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/times.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>times(buffer) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/tkill.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/tkill.asm index 85815e666..6029aac75 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/tkill.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/tkill.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>tkill(tid, sig) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/truncate.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/truncate.asm index 56081278d..a89a69b70 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/truncate.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/truncate.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>truncate(file, length) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/truncate64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/truncate64.asm index 64676a3f2..61d3392ac 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/truncate64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/truncate64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>truncate64(file, length) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/tuxcall.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/tuxcall.asm index c50126577..845a7ef69 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/tuxcall.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/tuxcall.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>tuxcall(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ugetrlimit.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ugetrlimit.asm index 33f1743a6..29a4e68c1 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ugetrlimit.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ugetrlimit.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ugetrlimit(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ulimit.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ulimit.asm index dd14a9509..7d0a8df84 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ulimit.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ulimit.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ulimit(cmd, vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/umask.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/umask.asm index 1edda3bc0..6d00d9904 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/umask.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/umask.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>umask(mask) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/umount.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/umount.asm index 6a5e71a1e..7b33f4f43 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/umount.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/umount.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>umount(special_file) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/umount2.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/umount2.asm index 4513cc314..c8500facc 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/umount2.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/umount2.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>umount2(special_file, flags) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/uname.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/uname.asm index 4acb894e8..2f8cd2d91 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/uname.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/uname.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>uname(name) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/unlink.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/unlink.asm index 77c04a43f..270c79f81 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/unlink.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/unlink.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>unlink(name) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/unlinkat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/unlinkat.asm index 14044bbe3..2c4f3751a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/unlinkat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/unlinkat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>unlinkat(fd, name, flag) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/unshare.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/unshare.asm index f7bbf5b76..8b31cfb6a 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/unshare.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/unshare.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>unshare(flags) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/uselib.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/uselib.asm index 8e55a878c..2cf67f7f9 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/uselib.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/uselib.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>uselib(library) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/userfaultfd.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/userfaultfd.asm index bf4462517..f1ce9692c 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/userfaultfd.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/userfaultfd.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>userfaultfd(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/ustat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/ustat.asm index 36039daab..fa014944d 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/ustat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/ustat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>ustat(dev, ubuf) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/utime.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/utime.asm index 33aa64fbc..b5364904b 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/utime.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/utime.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>utime(file, file_times) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/utimensat.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/utimensat.asm index c346e2b74..d05d62e1f 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/utimensat.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/utimensat.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>utimensat(fd, path, times, flags) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/utimensat_time64.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/utimensat_time64.asm index 13eb78491..788ddbc08 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/utimensat_time64.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/utimensat_time64.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>utimensat_time64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/utimes.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/utimes.asm index 30cff2a7a..a1907be47 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/utimes.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/utimes.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>utimes(file, tvp) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/vfork.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/vfork.asm index 0d0444f7e..7da395769 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/vfork.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/vfork.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>vfork() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/vhangup.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/vhangup.asm index b78351b19..79c56ed63 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/vhangup.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/vhangup.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>vhangup() -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/vm86.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/vm86.asm index a824d1425..3897713de 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/vm86.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/vm86.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>vm86(fn, v86) -> str @@ -53,8 +53,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/vm86old.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/vm86old.asm index 269fabceb..81a73a6fd 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/vm86old.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/vm86old.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>vm86old(info) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/vmsplice.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/vmsplice.asm index a7256608d..b6ad4f380 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/vmsplice.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/vmsplice.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>vmsplice(fdout, iov, count, flags) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/vserver.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/vserver.asm index 5ce055aee..701049149 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/vserver.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/vserver.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>vserver(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4, vararg_5) -> str @@ -52,8 +52,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/wait4.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/wait4.asm index c51f92045..3250d53cf 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/wait4.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/wait4.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>wait4(pid, stat_loc, options, usage) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/waitid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/waitid.asm index abeb66dd4..2fec78c46 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/waitid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/waitid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>waitid(idtype, id, infop, options) -> str @@ -55,8 +55,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/waitpid.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/waitpid.asm index 2a9f09024..7d38c20a0 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/waitpid.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/waitpid.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>waitpid(pid, stat_loc, options) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/write.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/write.asm index 24e7f17af..dfe91a416 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/write.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/write.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>write(fd, buf, n) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/common/linux/syscalls/writev.asm b/pwnlib/shellcraft/templates/common/linux/syscalls/writev.asm index 0d23c5f58..20aa14c6c 100644 --- a/pwnlib/shellcraft/templates/common/linux/syscalls/writev.asm +++ b/pwnlib/shellcraft/templates/common/linux/syscalls/writev.asm @@ -1,9 +1,9 @@ <% +# Auto-generated by pwnlib/data/syscalls/generate.py. DO NOT EDIT! import collections import pwnlib.abi import pwnlib.constants import pwnlib.shellcraft -import six %> <%docstring>writev(fd, iovec, count) -> str @@ -54,8 +54,8 @@ Returns: # The argument is not a register. It is a string value, and we # are expecting a string value - elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)): - if isinstance(arg, six.text_type): + elif name in can_pushstr and isinstance(arg, (bytes, bytearray, str)): + if isinstance(arg, str): arg = arg.encode('utf-8') string_arguments[name] = arg diff --git a/pwnlib/shellcraft/templates/i386/cgc/syscall.asm b/pwnlib/shellcraft/templates/i386/cgc/syscall.asm index d7774cf0e..4be7781b6 100644 --- a/pwnlib/shellcraft/templates/i386/cgc/syscall.asm +++ b/pwnlib/shellcraft/templates/i386/cgc/syscall.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import i386 from pwnlib.constants import Constant from pwnlib.abi import linux_i386_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None"/> <%docstring> @@ -13,7 +12,7 @@ Any of the arguments can be expressions to be evaluated by :func:`pwnlib.constan <% append_cdq = False - if isinstance(syscall, (str, text_type, Constant)) and str(syscall).startswith('SYS_'): + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: diff --git a/pwnlib/shellcraft/templates/i386/freebsd/syscall.asm b/pwnlib/shellcraft/templates/i386/freebsd/syscall.asm index 3bbd24291..eb33cf676 100644 --- a/pwnlib/shellcraft/templates/i386/freebsd/syscall.asm +++ b/pwnlib/shellcraft/templates/i386/freebsd/syscall.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import i386, pretty from pwnlib.constants import Constant from pwnlib.abi import freebsd_i386_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None"/> <%docstring> @@ -60,7 +59,7 @@ Example: int 0x80 <% - if isinstance(syscall, (str, text_type, Constant)) and str(syscall).startswith('SYS_'): + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: diff --git a/pwnlib/shellcraft/templates/i386/linux/egghunter.asm b/pwnlib/shellcraft/templates/i386/linux/egghunter.asm index c8bb72c51..c6e5702e5 100644 --- a/pwnlib/shellcraft/templates/i386/linux/egghunter.asm +++ b/pwnlib/shellcraft/templates/i386/linux/egghunter.asm @@ -1,5 +1,4 @@ <% -import six from pwnlib.shellcraft import i386, pretty, common from pwnlib.util.packing import pack, unpack from pwnlib.util.lists import group @@ -25,7 +24,7 @@ done = common.label('egghunter_done') next_page = common.label('egghunter_nextpage') egg_str = egg -if isinstance(egg, six.integer_types): +if isinstance(egg, int): egg_str = pack(egg) if len(egg_str) % 4: diff --git a/pwnlib/shellcraft/templates/i386/linux/stage.asm b/pwnlib/shellcraft/templates/i386/linux/stage.asm index 7687e9a08..bc781243b 100644 --- a/pwnlib/shellcraft/templates/i386/linux/stage.asm +++ b/pwnlib/shellcraft/templates/i386/linux/stage.asm @@ -1,5 +1,4 @@ <% -import six from pwnlib.shellcraft.i386 import push from pwnlib.shellcraft.i386.linux import read, readn, mmap from pwnlib import constants as C @@ -30,7 +29,7 @@ Example: protection = C.PROT_READ | C.PROT_WRITE | C.PROT_EXEC flags = C.MAP_ANONYMOUS | C.MAP_PRIVATE - assert isinstance(fd, six.integer_types) + assert isinstance(fd, int) %> %if length is None: /* How many bytes should we receive? */ diff --git a/pwnlib/shellcraft/templates/i386/linux/syscall.asm b/pwnlib/shellcraft/templates/i386/linux/syscall.asm index 8e493ec27..bf09ab5ee 100644 --- a/pwnlib/shellcraft/templates/i386/linux/syscall.asm +++ b/pwnlib/shellcraft/templates/i386/linux/syscall.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import i386, pretty from pwnlib.constants import Constant from pwnlib.abi import linux_i386_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None"/> <%docstring> @@ -85,7 +84,7 @@ Example: int 0x80 <% - if isinstance(syscall, (str, text_type, Constant)) and str(syscall).startswith('SYS_'): + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: diff --git a/pwnlib/shellcraft/templates/i386/mov.asm b/pwnlib/shellcraft/templates/i386/mov.asm index e3f1db511..5a719d872 100644 --- a/pwnlib/shellcraft/templates/i386/mov.asm +++ b/pwnlib/shellcraft/templates/i386/mov.asm @@ -3,7 +3,6 @@ from pwnlib.util import lists, packing, fiddling, misc from pwnlib.log import getLogger from pwnlib.shellcraft.registers import get_register, is_register, bits_required - import six log = getLogger('pwnlib.shellcraft.i386.mov') %> <%page args="dest, src, stack_allowed = True"/> @@ -143,7 +142,7 @@ else: % else: mov ${dest}, ${src} % endif -% elif isinstance(src, six.integer_types): +% elif isinstance(src, int): ## Special case for zeroes % if src == 0: xor ${dest}, ${dest} diff --git a/pwnlib/shellcraft/templates/i386/push.asm b/pwnlib/shellcraft/templates/i386/push.asm index 0efa07257..110b6ff87 100644 --- a/pwnlib/shellcraft/templates/i386/push.asm +++ b/pwnlib/shellcraft/templates/i386/push.asm @@ -3,7 +3,6 @@ from pwnlib.shellcraft import i386 from pwnlib import constants from pwnlib.shellcraft.registers import get_register, is_register, bits_required - from six import text_type import re %> <%page args="value"/> @@ -49,7 +48,7 @@ Example: value_orig = value is_reg = get_register(value) -if not is_reg and isinstance(value, (str, text_type)): +if not is_reg and isinstance(value, (str, str)): try: value = constants.eval(value) except (ValueError, AttributeError): diff --git a/pwnlib/shellcraft/templates/i386/pushstr.asm b/pwnlib/shellcraft/templates/i386/pushstr.asm index ae0ad9668..796b3c137 100644 --- a/pwnlib/shellcraft/templates/i386/pushstr.asm +++ b/pwnlib/shellcraft/templates/i386/pushstr.asm @@ -1,7 +1,6 @@ <% from pwnlib.util import lists, packing, fiddling from pwnlib.shellcraft import pretty, okay - import six %> <%page args="string, append_null = True"/> <%docstring> @@ -63,22 +62,22 @@ Args: <% original = string -if isinstance(string, six.text_type): +if isinstance(string, str): string = packing._need_bytes(string, 2, 0x80) else: string = packing.flat(string) if append_null: string += b'\x00' - if isinstance(original, six.binary_type): + if isinstance(original, bytes): original += b'\x00' - elif isinstance(original, six.text_type): + elif isinstance(original, str): original += '\x00' if not string: return -if six.indexbytes(string, -1) >= 128: +if string[-1] >= 128: extend = b'\xff' else: extend = b'\x00' diff --git a/pwnlib/shellcraft/templates/i386/setregs.asm b/pwnlib/shellcraft/templates/i386/setregs.asm index e05328daa..104e5c7cd 100644 --- a/pwnlib/shellcraft/templates/i386/setregs.asm +++ b/pwnlib/shellcraft/templates/i386/setregs.asm @@ -1,5 +1,4 @@ <% - import six from pwnlib.regsort import regsort from pwnlib.constants import Constant, eval from pwnlib.shellcraft import registers @@ -45,7 +44,7 @@ if isinstance(edx, str): except NameError: pass -if isinstance(eax, six.integer_types) and isinstance(edx, six.integer_types) and eax >> 31 == edx: +if isinstance(eax, int) and isinstance(edx, int) and eax >> 31 == edx: cdq = True reg_context.pop('edx') diff --git a/pwnlib/shellcraft/templates/i386/xor.asm b/pwnlib/shellcraft/templates/i386/xor.asm index 462b133fc..1e3795e59 100644 --- a/pwnlib/shellcraft/templates/i386/xor.asm +++ b/pwnlib/shellcraft/templates/i386/xor.asm @@ -1,5 +1,4 @@ <% - import six from pwnlib.shellcraft import pretty, common, i386, registers from pwnlib.util.packing import pack, unpack from pwnlib.context import context as ctx @@ -46,7 +45,7 @@ else: key_str = key key_int = key - if isinstance(key, six.integer_types): + if isinstance(key, int): key_str = pack(key, bytes=4) else: key_int = unpack(key, 'all') diff --git a/pwnlib/shellcraft/templates/loongarch64/linux/syscall.asm b/pwnlib/shellcraft/templates/loongarch64/linux/syscall.asm index aeb8da332..b9228c1a1 100644 --- a/pwnlib/shellcraft/templates/loongarch64/linux/syscall.asm +++ b/pwnlib/shellcraft/templates/loongarch64/linux/syscall.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import loongarch64, pretty from pwnlib.constants import Constant from pwnlib.abi import linux_loongarch64_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4=None, arg5=None"/> <%docstring> diff --git a/pwnlib/shellcraft/templates/loongarch64/mov.asm b/pwnlib/shellcraft/templates/loongarch64/mov.asm index 756a346c4..3956a792a 100644 --- a/pwnlib/shellcraft/templates/loongarch64/mov.asm +++ b/pwnlib/shellcraft/templates/loongarch64/mov.asm @@ -4,7 +4,6 @@ from pwnlib.context import context as ctx # Ugly hack, mako will not let it be called context from pwnlib.log import getLogger from pwnlib.shellcraft import loongarch64, registers, pretty, okay - import six log = getLogger('pwnlib.shellcraft.loongarch64.mov') %> <%page args="dst, src"/> diff --git a/pwnlib/shellcraft/templates/loongarch64/push.asm b/pwnlib/shellcraft/templates/loongarch64/push.asm index 6e0d71bba..52f82482b 100644 --- a/pwnlib/shellcraft/templates/loongarch64/push.asm +++ b/pwnlib/shellcraft/templates/loongarch64/push.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import loongarch64 from pwnlib import constants from pwnlib.shellcraft import registers - from six import text_type, binary_type %> <%page args="value"/> <%docstring> @@ -13,7 +12,7 @@ Register t8 is not guaranteed to be preserved. <% is_reg = value in registers.loongarch64 -if not is_reg and isinstance(value, (binary_type, text_type)): +if not is_reg and isinstance(value, (bytes, str)): try: value = constants.eval(value) except (ValueError, AttributeError): diff --git a/pwnlib/shellcraft/templates/loongarch64/pushstr.asm b/pwnlib/shellcraft/templates/loongarch64/pushstr.asm index 0dc7abb56..292d0d9c2 100644 --- a/pwnlib/shellcraft/templates/loongarch64/pushstr.asm +++ b/pwnlib/shellcraft/templates/loongarch64/pushstr.asm @@ -1,7 +1,6 @@ <% from pwnlib.util import lists, packing, fiddling from pwnlib.shellcraft import loongarch64, pretty - import six %>\ <%page args="string, append_null = True"/> <%docstring> @@ -57,7 +56,7 @@ Args: append_null (bool): Whether to append a single NULL-byte before pushing. <% - if isinstance(string, six.text_type): + if isinstance(string, str): string = string.encode('utf-8') if append_null: string += b'\x00' diff --git a/pwnlib/shellcraft/templates/mips/freebsd/syscall.asm b/pwnlib/shellcraft/templates/mips/freebsd/syscall.asm index 391955f75..f8c5bf981 100644 --- a/pwnlib/shellcraft/templates/mips/freebsd/syscall.asm +++ b/pwnlib/shellcraft/templates/mips/freebsd/syscall.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import mips, pretty from pwnlib.constants import Constant from pwnlib.abi import freebsd_mips_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None"/> <%docstring> @@ -53,7 +52,7 @@ Example: syscall 0x40404 <% - if isinstance(syscall, (str, text_type, Constant)) and str(syscall).startswith('SYS_'): + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: diff --git a/pwnlib/shellcraft/templates/mips/linux/syscall.asm b/pwnlib/shellcraft/templates/mips/linux/syscall.asm index 07cf02f6c..ea19cdbea 100644 --- a/pwnlib/shellcraft/templates/mips/linux/syscall.asm +++ b/pwnlib/shellcraft/templates/mips/linux/syscall.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import mips, pretty from pwnlib.constants import Constant from pwnlib.abi import linux_mips_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4=None, arg5=None"/> <%docstring> @@ -88,7 +87,7 @@ Example: syscall 0x40404 <% - if isinstance(syscall, (str, text_type, Constant)) and str(syscall).startswith('SYS_'): + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: diff --git a/pwnlib/shellcraft/templates/mips/mov.asm b/pwnlib/shellcraft/templates/mips/mov.asm index 9eb795f3a..4d307fc7b 100644 --- a/pwnlib/shellcraft/templates/mips/mov.asm +++ b/pwnlib/shellcraft/templates/mips/mov.asm @@ -4,7 +4,6 @@ from pwnlib.context import context as ctx # Ugly hack, mako will not let it be called context from pwnlib.log import getLogger from pwnlib.shellcraft import mips, registers, pretty, okay - import six log = getLogger('pwnlib.shellcraft.mips.mov') %> <%page args="dst, src"/> @@ -109,7 +108,7 @@ if src_reg == 0: ${mips.mov('$t9', src)} ${mips.mov(dst, '$t9')} %endif -% elif isinstance(src, six.integer_types): +% elif isinstance(src, int): ## Everything else is the general case for moving into registers. <% srcp = packing.pack(src, word_size=32) diff --git a/pwnlib/shellcraft/templates/mips/push.asm b/pwnlib/shellcraft/templates/mips/push.asm index 43dc293a9..ca29b818e 100644 --- a/pwnlib/shellcraft/templates/mips/push.asm +++ b/pwnlib/shellcraft/templates/mips/push.asm @@ -3,7 +3,6 @@ from pwnlib.shellcraft import mips from pwnlib import constants from pwnlib.shellcraft import registers - from six import text_type, binary_type import re %> <%page args="value"/> @@ -14,7 +13,7 @@ Pushes a value onto the stack. value_orig = value is_reg = value in registers.mips -if not is_reg and isinstance(value, (binary_type, text_type)): +if not is_reg and isinstance(value, (bytes, str)): try: value = constants.eval(value) except (ValueError, AttributeError): diff --git a/pwnlib/shellcraft/templates/mips/pushstr.asm b/pwnlib/shellcraft/templates/mips/pushstr.asm index e4025a148..2bacfe62a 100644 --- a/pwnlib/shellcraft/templates/mips/pushstr.asm +++ b/pwnlib/shellcraft/templates/mips/pushstr.asm @@ -1,7 +1,6 @@ <% from pwnlib.util import lists, packing, fiddling from pwnlib.shellcraft import mips, pretty - import six %>\ <%page args="string, append_null = True"/> <%docstring> @@ -74,7 +73,7 @@ Args: append_null (bool): Whether to append a single NULL-byte before pushing. <% - if isinstance(string, six.text_type): + if isinstance(string, str): string = string.encode('utf-8') if append_null: string += b'\x00' diff --git a/pwnlib/shellcraft/templates/riscv64/linux/kill.asm b/pwnlib/shellcraft/templates/riscv64/linux/kill.asm new file mode 120000 index 000000000..118bebff8 --- /dev/null +++ b/pwnlib/shellcraft/templates/riscv64/linux/kill.asm @@ -0,0 +1 @@ +../../common/linux/kill.asm \ No newline at end of file diff --git a/pwnlib/shellcraft/templates/riscv64/linux/sleep.asm b/pwnlib/shellcraft/templates/riscv64/linux/sleep.asm new file mode 120000 index 000000000..5949528ed --- /dev/null +++ b/pwnlib/shellcraft/templates/riscv64/linux/sleep.asm @@ -0,0 +1 @@ +../../common/linux/sleep.asm \ No newline at end of file diff --git a/pwnlib/shellcraft/templates/riscv64/linux/syscall.asm b/pwnlib/shellcraft/templates/riscv64/linux/syscall.asm index 85bd4bdd1..1d6766758 100644 --- a/pwnlib/shellcraft/templates/riscv64/linux/syscall.asm +++ b/pwnlib/shellcraft/templates/riscv64/linux/syscall.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import riscv64, pretty from pwnlib.constants import Constant from pwnlib.abi import linux_riscv64_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4=None, arg5=None"/> <%docstring> @@ -79,7 +78,7 @@ Example: ecall <% - if isinstance(syscall, (str, text_type, Constant)) and str(syscall).startswith('SYS_'): + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: diff --git a/pwnlib/shellcraft/templates/riscv64/mov.asm b/pwnlib/shellcraft/templates/riscv64/mov.asm index 8005b47d1..4feaff586 100644 --- a/pwnlib/shellcraft/templates/riscv64/mov.asm +++ b/pwnlib/shellcraft/templates/riscv64/mov.asm @@ -4,7 +4,6 @@ from pwnlib.context import context as ctx # Ugly hack, mako will not let it be called context from pwnlib.log import getLogger from pwnlib.shellcraft import riscv64, registers, pretty, okay - import six log = getLogger('pwnlib.shellcraft.riscv64.mov') %> <%page args="dst, src"/> diff --git a/pwnlib/shellcraft/templates/riscv64/push.asm b/pwnlib/shellcraft/templates/riscv64/push.asm index 0a9f97adc..10f6ded49 100644 --- a/pwnlib/shellcraft/templates/riscv64/push.asm +++ b/pwnlib/shellcraft/templates/riscv64/push.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import riscv64 from pwnlib import constants from pwnlib.shellcraft import registers - from six import text_type, binary_type %> <%page args="value"/> <%docstring> @@ -13,7 +12,7 @@ Register t4 is not guaranteed to be preserved. <% is_reg = value in registers.riscv -if not is_reg and isinstance(value, (binary_type, text_type)): +if not is_reg and isinstance(value, (bytes, str)): try: value = constants.eval(value) except (ValueError, AttributeError): diff --git a/pwnlib/shellcraft/templates/riscv64/pushstr.asm b/pwnlib/shellcraft/templates/riscv64/pushstr.asm index 252536e27..e7aae9961 100644 --- a/pwnlib/shellcraft/templates/riscv64/pushstr.asm +++ b/pwnlib/shellcraft/templates/riscv64/pushstr.asm @@ -1,7 +1,6 @@ <% from pwnlib.util import lists, packing, fiddling from pwnlib.shellcraft import riscv64, pretty - import six %>\ <%page args="string, append_null = True"/> <%docstring> @@ -71,7 +70,7 @@ Args: append_null (bool): Whether to append a single NULL-byte before pushing. <% - if isinstance(string, six.text_type): + if isinstance(string, str): string = string.encode('utf-8') if append_null: string += b'\x00' diff --git a/pwnlib/shellcraft/templates/thumb/freebsd/syscall.asm b/pwnlib/shellcraft/templates/thumb/freebsd/syscall.asm index ec4238e3a..9598d5da7 100644 --- a/pwnlib/shellcraft/templates/thumb/freebsd/syscall.asm +++ b/pwnlib/shellcraft/templates/thumb/freebsd/syscall.asm @@ -2,7 +2,6 @@ from pwnlib.shellcraft import thumb, pretty from pwnlib.constants import Constant from pwnlib.abi import freebsd_arm_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None"/> <%docstring> @@ -28,7 +27,7 @@ Example: svc 0x41 <% - if isinstance(syscall, (str, text_type, Constant)) and str(syscall).startswith('SYS_'): + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: diff --git a/pwnlib/shellcraft/templates/thumb/linux/stage.asm b/pwnlib/shellcraft/templates/thumb/linux/stage.asm index bc480401a..635c5bf7f 100644 --- a/pwnlib/shellcraft/templates/thumb/linux/stage.asm +++ b/pwnlib/shellcraft/templates/thumb/linux/stage.asm @@ -1,5 +1,4 @@ <% -import six from pwnlib.shellcraft.thumb import push from pwnlib.shellcraft.thumb.linux import read, readn, mmap from pwnlib import constants as C @@ -29,7 +28,7 @@ Example: protection = C.PROT_READ | C.PROT_WRITE | C.PROT_EXEC flags = C.MAP_ANONYMOUS | C.MAP_PRIVATE - assert isinstance(fd, six.integer_types) + assert isinstance(fd, int) %> %if length is None: /* How many bytes should we receive? */ diff --git a/pwnlib/shellcraft/templates/thumb/linux/syscall.asm b/pwnlib/shellcraft/templates/thumb/linux/syscall.asm index d0720c3ea..dbb102c89 100644 --- a/pwnlib/shellcraft/templates/thumb/linux/syscall.asm +++ b/pwnlib/shellcraft/templates/thumb/linux/syscall.asm @@ -1,8 +1,7 @@ <% from pwnlib.shellcraft import thumb, pretty - from pwnlib.constants import eval + from pwnlib.constants import Constant from pwnlib.abi import linux_arm_syscall as abi - from six import text_type %> <%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4 = None, arg5 = None, arg6 = None"/> <%docstring> @@ -57,8 +56,8 @@ Example: <% - if isinstance(syscall, (str, text_type)) and syscall.startswith('SYS_'): - syscall_repr = syscall[4:] + "(%s)" + if isinstance(syscall, (str, Constant)) and str(syscall).startswith('SYS_'): + syscall_repr = str(syscall)[4:] + "(%s)" args = [] else: syscall_repr = 'syscall(%s)' diff --git a/pwnlib/shellcraft/templates/thumb/mov.asm b/pwnlib/shellcraft/templates/thumb/mov.asm index 2ce65b37e..2bf11ce48 100644 --- a/pwnlib/shellcraft/templates/thumb/mov.asm +++ b/pwnlib/shellcraft/templates/thumb/mov.asm @@ -3,7 +3,6 @@ from pwnlib.log import getLogger from pwnlib.util import fiddling from pwnlib.context import context as ctx # Ugly hack, mako will not let it be called context - import six %> <%page args="dst, src"/> <%docstring> @@ -60,7 +59,7 @@ Example: <% log = getLogger(__name__) src_orig = src -if isinstance(src, (six.binary_type, six.text_type)): +if isinstance(src, (bytes, str)): src = src.strip() if src.lower() in registers.arm: src = src.lower() @@ -110,7 +109,7 @@ if not src in registers.arm: %> % if dst == src: /* moving ${src} into ${dst}, but this is a no-op */ -% elif not isinstance(src, six.integer_types): +% elif not isinstance(src, int): mov ${dst}, ${src} % else: <% diff --git a/pwnlib/shellcraft/templates/thumb/push.asm b/pwnlib/shellcraft/templates/thumb/push.asm index 00a65bb33..a2939cf0c 100644 --- a/pwnlib/shellcraft/templates/thumb/push.asm +++ b/pwnlib/shellcraft/templates/thumb/push.asm @@ -3,7 +3,6 @@ from pwnlib.shellcraft import thumb, registers, pretty from pwnlib import constants from pwnlib.context import context as ctx # Ugly hack, mako will not let it be called context - import six import re %> <%page args="value"/> @@ -50,7 +49,7 @@ Example: value_orig = value is_register = value in registers.arm -if not is_register and isinstance(value, (six.binary_type, six.text_type)): +if not is_register and isinstance(value, (bytes, str)): try: with ctx.local(arch = 'thumb'): value = constants.eval(value) @@ -60,7 +59,7 @@ if not is_register and isinstance(value, (six.binary_type, six.text_type)): % if is_register: push {${value}} -% elif isinstance(value, six.integer_types): +% elif isinstance(value, int): /* push ${pretty(value_orig, False)} */ ${re.sub(r'^\s*/.*\n', '', thumb.pushstr(packing.pack(value), False), 1)} % else: diff --git a/pwnlib/shellcraft/templates/thumb/pushstr.asm b/pwnlib/shellcraft/templates/thumb/pushstr.asm index be227c9d2..1aca76b96 100644 --- a/pwnlib/shellcraft/templates/thumb/pushstr.asm +++ b/pwnlib/shellcraft/templates/thumb/pushstr.asm @@ -1,7 +1,6 @@ <% from pwnlib.shellcraft import thumb, pretty from pwnlib.util import lists, packing - import six %> <%page args="string, append_null = True, register = 'r7'"/> <%docstring> @@ -36,7 +35,7 @@ on your version of binutils. <% - if isinstance(string, six.text_type): + if isinstance(string, str): string = string.encode('utf-8') if append_null: string += b'\x00' diff --git a/pwnlib/term/key.py b/pwnlib/term/key.py index e21477a46..2ce8eda98 100644 --- a/pwnlib/term/key.py +++ b/pwnlib/term/key.py @@ -4,7 +4,6 @@ import errno import os import select -import six import string import sys @@ -149,7 +148,7 @@ def __repr__(self): return self.__str__() def __eq__(self, other): - if isinstance(other, (six.text_type, six.binary_type)): + if isinstance(other, (bytes, str)): return Matcher(other)(self) elif isinstance(other, Matcher): return other(self) @@ -284,7 +283,7 @@ def _csi_ss3(cmd, args): return k def _csi_u(cmd, args): - k = Key(kc.TYPE_UNICODE, six.unichr(args[0])) + k = Key(kc.TYPE_UNICODE, chr(args[0])) if len(args) > 1 and args[1]: k.mods |= args[1] - 1 return k @@ -457,17 +456,17 @@ def _peek_simple(): if c0 == 0: k.code = u' ' elif chr(c0 + 0x40) in string.ascii_uppercase: - k.code = six.unichr(c0 + 0x60) + k.code = chr(c0 + 0x60) else: - k.code = six.unichr(c0 + 0x40) + k.code = chr(c0 + 0x40) k.mods |= kc.MOD_CTRL elif c0 == 0x7f: # print('del\r') k = Key(kc.TYPE_KEYSYM, kc.KEY_DEL) elif c0 >= 0x20 and c0 < 0x80: - k = Key(kc.TYPE_UNICODE, six.unichr(c0)) + k = Key(kc.TYPE_UNICODE, chr(c0)) else: - k = Key(kc.TYPE_UNICODE, six.unichr(c0 - 0x40), kc.MOD_CTRL | kc.MOD_ALT) + k = Key(kc.TYPE_UNICODE, chr(c0 - 0x40), kc.MOD_CTRL | kc.MOD_ALT) else: # utf8 n = 0 if c0 & 0b11100000 == 0b11000000: diff --git a/pwnlib/term/readline.py b/pwnlib/term/readline.py index d9c03c4fe..82536b6eb 100644 --- a/pwnlib/term/readline.py +++ b/pwnlib/term/readline.py @@ -4,7 +4,6 @@ from __future__ import print_function import io -import six import sys import os @@ -379,7 +378,7 @@ def readline(_size=-1, prompt='', float=True, priority=10): # XXX circular imports from pwnlib.term import term_mode if not term_mode: - six.print_(prompt, end='', flush=True) + print(prompt, end='', flush=True) return getattr(sys.stdin, 'buffer', sys.stdin).readline(_size).rstrip(b'\n') show_suggestions = False eof = False @@ -482,7 +481,7 @@ def init(): global safeeval # defer imports until initialization import sys - from six.moves import builtins + import builtins from pwnlib.util import safeeval class Wrapper: @@ -497,8 +496,4 @@ def __getattr__(self, k): return getattr(self._fd, k) sys.stdin = Wrapper(sys.stdin) - if six.PY2: - builtins.raw_input = raw_input - builtins.input = eval_input - else: - builtins.input = str_input + builtins.input = str_input diff --git a/pwnlib/tubes/server.py b/pwnlib/tubes/server.py index 6f630f5bb..5bb5deb3b 100644 --- a/pwnlib/tubes/server.py +++ b/pwnlib/tubes/server.py @@ -9,7 +9,7 @@ from pwnlib.log import getLogger from pwnlib.tubes.sock import sock from pwnlib.tubes.remote import remote -from six.moves.queue import Queue +from queue import Queue log = getLogger(__name__) diff --git a/pwnlib/tubes/sock.py b/pwnlib/tubes/sock.py index 022eb4814..4751f7d5c 100644 --- a/pwnlib/tubes/sock.py +++ b/pwnlib/tubes/sock.py @@ -3,7 +3,6 @@ import errno import select -import six import socket from pwnlib.log import getLogger @@ -212,7 +211,7 @@ def shutdown_raw(self, direction): @classmethod def _get_family(cls, fam): - if isinstance(fam, six.integer_types): + if isinstance(fam, int): pass elif fam == 'any': fam = socket.AF_UNSPEC @@ -229,7 +228,7 @@ def _get_family(cls, fam): @classmethod def _get_type(cls, typ): - if isinstance(typ, six.integer_types): + if isinstance(typ, int): pass elif typ == "tcp": typ = socket.SOCK_STREAM diff --git a/pwnlib/tubes/ssh.py b/pwnlib/tubes/ssh.py index 6c76746b7..a22accb47 100644 --- a/pwnlib/tubes/ssh.py +++ b/pwnlib/tubes/ssh.py @@ -5,7 +5,6 @@ import os import re import shutil -import six import string import sys import tarfile @@ -68,7 +67,7 @@ def __init__(self, parent, process = None, tty = False, cwd = None, env = None, self.env = env self.process = process self.cwd = cwd or '.' - if isinstance(cwd, six.text_type): + if isinstance(cwd, str): cwd = packing._need_bytes(cwd, 2, 0x80) env = env or {} @@ -76,7 +75,7 @@ def __init__(self, parent, process = None, tty = False, cwd = None, env = None, if isinstance(process, (list, tuple)): process = b' '.join(sh_string(packing._need_bytes(s, 2, 0x80)) for s in process) - if isinstance(process, six.text_type): + if isinstance(process, str): process = packing._need_bytes(process, 2, 0x80) if process and cwd: @@ -1813,12 +1812,12 @@ def set_working_directory(self, wd = None, symlink = False): """ status = 0 - if symlink and not isinstance(symlink, (six.binary_type, six.text_type)): + if symlink and not isinstance(symlink, (bytes, str)): symlink = os.path.join(self.pwd(), b'*') if not hasattr(symlink, 'encode') and hasattr(symlink, 'decode'): symlink = symlink.decode('utf-8') - if isinstance(wd, six.text_type): + if isinstance(wd, str): wd = packing._need_bytes(wd, 2, 0x80) if not wd: diff --git a/pwnlib/tubes/tube.py b/pwnlib/tubes/tube.py index 22fa29cb8..47afa0055 100644 --- a/pwnlib/tubes/tube.py +++ b/pwnlib/tubes/tube.py @@ -6,15 +6,12 @@ import logging import os import re -import six import string import subprocess import sys import threading import time -from six.moves import range - from pwnlib import atexit from pwnlib import term from pwnlib.context import context @@ -364,7 +361,7 @@ def recvuntil(self, delims, drop=False, timeout=default): """ # Convert string into singleton tupple - if isinstance(delims, (bytes, bytearray, six.text_type)): + if isinstance(delims, (bytes, bytearray, str)): delims = (delims,) delims = tuple(map(packing._need_bytes, delims)) @@ -660,7 +657,7 @@ def recvline_contains(self, items, keepends=None, drop=None, timeout=default): >>> t.recvline_contains((b'car', b'train')) b'bicycle car train' """ - if isinstance(items, (bytes, bytearray, six.text_type)): + if isinstance(items, (bytes, bytearray, str)): items = (items,) items = tuple(map(packing._need_bytes, items)) @@ -698,7 +695,7 @@ def recvline_startswith(self, delims, keepends=None, drop=None, timeout=default) b'World' """ # Convert string into singleton tupple - if isinstance(delims, (bytes, bytearray, six.text_type)): + if isinstance(delims, (bytes, bytearray, str)): delims = (delims,) delims = tuple(map(packing._need_bytes, delims)) @@ -730,7 +727,7 @@ def recvline_endswith(self, delims, keepends=None, drop=None, timeout=default): b'Kaboodle' """ # Convert string into singleton tupple - if isinstance(delims, (bytes, bytearray, six.text_type)): + if isinstance(delims, (bytes, bytearray, str)): delims = (delims,) delims = tuple(packing._need_bytes(delim) + self.newline for delim in delims) @@ -766,7 +763,7 @@ def recvregex(self, regex, exact=False, timeout=default, capture=False): b'Bla blubb blargh\n' """ - if isinstance(regex, (bytes, bytearray, six.text_type)): + if isinstance(regex, (bytes, bytearray, str)): regex = packing._need_bytes(regex) regex = re.compile(regex) @@ -793,7 +790,7 @@ def recvline_regex(self, regex, exact=False, keepends=None, drop=None, timeout=d all data is buffered and an empty string (``''``) is returned. """ - if isinstance(regex, (bytes, bytearray, six.text_type)): + if isinstance(regex, (bytes, bytearray, str)): regex = packing._need_bytes(regex) regex = re.compile(regex) @@ -1199,9 +1196,7 @@ def upload_manually(self, data, target_path = './payload', prompt = b'$', chunk_ # Detect available compression utility, fallback to uncompressed upload. compression_mode = None - possible_compression = ['gzip'] - if six.PY3: - possible_compression.insert(0, 'xz') + possible_compression = ['xz', 'gzip'] if not prompt: self.sendline("echo {}".format(end_marker).encode()) if compression == 'auto': @@ -1225,7 +1220,7 @@ def upload_manually(self, data, target_path = './payload', prompt = b'$', chunk_ compressed_path = target_path + '.xz' elif compression_mode == 'gzip': import gzip - from six import BytesIO + from io import BytesIO f = BytesIO() with gzip.GzipFile(fileobj=f, mode='wb', compresslevel=9) as g: g.write(data) diff --git a/pwnlib/ui.py b/pwnlib/ui.py index 95f89ad27..2789f6eba 100644 --- a/pwnlib/ui.py +++ b/pwnlib/ui.py @@ -3,7 +3,6 @@ import os import signal -import six import string import struct import subprocess @@ -180,7 +179,7 @@ def options(prompt, opts, default = None): Choice 2 """ - if default is not None and not isinstance(default, six.integer_types): + if default is not None and not isinstance(default, int): raise ValueError('options(): default must be a number or None') if term.term_mode: @@ -294,7 +293,7 @@ def pause(n=None): else: log.info('Paused (press enter to continue)') raw_input('') - elif isinstance(n, six.integer_types): + elif isinstance(n, int): with log.waitfor("Waiting") as l: for i in range(n, 0, -1): l.status('%d... ' % i) diff --git a/pwnlib/util/crc/__init__.py b/pwnlib/util/crc/__init__.py index 80a5c5649..b5c6c5e40 100644 --- a/pwnlib/util/crc/__init__.py +++ b/pwnlib/util/crc/__init__.py @@ -20,7 +20,6 @@ from __future__ import absolute_import from __future__ import division -import six import sys import types @@ -73,7 +72,7 @@ class BitPolynom(object): def __init__(self, n): - if isinstance(n, (bytes, six.text_type)): + if isinstance(n, (bytes, bytearray, str)): from pwnlib.util.packing import _need_text n = _need_text(n) self.n = 0 @@ -81,13 +80,13 @@ def __init__(self, n): try: for p in n.split('+'): k = safeeval.values(p.strip(), {'x': x, 'X': x}) - assert isinstance(k, (BitPolynom,)+six.integer_types) + assert isinstance(k, (BitPolynom, int)) k = int(k) assert k >= 0 self.n ^= k except (ValueError, NameError, AssertionError): raise ValueError("Not a valid polynomial: %s" % n) - elif isinstance(n, six.integer_types): + elif isinstance(n, int): if n >= 0: self.n = n else: @@ -297,7 +296,7 @@ def generic_crc(data, polynom, width, init, refin, refout, xorout): # refin is not meaningful in this case inlen = len(data) p = BitPolynom(int(''.join('1' if v else '0' for v in data), 2)) - elif isinstance(data, six.binary_type): + elif isinstance(data, bytes): inlen = len(data)*8 if refin: data = fiddling.bitswap(data) diff --git a/pwnlib/util/cyclic.py b/pwnlib/util/cyclic.py index 316b70ec5..3271892c8 100644 --- a/pwnlib/util/cyclic.py +++ b/pwnlib/util/cyclic.py @@ -1,7 +1,6 @@ from __future__ import absolute_import from __future__ import division -import six import string from pwnlib.context import context, LocalNoarchContext @@ -217,7 +216,7 @@ def cyclic_find(subseq, alphabet = None, n = None): if n is None: n = context.cyclic_size - if isinstance(subseq, six.integer_types): + if isinstance(subseq, int): if subseq >= 2**(8*n): # Assumption: The user has given an integer that is more than 2**(8n) bits, but would otherwise fit within # a register of size 2**(8m) where m is a multiple of four @@ -339,7 +338,7 @@ def cyclic_metasploit_find(subseq, sets = None): """ sets = sets or [ string.ascii_uppercase.encode(), string.ascii_lowercase.encode(), string.digits.encode() ] - if isinstance(subseq, six.integer_types): + if isinstance(subseq, int): subseq = packing.pack(subseq, 'all', 'little', False) return _gen_find(subseq, metasploit_pattern(sets)) @@ -362,10 +361,10 @@ def _gen_find(subseq, generator): return -1 def _join_sequence(seq, alphabet): - if isinstance(alphabet, six.text_type): + if isinstance(alphabet, str): return ''.join(seq) elif isinstance(alphabet, bytes): - return bytes(bytearray(seq)) + return bytes(seq) else: return seq diff --git a/pwnlib/util/fiddling.py b/pwnlib/util/fiddling.py index 51541be2f..967892fd1 100644 --- a/pwnlib/util/fiddling.py +++ b/pwnlib/util/fiddling.py @@ -7,11 +7,9 @@ import random import re import os -import six import string -from six import BytesIO -from six.moves import range +from io import BytesIO from pwnlib.context import LocalNoarchContext from pwnlib.context import context @@ -149,7 +147,7 @@ def bits(s, endian = 'big', zero = 0, one = 1): out += byte else: out += byte[::-1] - elif isinstance(s, six.integer_types): + elif isinstance(s, int): if s < 0: s = s & ((1<> (word_size - k)) n &= (1 << word_size) - 1 @@ -556,7 +554,7 @@ def isprint(c): """isprint(c) -> bool Return True if a character is printable""" - if isinstance(c, six.text_type): + if isinstance(c, str): c = ord(c) t = bytearray(string.ascii_letters + string.digits + string.punctuation + ' ', 'ascii') return c in t diff --git a/pwnlib/util/iters.py b/pwnlib/util/iters.py index a044e3079..c64f41120 100644 --- a/pwnlib/util/iters.py +++ b/pwnlib/util/iters.py @@ -11,7 +11,6 @@ import random import time from itertools import * -from six.moves import map, filter, filterfalse, range, zip, zip_longest from pwnlib.context import context from pwnlib.log import getLogger @@ -53,11 +52,8 @@ 'cycle' , 'dropwhile' , 'groupby' , - 'filter' , 'filterfalse' , - 'map' , 'islice' , - 'zip' , 'zip_longest' , 'permutations' , 'product' , diff --git a/pwnlib/util/lists.py b/pwnlib/util/lists.py index ada0c44f7..5ee47487e 100644 --- a/pwnlib/util/lists.py +++ b/pwnlib/util/lists.py @@ -1,9 +1,6 @@ from __future__ import division import collections -import six - -from six.moves import range def partition(lst, f, save_keys = False): @@ -77,8 +74,8 @@ def group(n, lst, underfull_action = 'ignore', fill_value = None): fill_value = (fill_value,) elif isinstance(lst, list): fill_value = [fill_value] - elif isinstance(lst, (bytes, six.text_type)): - if not isinstance(fill_value, (bytes, six.text_type)): + elif isinstance(lst, (bytes, str)): + if not isinstance(fill_value, (bytes, str)): raise ValueError("group(): cannot fill a string with a non-string") else: raise ValueError("group(): 'lst' must be either a tuple, list or string") diff --git a/pwnlib/util/misc.py b/pwnlib/util/misc.py index 58739c151..3b5682e8d 100644 --- a/pwnlib/util/misc.py +++ b/pwnlib/util/misc.py @@ -6,7 +6,6 @@ import os import re import signal -import six import socket import stat import string @@ -214,13 +213,13 @@ def normalize_argv_env(argv, env, log, level=2): # - Each string must not contain '\x00' # argv = argv or [] - if isinstance(argv, (six.text_type, six.binary_type)): + if isinstance(argv, (str, bytes, bytearray)): argv = [argv] if not isinstance(argv, (list, tuple)): log.error('argv must be a list or tuple: %r' % argv) - if not all(isinstance(arg, (six.text_type, bytes, bytearray)) for arg in argv): + if not all(isinstance(arg, (str, bytes, bytearray)) for arg in argv): log.error("argv must be strings or bytes: %r" % argv) # Create a duplicate so we can modify it @@ -247,13 +246,13 @@ def normalize_argv_env(argv, env, log, level=2): env_items = env if env: for k,v in env_items: - if not isinstance(k, (bytes, six.text_type)): + if not isinstance(k, (bytes, str)): log.error('Environment keys must be strings: %r' % k) # Check if = is in the key, Required check since we sometimes call ctypes.execve directly # https://github.com/python/cpython/blob/025995feadaeebeef5d808f2564f0fd65b704ea5/Modules/posixmodule.c#L6476 if b'=' in packing._encode(k): log.error('Environment keys may not contain "=": %r' % (k)) - if not isinstance(v, (bytes, six.text_type)): + if not isinstance(v, (bytes, str)): log.error('Environment values must be strings: %r=%r' % (k,v)) k = packing._need_bytes(k, level, 0x80) # ASCII text is okay v = packing._need_bytes(v, level, 0x80) # ASCII text is okay @@ -397,7 +396,7 @@ def run_in_new_terminal(command, terminal=None, args=None, kill_at_exit=True, pr argv = [which(terminal)] + args - if isinstance(command, six.string_types): + if isinstance(command, str): if ';' in command: log.error("Cannot use commands with semicolon. Create a script and invoke that directly.") argv += [command] @@ -493,7 +492,7 @@ def run_in_new_terminal(command, terminal=None, args=None, kill_at_exit=True, pr # Otherwise it's better to return nothing instead of a know wrong pid. from pwnlib.util.proc import pid_by_name pid = None - ran_program = command.split(' ')[0] if isinstance(command, six.string_types) else command[0] + ran_program = command.split(' ')[0] if isinstance(command, str) else command[0] t = Timeout() with t.countdown(timeout=5): while t.timeout: @@ -696,16 +695,6 @@ def register_sizes(regs, in_sizes): return lists.concat(regs), sizes, bigger, smaller -def python_2_bytes_compatible(klass): - """ - A class decorator that defines __str__ methods under Python 2. - Under Python 3 it does nothing. - """ - if six.PY2: - if '__str__' not in klass.__dict__: - klass.__str__ = klass.__bytes__ - return klass - def _create_execve_script(argv=None, executable=None, cwd=None, env=None, ignore_environ=None, stdin=0, stdout=1, stderr=2, preexec_fn=None, preexec_args=(), aslr=None, setuid=None, shell=False, log=log): @@ -771,7 +760,7 @@ def _create_execve_script(argv=None, executable=None, cwd=None, env=None, ignore cwd = cwd or '.' # Validate, since failures on the remote side will suck. - if not isinstance(executable, (six.text_type, six.binary_type, bytearray)): + if not isinstance(executable, (str, bytes, bytearray)): log.error("executable / argv[0] must be a string: %r" % executable) executable = bytearray(packing._need_bytes(executable, min_wrong=0x80)) diff --git a/pwnlib/util/packing.py b/pwnlib/util/packing.py index 1886da2b6..e6a55f9a8 100644 --- a/pwnlib/util/packing.py +++ b/pwnlib/util/packing.py @@ -34,13 +34,10 @@ from __future__ import division import collections -import six import struct import sys import warnings -from six.moves import range - from pwnlib.context import LocalNoarchContext from pwnlib.context import context from pwnlib.log import getLogger @@ -115,8 +112,8 @@ def pack(number, word_size = None, endianness = None, sign = None, **kwargs): endianness = context.endianness sign = context.sign - if not isinstance(number, six.integer_types): - raise ValueError("pack(): number must be of type (int,long) (got %r)" % type(number)) + if not isinstance(number, int): + raise ValueError("pack(): number must be of type int (got %r)" % type(number)) if not isinstance(sign, bool): raise ValueError("pack(): sign must be either True or False (got %r)" % sign) @@ -137,7 +134,7 @@ def pack(number, word_size = None, endianness = None, sign = None, **kwargs): if not sign: raise ValueError("pack(): number does not fit within word_size") word_size = ((number + 1).bit_length() | 7) + 1 - elif not isinstance(word_size, six.integer_types) or word_size <= 0: + elif not isinstance(word_size, int) or word_size <= 0: raise ValueError("pack(): word_size must be a positive integer or the string 'all'") if sign: @@ -214,7 +211,7 @@ def unpack(data, word_size = None): # Verify that word_size make sense if word_size == 'all': word_size = len(data) * 8 - elif not isinstance(word_size, six.integer_types) or word_size <= 0: + elif not isinstance(word_size, int) or word_size <= 0: raise ValueError("unpack(): word_size must be a positive integer or the string 'all'") byte_size = (word_size + 7) // 8 @@ -658,10 +655,10 @@ def fill(key): pieces_ = dict() large_key = 2**(context.word_size-8) for k, v in pieces.items(): - if isinstance(k, six.integer_types): + if isinstance(k, int): if k >= large_key: k = fill(pack(k)) - elif isinstance(k, (six.text_type, bytearray, bytes)): + elif isinstance(k, (str, bytearray, bytes)): k = fill(_need_bytes(k, stacklevel, 0x80)) else: raise TypeError("flat(): offset must be of type int or str, but got '%s'" % type(k)) @@ -731,9 +728,9 @@ def _flat(args, preprocessor, packer, filler, stacklevel=1): filler, val = _fit(arg, preprocessor, packer, filler, stacklevel + 1) elif isinstance(arg, bytes): val = arg - elif isinstance(arg, six.text_type): + elif isinstance(arg, str): val = _need_bytes(arg, stacklevel + 1) - elif isinstance(arg, six.integer_types): + elif isinstance(arg, int): val = packer(arg) elif isinstance(arg, bytearray): val = bytes(arg) @@ -906,7 +903,7 @@ def flat(*args, **kwargs): length = kwargs.pop('length', None) stacklevel = kwargs.pop('stacklevel', 0) - if isinstance(filler, (str, six.text_type)): + if isinstance(filler, str): filler = bytearray(_need_bytes(filler)) if kwargs != {}: @@ -1056,7 +1053,7 @@ def dd(dst, src, count = 0, skip = 0, seek = 0, truncate = False): # Otherwise get `src` in canonical form, i.e. a string of at most `count` # bytes - if isinstance(src, six.text_type): + if isinstance(src, str): if count: # The only way to know where the `seek`th byte is, is to decode, but # we only need to decode up to the first `seek + count` code points @@ -1098,7 +1095,7 @@ def dd(dst, src, count = 0, skip = 0, seek = 0, truncate = False): break if isinstance(b, bytes): src_ += b - elif isinstance(b, six.integer_types): + elif isinstance(b, int): if b > 255 or b < 0: raise ValueError("dd(): Source value %d at index %d is not in range [0;255]" % (b, i)) src_ += _p8lu(b) @@ -1114,7 +1111,7 @@ def dd(dst, src, count = 0, skip = 0, seek = 0, truncate = False): truncate = skip + len(src) # UTF-8 encode unicode `dst` - if isinstance(dst, six.text_type): + if isinstance(dst, str): dst = dst.encode('utf8') utf8 = True else: @@ -1178,7 +1175,7 @@ def _need_bytes(s, level=1, min_wrong=0): return s.encode(encoding, errors) def _need_text(s, level=1): - if isinstance(s, (str, six.text_type)): + if isinstance(s, str): return s # already text if not isinstance(s, (bytes, bytearray)): @@ -1211,7 +1208,7 @@ def _encode(s): return s.encode(context.encoding) def _decode(b): - if isinstance(b, (str, six.text_type)): + if isinstance(b, str): return b # already text if context.encoding == 'auto': diff --git a/pwnlib/util/safeeval.py b/pwnlib/util/safeeval.py index d0e271def..6819c1546 100644 --- a/pwnlib/util/safeeval.py +++ b/pwnlib/util/safeeval.py @@ -21,8 +21,6 @@ _values_codes = _expr_codes + ['LOAD_NAME'] -import six - def _get_opcodes(codeobj): """_get_opcodes(codeobj) -> [opcodes] @@ -33,19 +31,7 @@ def _get_opcodes(codeobj): [...100, 100, 103, 83] """ import dis - if hasattr(dis, 'get_instructions'): - return [ins.opcode for ins in dis.get_instructions(codeobj)] - i = 0 - opcodes = [] - s = codeobj.co_code - while i < len(s): - code = six.indexbytes(s, i) - opcodes.append(code) - if code >= dis.HAVE_ARGUMENT: - i += 3 - else: - i += 1 - return opcodes + return [ins.opcode for ins in dis.get_instructions(codeobj)] def test_expr(expr, allowed_codes): """test_expr(expr, allowed_codes) -> codeobj diff --git a/pwnlib/util/sh_string.py b/pwnlib/util/sh_string.py index 52699edd2..eb4ca19e9 100644 --- a/pwnlib/util/sh_string.py +++ b/pwnlib/util/sh_string.py @@ -241,7 +241,6 @@ from __future__ import absolute_import from __future__ import division -import six import string import subprocess @@ -258,7 +257,7 @@ def test_all(): test('ab') ## test('a b') ## test(r"a\'b") ## - everything_1 = b''.join(six.int2byte(c) for c in range(1,256)) + everything_1 = bytes(range(1,256)) for s in everything_1: test(s) test(s*4) @@ -271,7 +270,7 @@ def test_all(): test(everything_1) test(everything_1 * 2) test(everything_1 * 4) - everything_2 = b''.join(six.int2byte(c) * 2 for c in range(1,256)) ## + everything_2 = b''.join(bytes([c,c]) for c in range(1,256)) ## test(everything_2) test(randoms(1000, everything_1)) @@ -296,10 +295,10 @@ def test(original): """ input = sh_string(original) - if not isinstance(input, str): - input = input.decode('latin1') + if isinstance(input, str): + input = input.encode() - cmdstr = six.b('/bin/echo %s' % input) + cmdstr = b'/bin/echo %s' % input SUPPORTED_SHELLS = [ ['ash', '-c', cmdstr], diff --git a/pwnlib/util/web.py b/pwnlib/util/web.py index 7e98b67ae..a76ff61b7 100644 --- a/pwnlib/util/web.py +++ b/pwnlib/util/web.py @@ -3,7 +3,6 @@ from __future__ import division import os -import six import tempfile from pwnlib.log import getLogger @@ -70,7 +69,7 @@ def wget(url, save=None, timeout=5, **kwargs): # Save to the target file if provided if save: - if not isinstance(save, (bytes, six.text_type)): + if not isinstance(save, (bytes, str)): save = os.path.basename(url) save = save or tempfile.NamedTemporaryFile(dir='.', delete=False).name with open(save,'wb+') as f: diff --git a/pwnlib/windbg.py b/pwnlib/windbg.py index 588714572..042c49335 100644 --- a/pwnlib/windbg.py +++ b/pwnlib/windbg.py @@ -63,8 +63,6 @@ import subprocess -import six - from pwnlib import tubes from pwnlib.context import LocalContext from pwnlib.context import context @@ -106,7 +104,7 @@ def debug(args, windbgscript=None, exe=None, env=None, creationflags=0, **kwargs instruction of the entry point. """ if isinstance( - args, six.integer_types + (tubes.process.process, tubes.ssh.ssh_channel) + args, (int, tubes.process.process, tubes.ssh.ssh_channel) ): log.error("Use windbg.attach() to debug a running process") @@ -115,7 +113,7 @@ def debug(args, windbgscript=None, exe=None, env=None, creationflags=0, **kwargs return tubes.process.process(args, executable=exe, env=env, creationflags=creationflags) windbgscript = windbgscript or '' - if isinstance(windbgscript, six.string_types): + if isinstance(windbgscript, str): windbgscript = windbgscript.split('\n') # resume main thread windbgscript = ['~0m'] + windbgscript @@ -187,7 +185,7 @@ def attach(target, windbgscript=None, windbg_args=[]): # let's see if we can find a pid to attach to pid = None - if isinstance(target, six.integer_types): + if isinstance(target, int): # target is a pid, easy peasy pid = target elif isinstance(target, str): @@ -213,7 +211,7 @@ def attach(target, windbgscript=None, windbg_args=[]): cmd.extend(['-p', str(pid)]) windbgscript = windbgscript or '' - if isinstance(windbgscript, six.string_types): + if isinstance(windbgscript, str): windbgscript = windbgscript.split('\n') if isinstance(windbgscript, list): windbgscript = ';'.join(script.strip() for script in windbgscript if script.strip()) diff --git a/pyproject.toml b/pyproject.toml index 5b81439e7..50d915270 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ classifiers = [ ] keywords = ["pwntools", "exploit", "ctf", "capture", "the", "flag", "binary", "wargame", "overflow", "stack", "heap", "defcon"] -requires-python = ">=3.4" +requires-python = ">=3.6" dependencies = [ "paramiko>=1.15.2", "mako>=1.0.0", @@ -49,10 +49,9 @@ dependencies = [ "intervaltree>=3.0", "sortedcontainers", "unicorn>=2.0.1", - "six>=1.12.0", "rpyc", "colored_traceback", - "unix-ar; python_version >= '3.6'", + "unix-ar", "zstandard", ]