为什么 Ghidra 错误地解释了这一点?这个例子非常简单。
在这个堆栈中:
0019FF58 $-8 0019FF58 00000002 LOCAL 2
0019FF5C $-4 0019FF5C 00000001 LOCAL 1
0019FF60 $ ==> 0019FF60 0019FF80 OLD EBP
0019FF64 $+4 0019FF64 | 00401025 return to layout.00401025 from layout.sub_40102C
0019FF68 $+8 0019FF68 | 00000041 PARAM 3
0019FF6C $+C 0019FF6C | 0000BABE PARAM 2
0019FF70 $+10 0019FF70 | 0000CAFE PARAM 1
吉德拉获得:
undefined4 Stack[0x4]:4 param_1 XREF[1]: 00401040 (R)
undefined4 Stack[0x8]:4 param_2 XREF[1]: 00401043 (R)
undefined4 Stack[0xc]:4 param_3 XREF[1]: 00401046 (R)
undefined4 Stack[-0x8]:4 local_8 XREF[1]: 00401032 (W)
undefined4 Stack[-0xc]:4 local_c XREF[1]: 00401039 (W)
00401032 C745FC01000000 MOV dword ptr [EBP + local_8 ],0x1
00401039 C745F802000000 MOV dword ptr [EBP + local_c ],0x2
00401040 8B5D08 MOV EBX ,dword ptr [EBP + param_1 ]
00401043 8B4D0C MOV ECX ,dword ptr [EBP + param_2 ]
00401046 FF7510 PUSH dword ptr [EBP + param_3 ]
而 IDA 正确获得:
.text:0040102C var_8 = dword ptr -8
.text:0040102C var_4 = dword ptr -4
.text:0040102C arg_0 = dword ptr 8
.text:0040102C arg_4 = dword ptr 0Ch
.text:0040102C arg_8 = dword ptr 10h
.text:00401032 mov [ebp+var_4], 1
.text:00401039 mov [ebp+var_8], 2
.text:00401040 mov ebx, [ebp+arg_0]
.text:00401043 mov ecx, [ebp+arg_4]