call-pop
global _start
section .text
_start:
call next_ins
next_ins:
pop rax
; rax holds current pc
ret
; nasm -felf64 test.S && ld -o test test.o
这种方法利用了call的时候会在栈上保存ip值,之后pop就可以使某寄存器获取为该ip值了。
fldz-fstenv
global _start
section .text
bits 32
_start:
fldz
fnstenv [esp-0x0c]
pop ebx
这种方法利用了floating point environment,intel cpu的一个特性,缺点是原栈顶位置的值会发生变化
其他方法?
待续