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

shellcraft.mov does not support AH, BH, etc. registers #1046

Open
david942j opened this issue Oct 8, 2017 · 1 comment
Open

shellcraft.mov does not support AH, BH, etc. registers #1046

david942j opened this issue Oct 8, 2017 · 1 comment

Comments

@david942j
Copy link
Contributor

from pwn import *
# context.arch = 'i386'
print shellcraft.mov('eax', 'ah')

Expected:
movzx eax, ah

Result:

NameError: name 'ah' is not defined

The error is raised when trying to eval ah as a system-constant value

But the real reason is ah is not defined in shellcraft/registers.py as a register in i386.

Issue occurs in amd64 as well.

@david942j david942j changed the title NameError raised in a valid shellcraft.mov call NameError raised in a valid shellcraft.mov call Oct 8, 2017
@zachriggle
Copy link
Member

I don't think we support the xh registers since they complicate some of the logic. If you can submit a pull request that adds the functionality, and some doctests for various permutations (e.g. mov("ah", "al")) we can get this included.

@zachriggle zachriggle changed the title NameError raised in a valid shellcraft.mov call shellcraft.mov does not support AH, BH, etc. registers Oct 12, 2017
crclark96 added a commit to crclark96/pwntools that referenced this issue Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants