我在一段代码中发现了以下几行(使用 IDA PRO):
...
...
push 44h
pop edi
push edi ; size_t
xor esi, esi
lea eax, [ebp+StartupInfo]
push esi ; int
push eax ; void *
call _memset
...
...
当我看到lea eax, [ebp+StartupInfo]这一行时,我想,好吧,eax 是指向结构 STARTUPINFO 的指针。使用 int esi = 0 或 NULL(请参阅xor esi, esi 行)和 size_t edi = 44h 并通过调用 memset,它们必须填充 STARTUPINFO 的前 44 个字节(即元素 cb、lpReserved.... ,wShowWindow)。
但是行 push eax ; 空白 *
激怒我。eax 如何同时具有 Startupinfo 和 void 类型?
之后,我发现memset()-function的第一个参数必须是void类型。所以,我心中的问号现在更大了……