-
Notifications
You must be signed in to change notification settings - Fork 551
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
Incorrect handling of movsxd instruction #162
Comments
EDIT: #56 seems to be related. Probably that is another symptom of the same off-by-1 error. |
According to capstone in your example $ cat test.s
_start:
movsxd rax, edi
ret
$ objdump -d -M intel test
0000000000401000 <_start>:
401000: 48 63 c7 movsxd rax,edi
401003: c3 ret
$ cstool x64 4863c7
0 48 63 c7 movsxd rax, edi
$ cstool x64 63c7
0 63 c7 movsxd rax, edi |
Then it is probably a bug in capstone itself. The instruction without the leading byte does not actually work as |
Yes, it is a capstone bug. I checked that this bug kind of fixed in capstone upcoming 5 release (next branch). So I think you can install fresh capstone to avoid this bug. However, I am not sure that they correctly fix this instruction decoding. According to fresh capstone
But e.g. gdb disassembles this bytes as |
A quick'n'dirty workaround is to use the |
You can upgrade Capstone or use |
ROPgadget
output is incorrect for the following code:ROPgadget reports the
movsxd rax, edi ; ret
gadget atmain+1
, while it is actually atmain
.The text was updated successfully, but these errors were encountered: