keystone icon indicating copy to clipboard operation
keystone copied to clipboard

GAS & ATT instructions decoding issue

Open JackieSpring opened this issue 3 years ago • 0 comments

I found two issues relatives to GAS syntax; 1 ) when I try to assemble instructions with memory operands that contains more than 1 register in the parentesys I get error 512 Invalid operand (KS_ERR_ASM_INVALIDOPERAND), for example: movl (%eax, %edx, 4), %esi or leaq (%rax, %rdx, 2), %rsi

When assembling instructions with wrong prefix, ks_asm return KS_ERR_OK, but size and nins are set to 0 and a buffer is allocated; printing out this variables I get: // kerr = ks_asm( ks, code_ptr, ip, &bytecode, &size, &nins); leal (%rax), %rsi // bytecode: 0x13060ad10, size: 0, nins: 0, kerr: 0 or movb $1, %rax // buffer: 0x12cf071f0, size: 0, nins: 0, kerr: 0

JackieSpring avatar Jun 15 '22 22:06 JackieSpring