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

Some x64 Segment Operations Use Wrong RAM Size #6569

Open
toolCHAINZ opened this issue May 23, 2024 · 0 comments
Open

Some x64 Segment Operations Use Wrong RAM Size #6569

toolCHAINZ opened this issue May 23, 2024 · 0 comments
Assignees
Labels
Status: Triage Information is being gathered

Comments

@toolCHAINZ
Copy link

The sleigh documentation says the following about the STORE instruction:

This instruction is the complement of LOAD. The data in the variable input2 is stored at a dynamic location by dereferencing a pointer. As with LOAD, the “pointer” comes in two pieces: a space ID part, and an offset variable. The size of input1 must match the address space specified by the ID, and the amount of data stored is determined by the size of input2.

(Emphasis Mine)

My interpretation of that is that any pointer into a space in the STORE instruction MUST be the same width as the domain of the space.

However, some segmented-addressing instructions in x64 break this rule. For example:

        0046cdf6 67 6c           INSB       ES:EDI,DX
                                                                         $U8b00:4 = COPY EDI
                                                                         $U8b80:4 = INT_ADD EDI, 1:4
                                                                         $U8c00:4 = INT_ZEXT DF
                                                                         $U8c80:4 = INT_MULT 2:4, $U8c00:4
                                                                         EDI = INT_SUB $U8b80:4, $U8c80:4
                                                                         $U8d80:1 = CALLOTHER "in", DX
                                                                         STORE ram($U8b00:4), $U8d80:1

Note that the RAM address is 4-bytes wide even though RAM is an 8-byte-wide space (x86:LE:64:default).

Am I misunderstanding the sleigh documentation or should this STORE's address be 8-bytes wide?

@ryanmkurtz ryanmkurtz added Status: Triage Information is being gathered labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Information is being gathered
Projects
None yet
Development

No branches or pull requests

3 participants