Skip to content

Commit ba08317

Browse files
authored
Merge branch 'stable' into fix_missing_start_symbol
2 parents 0829371 + 3e9849f commit ba08317

File tree

4 files changed

+21
-6
lines changed

4 files changed

+21
-6
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ The table below shows which release corresponds to each branch, and what date th
118118
[2435]: https://github.com/Gallopsled/pwntools/pull/2435
119119
[2437]: https://github.com/Gallopsled/pwntools/pull/2437
120120

121+
## 4.13.1
122+
123+
- [#2445][2445] Fix parsing the PLT on Windows
124+
- [#2466][2466] Fix PLT emulation with Unicorn 2.1.0
125+
- [#2466][2466] Switch to PyPi Simple API for update checks
126+
127+
[2445]: https://github.com/Gallopsled/pwntools/pull/2445
128+
[2466]: https://github.com/Gallopsled/pwntools/pull/2466
129+
121130
## 4.13.0 (`stable`)
122131

123132
- [#2242][2242] Term module revamp: activating special handling of terminal only when necessary

pwnlib/elf/plt.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ def __ensure_memory_to_run_unicorn():
7070
mm.close()
7171
except OSError:
7272
raise OSError("Cannot allocate 1GB memory to run Unicorn Engine")
73+
except ImportError:
74+
# Can only mmap files on Windows, would need to use VirtualAlloc.
75+
pass
7376

7477

7578
def prepare_unicorn_and_context(elf, got, address, data):
@@ -166,8 +169,8 @@ def hook_mem(uc, access, address, size, value, user_data):
166169
return False
167170

168171
hooks = [
169-
uc.hook_add(U.UC_HOOK_MEM_READ | U.UC_HOOK_MEM_READ_UNMAPPED,
170-
hook_mem, stopped_addr),
172+
uc.hook_add(U.UC_HOOK_MEM_READ, hook_mem, stopped_addr),
173+
uc.hook_add(U.UC_HOOK_MEM_READ_UNMAPPED, hook_mem, stopped_addr),
171174
]
172175

173176
# callback for tracing instructions

pwnlib/tubes/ssh.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2030,7 +2030,7 @@ def user_shstk(self):
20302030
Example:
20312031
20322032
>>> s = ssh("travis", "example.pwnme")
2033-
>>> s.user_shstk
2033+
>>> s.user_shstk # doctest: +SKIP
20342034
False
20352035
"""
20362036
if self._user_shstk is None:

pwnlib/update.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,15 @@ def available_on_pypi(prerelease=current_version.is_prerelease):
7474
False
7575
"""
7676
# Deferred import to save startup time
77-
from six.moves.xmlrpc_client import ServerProxy
77+
import requests
7878

7979
versions = getattr(available_on_pypi, 'cached', None)
8080
if versions is None:
81-
client = ServerProxy('https://pypi.python.org/pypi')
82-
versions = client.package_releases('pwntools', True)
81+
response = requests.get("https://pypi.org/simple/pwntools/",
82+
headers={"Accept": "application/vnd.pypi.simple.v1+json"},
83+
timeout=5)
84+
response.raise_for_status()
85+
versions = response.json()["versions"]
8386
available_on_pypi.cached = versions
8487

8588
versions = map(packaging.version.Version, versions)

0 commit comments

Comments
 (0)