mirror of https://github.com/pwndbg/pwndbg
Add isort, config, and pre-CI hook
This commit is contained in:
parent
3f44141c85
commit
d97847b872
|
@ -0,0 +1,4 @@
|
|||
[settings]
|
||||
indent=' '
|
||||
not_skip = __init__.py
|
||||
force_single_line = 1
|
|
@ -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/
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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__ = [
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import print_function
|
||||
|
||||
import pwndbg.arch
|
||||
|
||||
|
||||
class ABI(object):
|
||||
"""
|
||||
Encapsulates information about a calling convention.
|
||||
|
|
|
@ -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'):
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import gdb
|
||||
import pwndbg.color
|
||||
import pwndbg.enhance
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import functools
|
||||
|
||||
import gdb
|
||||
import pwndbg.config
|
||||
import pwndbg.enhance
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import gdb
|
||||
import pwndbg.arch
|
||||
import pwndbg.argv
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
|
||||
import gdb
|
||||
import pwndbg.color
|
||||
import pwndbg.commands
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import subprocess
|
||||
|
||||
import gdb
|
||||
|
|
|
@ -7,6 +7,7 @@ import gdb
|
|||
import pwndbg.commands
|
||||
import pwndbg.which
|
||||
|
||||
|
||||
@pwndbg.commands.Command
|
||||
def checksec(file=None):
|
||||
'''
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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():
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import gdb
|
||||
import pwndbg.color
|
||||
import pwndbg.commands
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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():
|
||||
|
|
|
@ -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()))
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import bz2
|
||||
import datetime
|
||||
import os
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import struct
|
||||
|
||||
import gdb
|
||||
|
|
|
@ -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():
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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."""
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import re
|
||||
import subprocess
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
Wrapper for shell commands.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
|
||||
import gdb
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
@ -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_')}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -22,7 +22,6 @@ import pwndbg.memoize
|
|||
import pwndbg.memory
|
||||
import pwndbg.proc
|
||||
import pwndbg.stack
|
||||
|
||||
from pwndbg.elftypes import *
|
||||
|
||||
# ELF constants
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import pwndbg.emu.x86
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import pwndbg.emu.emulator
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import collections
|
||||
|
||||
Function = collections.namedtuple('Function', ('type', 'derefcnt', 'name', 'args'))
|
||||
Argument = collections.namedtuple('Argument', ('type', 'derefcnt', 'name'))
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import gdb
|
||||
import pwndbg.events
|
||||
import pwndbg.typeinfo
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import pwndbg.events
|
||||
import pwndbg.symbol
|
||||
|
||||
|
||||
class Heap(object):
|
||||
"""Heap abstraction layer."""
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import gdb
|
||||
import pwndbg.events
|
||||
import pwndbg.typeinfo
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
Hexdump implementation, ~= stolen from pwntools.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
import copy
|
||||
import string
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -15,4 +15,3 @@
|
|||
# @property
|
||||
# def foobar(self):
|
||||
# return self._foobar
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ Describes the EGLIBC heap mechanisms.
|
|||
Work-in-progress.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
import pwndbg.arch
|
||||
import pwndbg.events
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
Search the address space for byte patterns.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
import struct
|
||||
|
||||
import gdb
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
Loading…
Reference in New Issue