inline asm, jumping.

Posts 1–6 of 6 · Page 1 of 1
inline asm, jumping.
inline asm code:
Code:
__asm{
	cmp eax,ecx
	jbe 0x12345678
}
becomes
Code:
0034159C  cmp eax,ecx 
0034159E  jbe main+34h (3415A4h)
anyone know how to make it jump to specified address (0x12345678)?
thanks.
ohaiidesu i incorrectly read the question
Code:
mov eax, 0x12345678
jmp eax
Code:
push 0x12345678
ret
Code:
DWORD dwAddress = 0x12345678
/**************************/

jmp dword ptr ds:[dwAddress]
my bad, regular jmp work. other jump instruction jumps to wrong place (ja,jna,je,jne,jb,jba, you name it), jbe in my case. guess i'll have to modify it with olly after compiled.
or it might just be vc++ 2008?
thanks.
Quote Originally Posted by mavi2k View Post
my bad, regular jmp work. other jump instruction jumps to wrong place (ja,jna,je,jne,jb,jba, you name it), jbe in my case. guess i'll have to modify it with olly after compiled.
or it might just be vc++ 2008?
thanks.
They are relative jumps.
Just add a normal jmp to where you want to go below it and jump over it with ja
Quote Originally Posted by Hell_Demon View Post
They are relative jumps.
Just add a normal jmp to where you want to go below it and jump over it with ja
fixed it with:

Code:
			cmp eax,ecx
			jbe GG
			jmp ERR
GG:
			jmp OKK
thanks for your help.
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us