所以我在 IDA 中做了一些 REing,改变了一个函数参数类型,突然我的堆栈指针搞砸了 ( 1025B361: inconsistent fpu stack
)。有谁知道在这里寻找什么或如何解决它?
我尝试了以下方法:
- 取消定义-重新定义和更改参数类型。
- 在伪代码中将 `double game_time` 类型更改为 `float`,但它不会让我(`抱歉,不能更改变量类型`,因为它在伪代码中使用)。
- 将堆栈定义从 `0000018C var_18C dq ?` 更改为 `dd`。
- 更改 `director_debug` 的签名。
- 手动编辑 HEX 代码从 `DD 1C 24` 到 `D9 1C 24`(强制 m32fp)。
- 依次为:更改函数签名、更改堆栈值、取消定义调用函数并将其重新定义为函数(代码)。
然而,这些都没有帮助。
伪代码
_EDX = game_time_ptr_12; //float edx@2
__asm
{
fld dword ptr [edx+0Ch]
fstp [esp+18Ch+var_18C]
}
director_debug("%3.2f: Director debug: %s.\n", *(_QWORD *)&game_time, "NORMAL MODE"); //double||__int64 game_time ST24 8@2
拆卸
.text:1025B35B 0 184 mov edx, game_time_ptr_12
.text:1025B361 0 184 fld dword ptr [edx+0Ch]
.text:1025B364 1 184 push offset aNormalMode ; "NORMAL MODE"
.text:1025B369 1 188 sub esp, 8
.text:1025B36C 1 190 fstp [esp+18Ch+var_18C] ;qword ptr [esp]
.text:1025B36F 0 190 push offset a3_2fDirectorDe ; "%3.2f: Director debug: %s.\n"
.text:1025B374 0 194 call director_debug
它应该变成什么
game_time = *(game_time_ptr_12) + 12);
director_debug("%3.2f: Director debug: %s.\n", game_time, "NORMAL MODE");