Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check qemu_path correctly and give out a reasonable error msg #1243

Merged
merged 4 commits into from
Jan 7, 2019

Conversation

Kyle-Kyle
Copy link
Contributor

Should check qemu_path instead of qemu itself.

qemu will never be None so the exception will never be triggered.
But if QEMU is not installed, qemu_path will be None and later fails which(qemu_path)

@zachriggle
Copy link
Member

The original exception should be re-raised, not the new exception message.

This error path is taken on every failure to execute (-ENOEXEC) so this ends up raising a misleading error message in the following case on e.g. macOS:

>>> from pwn import *
>>> io = process('./pwnlib/data/elf/test-aarch64')
[x] Starting local process './pwnlib/data/elf/test-aarch64'
[!] Neither 'qemu-aarch64' nor 'qemu-aarch64-static' are available
[-] Starting local process './pwnlib/data/elf/test-aarch64': Failed
...
RuntimeError: No QEMU runner available, please install QEMU first

@zachriggle zachriggle merged commit 0dc0a9a into Gallopsled:stable Jan 7, 2019
disconnect3d added a commit to disconnect3d/pwntools that referenced this pull request Jan 13, 2019
* dev:
  Update CHANGELOG for 3.12.2
  check qemu_path correctly and give out a reasonable error msg (Gallopsled#1243)
  Do not use intervaltree 3.xx (Gallopsled#1242)
  Fix typo in the help message of pwn disasm
  Fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants