Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions voltron/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
WinDbg/CDB (via PyKD):

> .load pykd.pyd
> !py --global C:\path\to\voltron\entry.py
> !py --global C:\\path\\to\\voltron\\entry.py
"""

log = None
Expand All @@ -36,7 +36,6 @@
pass

try:
import logging
import os
import sys
blessed = None
Expand Down Expand Up @@ -113,7 +112,7 @@ def invoke(*args):
msg = ("An error occurred while loading Voltron:\n\n{}"
"\nPlease ensure Voltron is installed correctly per the documentation: "
"https://github.com/snare/voltron/wiki/Installation").format(traceback.format_exc())
if blessed:
if 'blessed' in globals() and blessed:
msg = blessed.Terminal().bold_red(msg)
if log:
log.exception("Exception raised while loading Voltron")
Expand Down
10 changes: 5 additions & 5 deletions voltron/plugins/debugger/dbg_gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def disassembly_flavor(self):

Returns 'intel' or 'att'
"""
flavor = re.search('flavor is "(.*)"', gdb.execute("show disassembly-flavor", to_string=True)).group(1)
flavor = re.search(r'flavor is "(.*)"', gdb.execute("show disassembly-flavor", to_string=True)).group(1)
return flavor

@post_event
Expand Down Expand Up @@ -418,9 +418,9 @@ def breakpoints(self, target_id=0):
addr = int(b.location[1:], 16)
else:
output = gdb.execute('info addr {}'.format(b.location), to_string=True)
m = re.match('.*is at ([^ ]*) .*', output)
m = re.match(r'.*is at ([^ ]*) .*', output)
if not m:
m = re.match('.*at address ([^ ]*)\..*', output)
m = re.match(r'.*at address ([^ ]*)\..*', output)
if m:
addr = int(m.group(1), 16)
else:
Expand Down Expand Up @@ -588,7 +588,7 @@ def get_registers_sse(self, num=8):
# the old way of doing this randomly crashed gdb or threw a python exception
regs = {}
for line in gdb.execute('info all-registers', to_string=True).split('\n'):
m = re.match('^([xyz]mm\d+)\s.*uint128 = (0x[0-9a-f]+)\}', line)
m = re.match(r'^([xyz]mm\d+)\s.*uint128 = (0x[0-9a-f]+)\}', line)
if m:
regs[m.group(1)] = int(m.group(2), 16)
return regs
Expand Down Expand Up @@ -648,7 +648,7 @@ def get_arch(self):
try:
arch = gdb.selected_frame().architecture().name()
except:
arch = re.search('\(currently (.*)\)', gdb.execute('show architecture', to_string=True)).group(1)
arch = re.search(r'\(currently (.*)\)', gdb.execute('show architecture', to_string=True)).group(1)
return self.archs[arch]

def get_addr_size(self):
Expand Down
2 changes: 1 addition & 1 deletion voltron/plugins/view/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def configure_subparser(cls, subparsers):
help='address (in hex or decimal) from which to start reading memory')
group.add_argument('--command', '-c', action='store',
help='command to execute resulting in the address from which to start reading memory. '
'voltron will do his almighty best to find an address. e.g. "print \$rip + 0x1234"',
'voltron will do his almighty best to find an address. e.g. "print $rip + 0x1234"',
default=None)
group.add_argument('--register', '-r', action='store',
help='register containing the address from which to start reading memory', default=None)
Expand Down
2 changes: 1 addition & 1 deletion voltron/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def __len__(self):
return len(self.chars)

def clean(self):
return re.sub('\033\[.{1,2}m', '', str(self))
return re.sub(r'\033\[.{1,2}m', '', str(self))


def requires_async(func):
Expand Down