Skip to content

Commit 78196db

Browse files
committed
Merge branch 'stable' into beta
2 parents 082c55d + d76c9fc commit 78196db

File tree

7 files changed

+16
-17
lines changed

7 files changed

+16
-17
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ jobs:
198198
pypi:
199199
runs-on: ubuntu-latest
200200
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
201+
permissions:
202+
id-token: write
201203
needs: test
202204
steps:
203205
- name: Download artifacts
@@ -207,10 +209,7 @@ jobs:
207209
path: dist
208210

209211
- name: Publish package
210-
uses: pypa/[email protected]
211-
with:
212-
user: __token__
213-
password: ${{ secrets.pypi_password }}
212+
uses: pypa/gh-action-pypi-publish@release/v1
214213

215214
- if: failure()
216215
run: ls -R

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/elf/elf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def __init__(self, path, checksec=True):
225225
super(ELF,self).__init__(self.mmap)
226226

227227
#: :class:`str`: Path to the file
228-
self.path = os.path.abspath(path)
228+
self.path = packing._need_text(os.path.abspath(path))
229229

230230
#: :class:`str`: Architecture of the file (e.g. ``'i386'``, ``'arm'``).
231231
#:

pwnlib/libcdb.py

Lines changed: 6 additions & 6 deletions
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(' ')
@@ -206,20 +208,18 @@ def unstrip_libc(filename):
206208
:const:`True` if binary was unstripped, :const:`False` otherwise.
207209
208210
Examples:
209-
>>> filename = search_by_build_id('2d1c5e0b85cb06ff47fa6fa088ec22cb6e06074e', unstrip=False)
211+
>>> filename = search_by_build_id('69389d485a9793dbe873f0ea2c93e02efaa9aa3d', unstrip=False)
210212
>>> libc = ELF(filename)
211-
>>> hex(libc.symbols.read)
212-
'0xe56c0'
213213
>>> 'main_arena' in libc.symbols
214214
False
215215
>>> unstrip_libc(filename)
216216
True
217217
>>> libc = ELF(filename)
218218
>>> hex(libc.symbols.main_arena)
219-
'0x1d57a0'
219+
'0x219c80'
220220
>>> unstrip_libc(which('python'))
221221
False
222-
>>> filename = search_by_build_id('06a8004be6e10c4aeabbe0db74423ace392a2d6b', unstrip=True)
222+
>>> filename = search_by_build_id('d1704d25fbbb72fa95d517b883131828c0883fe9', unstrip=True)
223223
>>> 'main_arena' in ELF(filename).symbols
224224
True
225225
"""

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
@@ -1633,7 +1633,7 @@ def upload_dir(self, local, remote=None):
16331633
remote: Remote directory
16341634
"""
16351635

1636-
remote = remote or self.cwd
1636+
remote = packing._encode(remote or self.cwd)
16371637

16381638
local = os.path.expanduser(local)
16391639
dirname = os.path.dirname(local)
@@ -1654,7 +1654,7 @@ def upload_dir(self, local, remote=None):
16541654
remote_tar = self.mktemp('--suffix=.tar.gz')
16551655
self.upload_file(local_tar, remote_tar)
16561656

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

16601660
if untar.wait() != 0:

pwnlib/util/web.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def wget(url, save=None, timeout=5, **kwargs):
2525
2626
Example:
2727
28-
>>> url = 'https://httpbin.org/robots.txt'
28+
>>> url = 'https://httpbingo.org/robots.txt'
2929
>>> result = wget(url, timeout=60)
3030
>>> result
3131
b'User-agent: *\nDisallow: /deny\n'

0 commit comments

Comments
 (0)