keystone icon indicating copy to clipboard operation
keystone copied to clipboard

under intel style, Invalid operand (KS_ERR_ASM_INVALIDOPERAND) when same Label is accessed second time.

Open bbqz007 opened this issue 1 year ago • 0 comments
trafficstars

code generated by gcc

	.align 4
_MessageBoxA:
	.long	19089016
LC0:
	.ascii "\0"
	push	ebp
	mov	ebp, esp
	sub	esp, 24
	mov	eax, DWORD PTR _MessageBoxA
	mov	ecx, OFFSET FLAT:LC0   ;  OK
	mov	edx, OFFSET FLAT:LC0   ;  Not Fine
	mov	DWORD PTR [esp+12], 0
	mov	DWORD PTR [esp+8], ecx  
	mov	DWORD PTR [esp+4], edx  
	mov	DWORD PTR [esp], 0
	call	eax
	nop
	leave
	ret

the first time, mov ecx, OFFSET FLAT:LC0 is ok

then the second time accession to LC0, mov edx, OFFSET FLAT:LC0 is not fine. it throws Invalid operand (KS_ERR_ASM_INVALIDOPERAND)

i try assemble the partial codes by increasing one line every time. and address wrong spot where it accesses to LC0 second time.

my using keystone is 0.92 from pypi.

bbqz007 avatar Dec 22 '23 11:12 bbqz007