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

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

Open
bbqz007 opened this issue Dec 22, 2023 · 0 comments

Comments

@bbqz007
Copy link

bbqz007 commented Dec 22, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant