首页
社区
课程
招聘
[求助]call _EP_prolog是什么意思呢?
发表于: 2006-5-13 14:47 7523

[求助]call _EP_prolog是什么意思呢?

2006-5-13 14:47
7523
收藏
免费 7
支持
分享
最新回复 (1)
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
VC编译出来的程序有bp-based frame、non bp-based frame之
分,就是说函数入口处是否有显式的"push ebp/mov ebp, esp"或者enter指令存在。
如果两个push之后是"call __SEH_prolog"指令,就属于non bp-based frame情形。
据我逆向经验,XP SP1/ntdll中涉及SEH/__try块的基本都是non bp-based frame情
形,此时stack布局如下:

--------------------------------------------------------------------------
内存高址方向

[EBP+0x004] RetAddr
[EBP-0x000] _ebp
[EBP-0x004] trylevel
[EBP-0x008] scopetable
[EBP-0x00C] handler
[EBP-0x010] prev
[EBP-0x014] PEXCEPTION_POINTERS/GetExceptionInformation()
[EBP-0x018] Hold the final ESP after all the prologue code has executed
[EBP-0x01C] 第001个局部变量

内存低址方向
--------------------------------------------------------------------------

hume指出2000/ntdll是bp-based frame情形,此时第001个局部变量是[EBP-0x004]。

====================================
以上内容载自dffK9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8Y4N6%4N6#2)9J5k6h3!0H3k6h3&6U0K9X3E0Q4x3X3g2G2M7X3N6Q4x3V1k6Q4y4@1g2K6j5%4A6Q4x3V1k6%4K9h3&6V1L8%4N6K6i4K6u0r3x3U0l9H3x3K6p5I4x3U0x3I4y4e0f1H3i4K6u0W2N6s2S2@1

我们可以逆向一下_SEH_PROLOG函数:
lkd> uf _SEH_PROLOG
ntdll!_SEH_prolog:
7c92edc2 6818ee927c       push    0x7c92ee18
7c92edc7 64a100000000     mov     eax,fs:[00000000]
7c92edcd 50               push    eax
7c92edce 8b442410         mov     eax,[esp+0x10]
7c92edd2 896c2410         mov     [esp+0x10],ebp
7c92edd6 8d6c2410         lea     ebp,[esp+0x10]
7c92edda 2be0             sub     esp,eax
7c92eddc 53               push    ebx
7c92eddd 56               push    esi
7c92edde 57               push    edi
7c92eddf 8b45f8           mov     eax,[ebp-0x8]
7c92ede2 8965e8           mov     [ebp-0x18],esp
7c92ede5 50               push    eax
7c92ede6 8b45fc           mov     eax,[ebp-0x4]
7c92ede9 c745fcffffffff   mov     dword ptr [ebp-0x4],0xffffffff
7c92edf0 8945f8           mov     [ebp-0x8],eax
7c92edf3 8d45f0           lea     eax,[ebp-0x10]
7c92edf6 64a300000000     mov     fs:[00000000],eax
7c92edfc c3               ret

而0x7c92ee18而地址为ntdll!_except_handler3函数
lkd> u 0x7c92ee18
ntdll!_except_handler3:
7c92ee18 55               push    ebp
7c92ee19 8bec             mov     ebp,esp
7c92ee1b 83ec08           sub     esp,0x8
。。。。。。。。。。。。。
2006-5-13 20:01
0
游客
登录 | 注册 方可回帖
返回