Skip to content

Commit cb5b8af

Browse files
committed
Merge branch 'beta' into dev
2 parents 60af3a2 + 78196db commit cb5b8af

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

pwnlib/commandline/disasm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ def main(args):
8282
instrs = disasm(dat, vma=safeeval.const(args.address), byte=False, offset=False)
8383
# instrs = highlight(instrs, PwntoolsLexer(), TerminalFormatter())
8484

85+
highlight_bytes = lambda t: ''.join(map(lambda x: x.replace('00', text.red('00')).replace('0a', text.red('0a')), group(2, t)))
8586
for o,b,i in zip(*map(str.splitlines, (offsets, bytes, instrs))):
86-
b = b.replace('00', text.red('00'))
87-
b = b.replace('0a', text.red('0a'))
87+
b = ' '.join(highlight_bytes(bb) for bb in b.split(' '))
8888
i = highlight(i.strip(), PwntoolsLexer(), TerminalFormatter()).strip()
8989
i = i.replace(',',', ')
9090

pwnlib/libcdb.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
log = getLogger(__name__)
2626

2727
HASHES = ['build_id', 'sha1', 'sha256', 'md5']
28-
DEBUGINFOD_SERVERS = ['https://debuginfod.elfutils.org/']
28+
DEBUGINFOD_SERVERS = [
29+
'https://debuginfod.elfutils.org/',
30+
]
2931

3032
if 'DEBUGINFOD_URLS' in os.environ:
3133
urls = os.environ['DEBUGINFOD_URLS'].split(' ')

pwnlib/shellcraft/templates/mips/mov.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if not dst.startswith('$'):
6969
log.error("Registers must start with $")
7070
return
7171

72-
if isinstance(src, str) and dst.startswith('$') and dst not in registers.mips:
72+
if isinstance(dst, str) and dst.startswith('$') and dst not in registers.mips:
7373
log.error("Unknown register %r" % dst)
7474
return
7575

pwnlib/tubes/ssh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,7 @@ def upload_dir(self, local, remote=None):
16361636
remote: Remote directory
16371637
"""
16381638

1639-
remote = remote or self.cwd
1639+
remote = packing._encode(remote or self.cwd)
16401640

16411641
local = os.path.expanduser(local)
16421642
dirname = os.path.dirname(local)
@@ -1657,7 +1657,7 @@ def upload_dir(self, local, remote=None):
16571657
remote_tar = self.mktemp('--suffix=.tar.gz')
16581658
self.upload_file(local_tar, remote_tar)
16591659

1660-
untar = self.run('cd %s && tar -xzf %s' % (remote, remote_tar))
1660+
untar = self.run(b'cd %s && tar -xzf %s' % (sh_string(remote), sh_string(remote_tar)))
16611661
message = untar.recvrepeat(2)
16621662

16631663
if untar.wait() != 0:

0 commit comments

Comments
 (0)