-
Notifications
You must be signed in to change notification settings - Fork 147
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
Wrong operand size for movb #125
Comments
No, the memory operand should be the same size as the immediate; it's not a sign-extending or zero-extending mov and that means the operand sizes have to match. |
The tree for the memory dereference is like this:
The documentation for
@wrwilliams I'm not sure if the documentation is wrong, or the code is wrong or everything is functioning properly. |
I think it's the documentation being wrong, then. The effective address itself is 32-bit, the dereference is 8-bit, and we're returning the effective address. |
Me and Bill have decided that we will create a new function with a more intuitive name that implements the correct functionality and deprecate the old function. The documentation will be updated when 9.3.X is released. The old function will remain available until the next major release (10.X.X). This will be added to the release notes. |
Has this gotten implemented without a github update, or is it still open? |
Docs do explain this (and have for a long time). Moving to 10.0 for the actual API change. |
Will see if I can reproduce it in Dyninst 10.1 |
@mxz297 Were you able to reproduce this in 10.1? |
Reported by Frederik on the DyninstAPI mailing list:
When decoding the instruction below, we consider
-0x1(%ebp)
as a 4 byte memory operand instead of a one byte memory operand. However it does appear that we consider the0x41
as a one byte immediate operand. Is this correct behavior? @wrwilliams @cuviperOriginal Message
Hi all,
I use
getMemoryWriteOperands()
to get the Expression of Operands that write to memory and size() to get the actual size of the write. However, it always returns 4 byte, even if I write a single byte (char) like in the following program.Even gdb disassembles it to a byte sized write:
mov BYTE PTR [ebp-0x1], 0x41
. I know that EBP is a 4 byte register, but a 4 byte write would just overwrite the variable next to “x” (at least if layout is not 4 byte aligned). Tell me if I am wrong. I am using a 32-Bit Linux mint (vmware) and Dyninst 9.2.0.Reproducer
The text was updated successfully, but these errors were encountered: