mirror of
https://github.com/Gallopsled/pwntools.git
synced 2026-11-09 01:59:33 -10:00
Compare commits
5
Commits
3.2.0beta2
...
3.2.0beta4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d5f8ca4b4 | ||
|
|
7695acc798 | ||
|
|
3f48a0b803 | ||
|
|
e5b6aedd3d | ||
|
|
4b405c69b6 |
No files matched your search
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# cache list of shellcodes
|
||||
_shellcraft_shellcodes=$(shellcraft)
|
||||
_shellcraft_shellcodes=$(pwn shellcraft -l)
|
||||
|
||||
_shellcraft()
|
||||
{
|
||||
@@ -44,3 +45,4 @@ _shellcraft()
|
||||
}
|
||||
|
||||
complete -F _shellcraft pwn shellcraft
|
||||
complete -F _shellcraft shellcraft
|
||||
@@ -20,7 +20,7 @@ def main(args):
|
||||
s = sys.stdin.read().translate(None, whitespace)
|
||||
sys.stdout.write(s.decode('hex'))
|
||||
else:
|
||||
sys.stdout.write(''.join(sys.argv[1:]).decode('hex'))
|
||||
sys.stdout.write(''.join(args.hex).decode('hex'))
|
||||
except TypeError, e:
|
||||
sys.stderr.write(str(e) + '\n')
|
||||
|
||||
|
||||
+1
-47
@@ -34,34 +34,6 @@ package_name = 'pwntools'
|
||||
package_repo = 'Gallopsled/pwntools'
|
||||
update_freq = datetime.timedelta(days=7).total_seconds()
|
||||
|
||||
def available_on_github(prerelease=current_version.is_prerelease):
|
||||
"""Return True if an update is available on Github.
|
||||
|
||||
>>> available_on_github() # doctest: +ELLIPSIS
|
||||
<Version('...')>
|
||||
>>> available_on_github(prerelease=False).is_prerelease
|
||||
False
|
||||
"""
|
||||
url = 'https://api.github.com/repos/%s/tags' % package_repo
|
||||
|
||||
with context.quiet:
|
||||
tags = json.loads(wget(url, timeout = 60))
|
||||
|
||||
# 'pwntools-ancient' is a tag, but not a valid version.
|
||||
# Handle this here, and for all potential tags which cause
|
||||
# issues.
|
||||
versions = []
|
||||
for tag in [t['name'] for t in tags]:
|
||||
try:
|
||||
versions.append(packaging.version.Version(tag))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if not prerelease:
|
||||
versions = filter(lambda v: not v.is_prerelease, versions)
|
||||
|
||||
return max(versions)
|
||||
|
||||
def available_on_pypi(prerelease=current_version.is_prerelease):
|
||||
"""Return True if an update is available on PyPI.
|
||||
|
||||
@@ -120,21 +92,12 @@ def perform_check(prerelease=current_version.is_prerelease):
|
||||
['pip', 'install', '-U', ...]
|
||||
|
||||
>>> def bail(*a): raise Exception()
|
||||
>>> github = pwnlib.update.available_on_github
|
||||
>>> pypi = pwnlib.update.available_on_pypi
|
||||
|
||||
>>> pwnlib.update.available_on_github = bail
|
||||
>>> perform_check(prerelease=False)
|
||||
['pip', 'install', '-U', 'pwntools']
|
||||
>>> perform_check(prerelease=True) # doctest: +ELLIPSIS
|
||||
['pip', 'install', '-U', 'pwntools...']
|
||||
>>> pwnlib.update.available_on_github = github
|
||||
|
||||
>>> pwnlib.update.available_on_pypi = bail
|
||||
>>> perform_check(prerelease=False)
|
||||
['pip', 'install', '-U', 'git+https://github.com/Gallopsled/pwntools.git@...']
|
||||
>>> perform_check(prerelease=True) # doctest: +ELLIPSIS
|
||||
['pip', 'install', '-U', 'git+https://github.com/Gallopsled/pwntools.git@...']
|
||||
"""
|
||||
pypi = current_version
|
||||
try:
|
||||
@@ -142,13 +105,7 @@ def perform_check(prerelease=current_version.is_prerelease):
|
||||
except Exception:
|
||||
log.warning("An issue occurred while checking PyPI")
|
||||
|
||||
github = current_version
|
||||
try:
|
||||
github = available_on_github(prerelease)
|
||||
except Exception:
|
||||
log.warning("An issue occurred while checking Github")
|
||||
|
||||
best = max(pypi, github, current_version)
|
||||
best = max(pypi, current_version)
|
||||
where = None
|
||||
command = None
|
||||
|
||||
@@ -170,9 +127,6 @@ def perform_check(prerelease=current_version.is_prerelease):
|
||||
if best.is_prerelease:
|
||||
pypi_package += '==%s' % (best)
|
||||
command += [pypi_package]
|
||||
else:
|
||||
where = 'GitHub'
|
||||
command += ['git+https://github.com/%s.git@%s' % (package_repo, github)]
|
||||
|
||||
command_str = ' '.join(command)
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
__version__ = '3.2.0beta2'
|
||||
__version__ = '3.2.0beta4'
|
||||
Reference in new issue
Block a user