keystone
keystone copied to clipboard
Error in assembly of x64 instructions
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]
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]"
#295 is also a not very related but similar issue.