Skip to content

Commit

Permalink
Merge branch 'beta' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
peace-maker committed Sep 25, 2024
2 parents d7817a7 + f47e417 commit bc453b4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ The table below shows which release corresponds to each branch, and what date th
[2435]: https://github.com/Gallopsled/pwntools/pull/2435
[2437]: https://github.com/Gallopsled/pwntools/pull/2437

## 4.13.1

- [#2445][2445] Fix parsing the PLT on Windows
- [#2466][2466] Fix PLT emulation with Unicorn 2.1.0
- [#2466][2466] Switch to PyPi Simple API for update checks
- [#2467][2467] Fix loading at all on Windows

[2445]: https://github.com/Gallopsled/pwntools/pull/2445
[2466]: https://github.com/Gallopsled/pwntools/pull/2466
[2467]: https://github.com/Gallopsled/pwntools/pull/2467

## 4.13.0 (`stable`)

- [#2242][2242] Term module revamp: activating special handling of terminal only when necessary
Expand Down
7 changes: 5 additions & 2 deletions pwnlib/elf/plt.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ def __ensure_memory_to_run_unicorn():
mm.close()
except OSError:
raise OSError("Cannot allocate 1GB memory to run Unicorn Engine")
except ImportError:
# Can only mmap files on Windows, would need to use VirtualAlloc.
pass


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

hooks = [
uc.hook_add(U.UC_HOOK_MEM_READ | U.UC_HOOK_MEM_READ_UNMAPPED,
hook_mem, stopped_addr),
uc.hook_add(U.UC_HOOK_MEM_READ, hook_mem, stopped_addr),
uc.hook_add(U.UC_HOOK_MEM_READ_UNMAPPED, hook_mem, stopped_addr),
]

# callback for tracing instructions
Expand Down
2 changes: 1 addition & 1 deletion pwnlib/tubes/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,7 @@ def user_shstk(self):
Example:
>>> s = ssh("travis", "example.pwnme")
>>> s.user_shstk
>>> s.user_shstk # doctest: +SKIP
False
"""
if self._user_shstk is None:
Expand Down
9 changes: 6 additions & 3 deletions pwnlib/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,15 @@ def available_on_pypi(prerelease=current_version.is_prerelease):
False
"""
# Deferred import to save startup time
from six.moves.xmlrpc_client import ServerProxy
import requests

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

versions = map(packaging.version.Version, versions)
Expand Down

0 comments on commit bc453b4

Please sign in to comment.