【发布时间】:2012-11-16 08:17:30
【问题描述】:
这里,在这个函数prologue中,ecx被连续两次压栈,为什么??
push ebp
mov ebp, esp
push ecx
push ecx
and [ebp+var_8], 0
and [ebp+var_4], 0
push ebx
mov ebx, [ebp+arg_0]
push esi
push edi
or edi, 0FFFFFFFFh
push edi ; size_t
lea eax, [ebp+var_8]
push eax ; int
mov eax, [ebp+arg_4]
call sub_671FF38E
push 2Eh ; wchar_t
lea esi, [ebp+var_8]
call sub_673AFD82
cmp eax, edi
jz loc_677E564B
【问题讨论】:
-
最好的猜测是例程的形式是
void func(int n, ...) { int a=n, b=n, c=... ; func2(...); };,其中一些参数——不一定是第一个——在ecx中传递。 -
另一种猜测是只是为了在栈上预留空间,而且两次push比
sub esp, 8短。
标签: assembly