Add isort, config, and pre-CI hook

This commit is contained in:
Zach Riggle 2016-06-14 12:16:40 -07:00
parent 3f44141c85
commit d97847b872
108 changed files with 271 additions and 143 deletions

4
.isort.cfg Normal file
View File

@ -0,0 +1,4 @@
[settings]
indent=' '
not_skip = __init__.py
force_single_line = 1

View File

@ -17,4 +17,6 @@ install:
- lsb_release -a
- pip install -r requirements.txt
- sudo ./setup.sh
before_script:
- isort --check-only --diff pwndbg
script: nosetests ./tests/

View File

@ -1,4 +1,5 @@
from __future__ import print_function
import sys
from os import path
@ -8,4 +9,4 @@ directory = path.abspath(directory)
sys.path.append(directory)
import pwndbg
import pwndbg # isort:skip

View File

@ -1,9 +1,7 @@
from __future__ import print_function
import idaapi
import idautils
import idc
import functools
import datetime
import functools
import threading
import xmlrpclib
from SimpleXMLRPCServer import SimpleXMLRPCServer

View File

@ -1,10 +1,45 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import gdb
import sys
import gdb
import pwndbg.android
import pwndbg.arch
import pwndbg.arguments
import pwndbg.argv
import pwndbg.color
import pwndbg.commands
import pwndbg.commands.argv
import pwndbg.commands.aslr
import pwndbg.commands.auxv
import pwndbg.commands.checksec
import pwndbg.commands.config
import pwndbg.commands.context
import pwndbg.commands.cpsr
import pwndbg.commands.dt
import pwndbg.commands.dumpargs
import pwndbg.commands.elf
import pwndbg.commands.gdbinit
import pwndbg.commands.heap
import pwndbg.commands.hexdump
import pwndbg.commands.ida
import pwndbg.commands.misc
import pwndbg.commands.next
import pwndbg.commands.peda
import pwndbg.commands.procinfo
import pwndbg.commands.reload
import pwndbg.commands.rop
import pwndbg.commands.search
import pwndbg.commands.segments
import pwndbg.commands.shell
import pwndbg.commands.start
import pwndbg.commands.telescope
import pwndbg.commands.vmmap
import pwndbg.commands.windbg
import pwndbg.commands.xor
import pwndbg.constants
import pwndbg.disasm
import pwndbg.disasm.arm
import pwndbg.disasm.jump
@ -12,6 +47,17 @@ import pwndbg.disasm.mips
import pwndbg.disasm.ppc
import pwndbg.disasm.sparc
import pwndbg.disasm.x86
import pwndbg.dt
import pwndbg.elf
import pwndbg.inthook
import pwndbg.memory
import pwndbg.net
import pwndbg.proc
import pwndbg.regs
import pwndbg.stack
import pwndbg.stdio
import pwndbg.typeinfo
import pwndbg.vmmap
try:
import unicorn
@ -19,50 +65,6 @@ try:
except:
pass
import pwndbg.vmmap
import pwndbg.dt
import pwndbg.memory
import pwndbg.inthook
import pwndbg.elf
import pwndbg.proc
import pwndbg.regs
import pwndbg.stack
import pwndbg.stdio
import pwndbg.color
import pwndbg.typeinfo
import pwndbg.constants
import pwndbg.argv
import pwndbg.net
import pwndbg.android
import pwndbg.commands
import pwndbg.commands.hexdump
import pwndbg.commands.context
import pwndbg.commands.telescope
import pwndbg.commands.vmmap
import pwndbg.commands.dt
import pwndbg.commands.search
import pwndbg.commands.start
import pwndbg.commands.procinfo
import pwndbg.commands.auxv
import pwndbg.commands.windbg
import pwndbg.commands.ida
import pwndbg.commands.reload
import pwndbg.commands.rop
import pwndbg.commands.shell
import pwndbg.commands.aslr
import pwndbg.commands.misc
import pwndbg.commands.next
import pwndbg.commands.dumpargs
import pwndbg.commands.cpsr
import pwndbg.commands.argv
import pwndbg.commands.heap
import pwndbg.commands.segments
import pwndbg.commands.xor
import pwndbg.commands.peda
import pwndbg.commands.gdbinit
import pwndbg.commands.elf
import pwndbg.commands.checksec
import pwndbg.commands.config
__all__ = [

View File

@ -1,7 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import print_function
import pwndbg.arch
class ABI(object):
"""
Encapsulates information about a calling convention.

View File

@ -1,10 +1,12 @@
from __future__ import print_function
import gdb
import pwndbg.color
import pwndbg.events
import pwndbg.file
import pwndbg.remote
def is_android():
try:
if pwndbg.file.get('/system/etc/hosts'):

View File

@ -1,18 +1,19 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import collections
import struct
import sys
from capstone import *
import gdb
import pwndbg.events
import pwndbg.memoize
import pwndbg.regs
import pwndbg.typeinfo
from capstone import *
current = 'i386'
qemu = current
ptrmask = 0xfffffffff
@ -73,4 +74,3 @@ def signed(integer):
def unsigned(integer):
return unpack(pack(integer))

View File

@ -5,21 +5,23 @@ Allows describing functions, specifically enumerating arguments which
may be passed in a combination of registers and stack values.
"""
from __future__ import print_function
from capstone import CS_GRP_CALL
from capstone import CS_GRP_INT
import gdb
import pwndbg.abi
import pwndbg.arch
import pwndbg.constants
import pwndbg.disasm
import pwndbg.functions
import pwndbg.funcparser
import pwndbg.functions
import pwndbg.ida
import pwndbg.memory
import pwndbg.regs
import pwndbg.symbol
import pwndbg.typeinfo
from capstone import CS_GRP_CALL, CS_GRP_INT
ida_replacements = {
'__int64': 'signed long long int',
'__int32': 'signed int',
@ -172,4 +174,3 @@ def argument(n, abi=None):
sp = pwndbg.regs.sp + (n * pwndbg.arch.ptrsize)
return int(pwndbg.memory.poi(pwndbg.typeinfo.ppvoid, sp))

View File

@ -1,6 +1,6 @@
from __future__ import print_function
import gdb
import gdb
import pwndbg.arch
import pwndbg.events
import pwndbg.memory
@ -47,4 +47,3 @@ def update():
envc += 1
except gdb.MemoryError:
pass

View File

@ -1,4 +1,5 @@
from __future__ import print_function
import os
import re
import sys

View File

@ -1,4 +1,5 @@
from __future__ import print_function
import gdb
import pwndbg.color
import pwndbg.enhance

View File

@ -1,5 +1,7 @@
from __future__ import print_function
import functools
import gdb
import pwndbg.config
import pwndbg.enhance

View File

@ -1,11 +1,13 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import functools
import sys
import traceback
import gdb
import gdb
import pwndbg.chain
import pwndbg.color
import pwndbg.enhance
@ -16,9 +18,6 @@ import pwndbg.stdio
import pwndbg.symbol
import pwndbg.ui
import sys
debug = True
class _Command(gdb.Command):

View File

@ -1,4 +1,5 @@
from __future__ import print_function
import gdb
import pwndbg.arch
import pwndbg.argv

View File

@ -1,5 +1,7 @@
from __future__ import print_function
import argparse
import gdb
import pwndbg.color
import pwndbg.commands

View File

@ -1,4 +1,5 @@
from __future__ import print_function
import subprocess
import gdb

View File

@ -7,6 +7,7 @@ import gdb
import pwndbg.commands
import pwndbg.which
@pwndbg.commands.Command
def checksec(file=None):
'''

View File

@ -1,9 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import gdb
import sys
import gdb
import pwndbg.arguments
import pwndbg.chain
import pwndbg.color
@ -19,6 +20,7 @@ import pwndbg.symbol
import pwndbg.ui
import pwndbg.vmmap
# @pwndbg.events.stop
@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning

View File

@ -1,12 +1,14 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import gdb
import pwndbg.arch
import pwndbg.color
import pwndbg.commands
import pwndbg.regs
@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def cpsr():

View File

@ -1,12 +1,15 @@
from __future__ import print_function
import gdb
import pwndbg.vmmap
import pwndbg.commands
import pwndbg.symbol
import pwndbg.memory
import pwndbg.symbol
import pwndbg.vmmap
from pwndbg.color import blue
from pwndbg.color import bold
from pwndbg.color import green
from pwndbg.color import red
from pwndbg.color import bold, blue, green, red
@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning

View File

@ -1,4 +1,5 @@
from __future__ import print_function
import gdb
import pwndbg.color
import pwndbg.commands

View File

@ -1,10 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import pwndbg.commands
import pwndbg.arguments
import pwndbg.commands
import pwndbg.disasm
@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def dumpargs(*a):

View File

@ -1,8 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from elftools.elf.elffile import ELFFile
import gdb
import pwndbg.commands
from elftools.elf.elffile import ELFFile
@pwndbg.commands.Command
def elfheader():

View File

@ -6,9 +6,11 @@ Compatibility functionality for GDBINIT users.
https://github.com/gdbinit/Gdbinit/blob/master/gdbinit
"""
from __future__ import print_function
import gdb
import pwndbg.commands
@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def init():
@ -40,4 +42,3 @@ def entry_point():
"""GDBINIT compatibility alias to print the entry point.
See also the 'entry' command."""
print(hex(pwndbg.elf.entry()))

View File

@ -1,11 +1,13 @@
#!/usr/bin/env python
from __future__ import print_function
import gdb
import pwndbg.commands
from pwndbg.color import bold, yellow, red, underline
from pwndbg.color import bold
from pwndbg.color import red
from pwndbg.color import underline
from pwndbg.color import yellow
PREV_INUSE = 1
IS_MMAPED = 2

View File

@ -1,7 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import pwndbg.arch
import pwndbg.commands
import pwndbg.config

View File

@ -1,4 +1,5 @@
from __future__ import print_function
import bz2
import datetime
import os

View File

@ -1,14 +1,14 @@
from __future__ import print_function
import gdb
import errno as _errno
import struct
import pwndbg as _pwndbg
import gdb
import pwndbg as _pwndbg
import pwndbg.arch as _arch
import pwndbg.commands
import pwndbg.symbol
import pwndbg.regs
import pwndbg.symbol
_errno.errorcode[0] = 'OK'

View File

@ -1,11 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from capstone import *
import collections
import gdb
from capstone import *
import gdb
import pwndbg.arguments
import pwndbg.color
import pwndbg.disasm

View File

@ -4,10 +4,12 @@
Stepping until an event occurs
"""
from __future__ import print_function
import gdb
import pwndbg.commands
import pwndbg.next
@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def nextjmp(*args):
@ -72,4 +74,3 @@ def nextsc(*args):
Breaks at the next syscall.
"""
next_syscall(*args)

View File

@ -1,4 +1,5 @@
from __future__ import print_function
import struct
import gdb

View File

@ -1,15 +1,17 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import gdb
import sys
import gdb
import pwndbg.auxv
import pwndbg.commands
import pwndbg.commands.context
import pwndbg.commands.telescope
import pwndbg.proc
@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def getfile():

View File

@ -1,13 +1,14 @@
from __future__ import print_function
import os
import string
import gdb
import pwndbg.auxv
import pwndbg.commands
import pwndbg.file
import pwndbg.memoize
import pwndbg.net
import pwndbg.file
import pwndbg.proc
try:

View File

@ -1,8 +1,5 @@
from __future__ import print_function
try:
from __builtins__ import reload as _reload
except:
from imp import reload as _reload
import imp
import os
import sys
@ -14,6 +11,12 @@ import pwndbg.commands
import pwndbg.events
import pwndbg.memoize
try:
from __builtins__ import reload as _reload
except:
from imp import reload as _reload
def rreload(module, mdict=None):
"""Recursively reload modules."""

View File

@ -1,4 +1,5 @@
from __future__ import print_function
import argparse
import re
import subprocess

View File

@ -1,4 +1,5 @@
from __future__ import print_function
import argparse
import codecs
import os
@ -99,4 +100,3 @@ def search(type, hex, string, executable, writable, value, mapping):
# Perform the search
print_search(value, mapping=mapping, executable=executable, writable=writable)

View File

@ -1,7 +1,9 @@
from __future__ import print_function
import gdb
import pwndbg.regs
import pwndbg.commands
import pwndbg.regs
class segment(gdb.Function):
"""Get the flat address of memory based off of the named segment register.

View File

@ -4,6 +4,7 @@
Wrapper for shell commands.
"""
from __future__ import print_function
import os
import gdb

View File

@ -5,6 +5,7 @@ Launches the target process after setting a breakpoint at a convenient
entry point.
"""
from __future__ import print_function
import gdb
import pwndbg.commands
import pwndbg.elf

View File

@ -6,7 +6,9 @@ Prints out pointer chains starting at some address in memory.
Generally used to print out the stack or register values.
"""
from __future__ import print_function
import collections
import pwndbg.arch
import pwndbg.chain
import pwndbg.commands

View File

@ -4,6 +4,7 @@
Command to print the vitual memory map a la /proc/self/maps.
"""
from __future__ import print_function
import gdb
import pwndbg.color
import pwndbg.commands

View File

@ -4,9 +4,10 @@
Compatibility functionality for Windbg users.
"""
from __future__ import print_function
import codecs
import sys
import math
import sys
import gdb
import pwndbg.arch

View File

@ -3,6 +3,7 @@ from __future__ import print_function
import pwndbg.commands
import pwndbg.memory
@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def xor(self, address, key, count):

View File

@ -6,6 +6,7 @@ running under Python2 or Python3, and resolving any
inconsistencies which arise from this.
"""
from __future__ import print_function
import sys
# Quickly determine which version is running

View File

@ -17,10 +17,11 @@ module, for example:
>>> int(pwndbg.config.example_value)
7
"""
import gdb
import sys
import types
import gdb
TYPES = {
# The value is an integer.
# This is like PARAM_INTEGER, except 0 is interpreted as itself.

View File

@ -1,6 +1,13 @@
from __future__ import print_function
import pwndbg.arch
from . import arm, aarch64, thumb, mips, amd64, i386
from . import aarch64
from . import amd64
from . import arm
from . import i386
from . import mips
from . import thumb
arches = {
'arm': arm,

View File

@ -1,4 +1,5 @@
from .constant import Constant
__NR_io_setup = Constant('__NR_io_setup',0)
__NR_io_destroy = Constant('__NR_io_destroy',1)
__NR_io_submit = Constant('__NR_io_submit',2)

View File

@ -1,4 +1,5 @@
from .constant import Constant
__NR_osf_syscall = Constant('__NR_osf_syscall',0)
__NR_exit = Constant('__NR_exit',1)
__NR_fork = Constant('__NR_fork',2)

View File

@ -1,4 +1,5 @@
from .constant import Constant
__NR_read = Constant('__NR_read',0)
__NR_write = Constant('__NR_write',1)
__NR_open = Constant('__NR_open',2)

View File

@ -1,4 +1,5 @@
from .constant import Constant
__NR_OABI_SYSCALL_BASE = Constant('__NR_OABI_SYSCALL_BASE',0x900000)
__NR_SYSCALL_BASE = Constant('__NR_SYSCALL_BASE',0)
__NR_restart_syscall = Constant('__NR_restart_syscall',(0+ 0))

View File

@ -1,4 +1,5 @@
from .constant import Constant
__NR_exit = Constant('__NR_exit',1)
__NR_fork = Constant('__NR_fork',2)
__NR_read = Constant('__NR_read',3)

View File

@ -1,4 +1,5 @@
from .constant import Constant
__NR_ni_syscall = Constant('__NR_ni_syscall',1024)
__NR_exit = Constant('__NR_exit',1025)
__NR_read = Constant('__NR_read',1026)

View File

@ -1,4 +1,5 @@
from .constant import Constant
__NR_Linux = Constant('__NR_Linux',4000)
__NR_syscall = Constant('__NR_syscall',(4000 + 0))
__NR_exit = Constant('__NR_exit',(4000 + 1))

View File

@ -1,4 +1,5 @@
from .constant import Constant
__NR_exit = Constant('__NR_exit',1)
__NR_fork = Constant('__NR_fork',2)
__NR_read = Constant('__NR_read',3)

View File

@ -1,4 +1,5 @@
from .constant import Constant
__NR_exit = Constant('__NR_exit',1)
__NR_fork = Constant('__NR_fork',2)
__NR_read = Constant('__NR_read',3)

View File

@ -1,4 +1,5 @@
from .constant import Constant
__NR_exit = Constant('__NR_exit',1)
__NR_fork = Constant('__NR_fork',2)
__NR_read = Constant('__NR_read',3)

View File

@ -1,4 +1,5 @@
from .constant import Constant
__NR_exit = Constant('__NR_exit',1)
__NR_fork = Constant('__NR_fork',2)
__NR_read = Constant('__NR_read',3)

View File

@ -1,4 +1,5 @@
from .constant import Constant
__NR_exit = Constant('__NR_exit',1)
__NR_fork = Constant('__NR_fork',2)
__NR_read = Constant('__NR_read',3)

View File

@ -1,4 +1,5 @@
from .constant import Constant
__NR_exit = Constant('__NR_exit',1)
__NR_fork = Constant('__NR_fork',2)
__NR_read = Constant('__NR_read',3)

View File

@ -1,4 +1,5 @@
from .constant import Constant
__NR_OABI_SYSCALL_BASE = Constant('__NR_OABI_SYSCALL_BASE',0x900000)
__NR_SYSCALL_BASE = Constant('__NR_SYSCALL_BASE',0)
__NR_restart_syscall = Constant('__NR_restart_syscall',(0+ 0))

View File

@ -5,21 +5,21 @@ Functionality for disassmebling code at an address, or at an
address +/- a few instructions.
"""
from __future__ import print_function
import collections
import gdb
import pwndbg.arch
import pwndbg.disasm.arch
import pwndbg.ida
import pwndbg.memory
import pwndbg.symbol
import pwndbg.memoize
import pwndbg.jump
import pwndbg.emu.emulator
import collections
import capstone
from capstone import *
import gdb
import pwndbg.arch
import pwndbg.disasm.arch
import pwndbg.emu.emulator
import pwndbg.ida
import pwndbg.jump
import pwndbg.memoize
import pwndbg.memory
import pwndbg.symbol
disassembler = None
last_arch = None

View File

@ -1,9 +1,12 @@
from __future__ import print_function
import collections
import capstone
from capstone import *
import pwndbg.memoize
import pwndbg.symbol
import capstone
import collections
from capstone import *
CS_OP_IMM

View File

@ -1,18 +1,17 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import collections
from capstone import *
from capstone.arm import *
import pwndbg.arch
import pwndbg.disasm.arch
import pwndbg.memory
import pwndbg.regs
from capstone import *
from capstone.arm import *
import pwndbg.disasm.arch
class DisassemblyAssistant(pwndbg.disasm.arch.DisassemblyAssistant):
def memory_sz(self, instruction, op):
@ -71,4 +70,3 @@ class DisassemblyAssistant(pwndbg.disasm.arch.DisassemblyAssistant):
return cc
assistant = DisassemblyAssistant('arm')

View File

@ -1,7 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import capstone
import pwndbg.chain
import pwndbg.color
import pwndbg.disasm.jump

View File

@ -1,10 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from capstone import CS_GRP_JUMP
import pwndbg.arch
import pwndbg.disasm.x86
from capstone import CS_GRP_JUMP
def is_jump_taken(instruction):
"""

View File

@ -1,16 +1,17 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import collections
from capstone import *
from capstone.x86 import *
import pwndbg.arch
import pwndbg.memory
import pwndbg.regs
import pwndbg.typeinfo
from capstone import *
from capstone.x86 import *
groups = {v:k for k,v in globals().items() if k.startswith('X86_GRP_')}
ops = {v:k for k,v in globals().items() if k.startswith('X86_OP_')}
regs = {v:k for k,v in globals().items() if k.startswith('X86_REG_')}

View File

@ -4,6 +4,7 @@
Prints structures in a manner similar to Windbg's "dt" command.
"""
from __future__ import print_function
import glob
import os
import re

View File

@ -22,7 +22,6 @@ import pwndbg.memoize
import pwndbg.memory
import pwndbg.proc
import pwndbg.stack
from pwndbg.elftypes import *
# ELF constants

View File

@ -1,2 +1,3 @@
from __future__ import print_function
import pwndbg.emu.x86

View File

@ -2,16 +2,19 @@
Emulation assistance from Unicorn.
"""
from __future__ import print_function
import binascii
import gdb
import inspect
import unicorn as U
import capstone as C
import unicorn as U
import gdb
import pwndbg.arch
import pwndbg.disasm
import pwndbg.emu.emulator
import pwndbg.memory
import pwndbg.regs
import pwndbg.emu.emulator
# Map our internal architecture names onto Unicorn Engine's architecture types.
arch_to_UC = {

View File

@ -1,2 +1,3 @@
from __future__ import print_function
import pwndbg.emu.emulator

View File

@ -9,6 +9,7 @@ dependent on page permissions, the contents of the data, and any
supplemental information sources (e.g. active IDA Pro connection).
"""
from __future__ import print_function
import string
import gdb

View File

@ -6,6 +6,7 @@ when various events occur to the debuggee (e.g. STOP on SIGINT)
by using a decorator.
"""
from __future__ import print_function
import functools
import sys
import traceback

View File

@ -6,6 +6,7 @@ debugging a remote process over SSH or similar, where e.g.
/proc/FOO/maps is needed from the remote system.
"""
from __future__ import print_function
import binascii
import errno as _errno
import os

View File

@ -1,6 +1,10 @@
from __future__ import print_function
import collections
from pycparser import c_ast, CParser
from pycparser import CParser
from pycparser import c_ast
def extractTypeAndName(n, defaultName=None):
if isinstance(n, c_ast.EllipsisParam):

View File

@ -1,4 +1,5 @@
import collections
Function = collections.namedtuple('Function', ('type', 'derefcnt', 'name', 'args'))
Argument = collections.namedtuple('Argument', ('type', 'derefcnt', 'name'))

View File

@ -5,6 +5,7 @@ Functions for determining the architecture-dependent path to
GCC and any flags it should be executed with.
"""
from __future__ import print_function
import collections
import glob
import os

View File

@ -1,6 +1,7 @@
from __future__ import print_function
import pwndbg.heap.heap
import pwndbg.heap.dlmalloc
import pwndbg.heap.heap
import pwndbg.heap.ptmalloc
current = pwndbg.heap.heap.Heap()

View File

@ -1,4 +1,5 @@
from __future__ import print_function
import gdb
import pwndbg.events
import pwndbg.typeinfo

View File

@ -1,7 +1,9 @@
from __future__ import print_function
import pwndbg.events
import pwndbg.symbol
class Heap(object):
"""Heap abstraction layer."""

View File

@ -22,11 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from __future__ import print_function
import gdb
import sys
import struct
import sys
from os import uname
import gdb
# bash color support
color_support = True
if color_support:

View File

@ -1,4 +1,5 @@
from __future__ import print_function
import gdb
import pwndbg.events
import pwndbg.typeinfo

View File

@ -4,6 +4,7 @@
Hexdump implementation, ~= stolen from pwntools.
"""
from __future__ import print_function
import copy
import string

View File

@ -6,6 +6,7 @@ in order to query it about the database. Allows symbol resolution and
interactive debugging.
"""
from __future__ import print_function
import errno
import functools
import os

View File

@ -6,6 +6,7 @@ Runs a few useful commands which are available under "info".
We probably don't need this anymore.
"""
from __future__ import print_function
import gdb
import pwndbg.memoize

View File

@ -6,6 +6,7 @@ since they cannot directly cast to integer a gdb.Value object that is
not already an integer type.
"""
from __future__ import print_function
import sys
import gdb

View File

@ -15,4 +15,3 @@
# @property
# def foobar(self):
# return self._foobar

View File

@ -6,6 +6,7 @@ Describes the EGLIBC heap mechanisms.
Work-in-progress.
"""
from __future__ import print_function
import pwndbg.arch
import pwndbg.events

View File

@ -4,11 +4,13 @@
Reading, writing, and describing memory.
"""
from __future__ import print_function
import traceback
import gdb
import pwndbg.arch
import pwndbg.compat
import pwndbg.typeinfo
import traceback
PAGE_SIZE = 0x1000
PAGE_MASK = ~(PAGE_SIZE-1)

View File

@ -3,6 +3,7 @@ Re-implements some psutil functionality to be able to get information from
remote debugging sessions.
"""
from __future__ import print_function
import binascii
import socket

View File

@ -5,12 +5,13 @@ Commands for setting temporary breakpoints on the next
instruction of some type (call, branch, etc.)
"""
from __future__ import print_function
import capstone
import gdb
import pwndbg.disasm
import pwndbg.regs
import capstone
jumps = set((
capstone.CS_GRP_CALL,
capstone.CS_GRP_JUMP,
@ -90,5 +91,3 @@ def break_on_next(address=None):
gdb.Breakpoint("*%#x" % (ins.address + ins.size), temporary=True)
gdb.execute('continue', from_tty=False, to_string=True)

View File

@ -5,6 +5,7 @@ Provides values which would be available from /proc which
are not fulfilled by other modules.
"""
from __future__ import print_function
import functools
import sys
from types import ModuleType

View File

@ -4,12 +4,15 @@
Determine whether the target is being run under QEMU.
"""
from __future__ import print_function
import gdb
import os
import psutil
import pwndbg.remote
import gdb
import pwndbg.events
import pwndbg.remote
@pwndbg.memoize.reset_on_stop
def is_qemu():
@ -90,5 +93,3 @@ def pid():
for c in connections:
if c.laddr in targets:
return process.pid

View File

@ -5,6 +5,7 @@ Reading register value from the inferior, and provides a
standardized interface to registers like "sp" and "pc".
"""
from __future__ import print_function
import collections
import ctypes
import re

View File

@ -5,8 +5,10 @@ Information about whether the debuggee is local (under GDB) or remote
(under GDBSERVER or QEMU stub).
"""
from __future__ import print_function
import gdb
def is_remote():
# N.B.: We cannot use "info program" because of:
# https://sourceware.org/bugzilla/show_bug.cgi?id=18335

View File

@ -4,6 +4,7 @@
Search the address space for byte patterns.
"""
from __future__ import print_function
import struct
import gdb

View File

@ -8,6 +8,7 @@ Generally not needed, except under qemu-user and for when
binaries do things to remap the stack (e.g. pwnies' postit).
"""
from __future__ import print_function
import gdb
import pwndbg.events
import pwndbg.memoize

View File

@ -5,6 +5,7 @@ Provides functionality to circumvent GDB's hooks on sys.stdin and sys.stdout
which prevent output from appearing on-screen inside of certain event handlers.
"""
from __future__ import print_function
import codecs
import io
import os
@ -13,8 +14,6 @@ import sys
import gdb
import pwndbg.compat
import gdb
import pwndbg.compat
def get(fd, mode):
if pwndbg.compat.python3:

View File

@ -5,6 +5,7 @@ Functionality for resolving ASCII printable strings within
the debuggee's address space.
"""
from __future__ import print_function
import string
import gdb

Some files were not shown because too many files have changed in this diff Show More