作业:
返回一定要用iretd吗?可以使用retf吗?
构建陷阱门自己调用玩。
1.中断门:
eq 80b99500 0040ee00`00081000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#include "stdafx.h" __declspec(naked) void test() { __asm { int 3; retf 4; }
} int _tmain(int argc, _TCHAR* argv[]) { __asm { push 0x12345678; int 32; push 0x3b; pop fs; }
return 0; }
|
如果不进行push 的话就会直接蓝。。。

这样看retf 好像有可以?
但是..
如果我们调用一个函数,则会出现蓝屏。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#include "stdafx.h" #include <Windows.h> __declspec(naked) void test() { __asm { int 3; retf 4; }
} int _tmain(int argc, _TCHAR* argv[]) { __asm { push 0x12345678; int 32; push 0x3b; pop fs; } system("pause"); return 0; }
|
如果我们在int 32 之前调用过该函数则不会蓝屏.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#include "stdafx.h" #include <Windows.h> __declspec(naked) void test() { __asm { int 3; retf 4; }
} int _tmain(int argc, _TCHAR* argv[]) {
system("pause"); __asm { push 0x12345678; int 32; push 0x3b; pop fs; } system("pause"); return 0; }
|
如果我们在上面调用printf() 的话也会蓝屏
iretd 有解除阻塞
retf
可以人工的调用sti
sti 解除阻塞,并且给eflag的IF位改1.