keystone icon indicating copy to clipboard operation
keystone copied to clipboard

Error in assembly of x64 instructions

Open peta909 opened this issue 5 years ago • 2 comments

hi, I found a possible error in the assembly:

Output1: b'mov rax, qword ptr gs:[0x60]' = ['0x48', '0x65', '0xa1', '0x60', '0x0 ', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0'] (number of statements: 1)

Output2: b'mov rax, qword ptr gs:[0x60]' = ['0x48', '0x65', '0xa1', '0x60', '0x0 ', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0'] (number of statements: 1)

my code for reference: ` from keystone import *

CODE =b"movabs rax, qword ptr gs:[0x60]"

aa = Ks(KS_ARCH_X86, KS_MODE_64) encoding, count = aa.asm(CODE) hex_encoding =[] for i in encoding: hex_encoding.append(hex(i)) print("%s = %s (number of statements: %u)" %(CODE, hex_encoding, count)) `

Output from Capstone when I disassemble the same bytes as above movabs eax, dword ptr gs:[0x60]

peta909 avatar Apr 06 '20 14:04 peta909

Facing the same issue.

Related: #296 - x64 "mov rax, fs:0x28" encoding error #317 - assemble bug (mov rax,qword ptr gs:[0x60])` #400 - x64 "mov r12, gs:0x60" encoding error #430 - [X86_64] Compile wrong opcode "mov rax, gs:[0x188]"

KFSPC8 avatar May 21 '20 06:05 KFSPC8

#295 is also a not very related but similar issue.

ZhangZhuoSJTU avatar Sep 18 '20 15:09 ZhangZhuoSJTU