show disassembly-flavor
(e.g., mov dest,src for intel syntax (windows), mov src,dest for AT&T(unix-like))
disp/i $pc
si
WRITTEN BY
- RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.
,
show disassembly-flavor
(e.g., mov dest,src for intel syntax (windows), mov src,dest for AT&T(unix-like))
disp/i $pc
si
asm volatile("mov %%eip,%0":"=r"(var));
asm ("call 1f \n\t" "1:pop %0" : "=r"(var));
출처 : http://stackoverflow.com/questions/4062403/how-to-check-the-eip-value-with-assembly-language
Since EIP
is the program counter, there's no way to access it directly (i.e. it can't be used as the source of a MOV instruction).
There are two ways to access it indirectly:
EIP
from the stack,EIP
) from the stack.See http://www.programmersheaven.com/mb/x86_asm/357735/357735/get-the-value-of-eip/#357740.