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

exception when processing MOV r/m{16/32/64}, Sreg #461

Closed
gyorokpeter opened this issue Jan 11, 2017 · 2 comments
Closed

exception when processing MOV r/m{16/32/64}, Sreg #461

gyorokpeter opened this issue Jan 11, 2017 · 2 comments

Comments

@gyorokpeter
Copy link
Contributor

>>> from triton import *
>>> setArchitecture(ARCH.X86)
>>> inst = Instruction('\x66\x8c\xe0')
>>> processing(inst)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: SymbolicEngine::assignSymbolicExpressionToRegister(): The size of the symbolic expression is not equal to the target register.

This instruction is MOV AX,FS. Moving a 16-bit register to a 16-bit one shouldn't be a size mismatch.

@JonathanSalwan JonathanSalwan self-assigned this Jan 11, 2017
@JonathanSalwan JonathanSalwan added this to the v0.5 milestone Jan 11, 2017
@JonathanSalwan JonathanSalwan changed the title exception when processing MOV AX,FS Segment registers should be 16-bits. Jan 11, 2017
@JonathanSalwan
Copy link
Owner

JonathanSalwan commented Jan 11, 2017

Root cause:

>>> setArchitecture(ARCH.X86_64)
>>> REG.FS
fs:64 bv[63..0]

>>> REG.FS
fs:64 bv[63..0]

>>> REG.CS
cs:64 bv[63..0]

@JonathanSalwan JonathanSalwan changed the title Segment registers should be 16-bits. exception when processing MOV AX,FS Jan 12, 2017
@JonathanSalwan JonathanSalwan changed the title exception when processing MOV AX,FS exception when processing MOV r/m{16/32/64}, Sreg Jan 12, 2017
@JonathanSalwan
Copy link
Owner

JonathanSalwan commented Jan 12, 2017

I keep segment registers as 32-bits and 64-bits size. Because to avoid to simulate the GDT, i'm using these registers as base offset instead of an ID into the GDT. However, I fixed the case of the mov sreg, r/m and mov r/m, sreg.

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

2 participants