gpt4 book ai didi

IDA-发现正的sp值错误

转载 作者:行者123 更新时间:2023-12-04 10:01:26 46 4
gpt4 key购买 nike

我们有一个DLL,我们已经失去了它的来源,因此我试图通过IDA Dissembler弄清楚它是如何工作的。但是似乎有一些我无法访问的函数,因为出现以下错误:

Decompilation failure:
46AFAF: positive sp value has been found

在IDA网站上看到的话是这样的:
The stack pointer at the specified address is higher than the initial stack pointer.
Functions behaving so strangely can not be decompiled. If you see that the stack
pointer values are incorrect, modify them with the Alt-K (Edit, Functions, Change
stack pointer) command in IDA.

http://www.hex-rays.com/products/decompiler/manual/failures.shtml#04

由于我是整个Dissembling领域的新手,因此任何人都可以提供有关导致堆栈指针高于初始堆栈指针的原因以及是否可修复的更多信息。
谢谢你的时间

最佳答案

当函数具有多个返回,而ida没有捕获到此返回时,通常会发生这种情况。
解决方案是使用alt-k将堆栈指针偏移量更改回所需的值。

一个带有ARM代码的示例:

.text:00012A10                 MOV     R0, #1          ; -0xd0 + 0
.text:00012A14 ADD SP, SP, #0xC8 ; -0xd0 + 0xc8
.text:00012A18 LDMFD SP!, {R4,PC} ; -0x08 - 0xc8 <<< modified
.text:00012A1C ; ---------------------------------------------------------------------------
.text:00012A1C
.text:00012A1C loc_12A1C ; CODE XREF: sub_129E4+20j
.text:00012A1C MOV R3, #0 ; -0xd0 + 0

在评论中,我写了alt-k值。
在0x12A18,sp偏移已重新调整为-0xd0

关于IDA-发现正的sp值错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10165511/

46 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com