use*_*783 56
假设32位x86,请使用以下函数:
get_eip: mov eax, [esp]
ret
Run Code Online (Sandbox Code Playgroud)
然后,要在EAX中获取EIP的值,只需:
call get_eip
Run Code Online (Sandbox Code Playgroud)
Fab*_*sen 26
在x86-64(而不是32位x86)上,有RIP相对寻址(RIP是64位模拟EIP).所以在64位代码中,你可以做到
lea rax, [rip]
Run Code Online (Sandbox Code Playgroud)
将当前内容移动RIP到RAX(您可以使用lea但不能mov用于此).
Aby*_*byx 10
call foo
foo:
pop eax ; address of foo
Run Code Online (Sandbox Code Playgroud)