MeanDiff icon indicating copy to clipboard operation
MeanDiff copied to clipboard

Not storing segment register - `mov` [x64]

Open mfaerevaag opened this issue 8 years ago • 2 comments

Description

When attempting to move a segment register, for instance ES into a 64-bit register using a REX prefix, the segment register is ignored.

Reference: Ref. Intel 64 and IA-32 Architecture Software Developer's Manual Vol. 2B 4-35

Affected instructions:

0x488c00

NOTE: All combinations of prefixes and operands are omitted.

Reproduction guide

Instruction:

00000000  488C00            mov qword [rax],es

Input:

pyvex.IRSB("\x48\x8C\x00", 0x8048000, archinfo.ArchX86())

Observed output:

IRSB {
   t0:Ity_I64 t1:Ity_I64

   00 | ------ IMark(0x0, 3, 0) ------
   01 | t0 = GET:I64(rax)
   02 | STle(t0) = 0x0000
   NEXT: PUT(rip) = 0x0000000000000003; Ijk_Boring
}

Expected output:

IRSB {
   t0:Ity_I64 t1:Ity_I16

   00 | ------ IMark(0x0, 3, 0) ------
   01 | t0 = GET:I64(rax)
   01 | t1 = GET:I16(es)
   02 | STle(t0) = t1
   NEXT: PUT(rip) = 0x0000000000000003; Ijk_Boring
}

System Info

OS:

# uname -a
Linux ubuntu 4.10.0-28-generic #32-Ubuntu SMP Fri Jun 30 05:32:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.04
DISTRIB_CODENAME=zesty
DISTRIB_DESCRIPTION="Ubuntu 17.04"

PyVEX:

#  pip freeze | grep pyvex
pyvex==6.7.4.12

mfaerevaag avatar Sep 09 '17 00:09 mfaerevaag

In the expected output 02 | STle(t1) = t1 is that really what you meant?

julian-seward1 avatar Sep 19 '17 12:09 julian-seward1

Oh I'm sorry, there was a typo there. Now it is fixed.

soomin-kim avatar Sep 19 '17 12:09 soomin-kim