行业解决方案查看所有行业解决方案
IDA 用于解决软件行业的关键问题。
发布时间:2023-04-19 11: 33: 48
Action name:EditFunction
Here you can change function bounds,its name and flags.In order to change only the function end address,you can use FunctionEnd command.
If the current address does not belong to any function,IDA beeps.
This command allows you to change the function frame parameters too.You can change sizes of some parts of frame structure.
IDA considers the stack as the following structure:
+------------------------------+
|function arguments|
+------------------------------+
|return address|
+------------------------------+
|saved registers(SI,DI,etc)|
+------------------------------+<-BP
|local variables|
+------------------------------+<-SP
For some processors or functions,BP may be equal to SP.In other words,it can point to the bottom of the stack frame.
You may specify the number of bytes in each part of the stack frame.The size of the return address is calculated by IDA(possibly depending on the far function flag).
"Purged bytes"specifies the number of bytes added to SP upon function return.This value will be used to calculate the SP changes at call sites(used in some calling conventions,such as __stdcall in Windows 32-bit programs.)
"BP based frame"allows IDA to automatically convert[BP+xxx]operands to stack variables.
"BP equal to SP"means that the frame pointer points to the bottom of the stack.It is usually used for the processors which set up the stack frame with EBP and ESP both pointing to the bottom of the frame(for example MC6816,M32R).
If you press
Sometimes,EBP points to the middle of the stack frame.FPD(frame pointer delta)is used to handle such situations.FPD is the value substracted from the EBP before accessing variables.An example:
push ebp
lea ebp,[esp-78h]
sub esp,588h
push ebx
push esi
lea eax,[ebp+74h]
+------------------------------+
|function arguments|
+------------------------------+
|return address|
+------------------------------+
|saved registers(SI,DI,etc)|
+------------------------------+<-typical BP
||
||
||<-actual BP
|local variables|
||
||
||
+------------------------------+<-SP
In our example,the saved registers area is empty(since EBP has been initialized before saving EBX and ESI).The difference between the'typical BP'and'actual BP'is 0x78 and this is the value of FPD.
After specifying FPD=0x78 the last instruction of the example becomes
lea eax,[ebp+78h+var_4]
where var_4=-4
Most of the time,IDA calculates the FPD value automatically.If it fails,the user can specify the value manually.
If the value of the stack pointer is modified in an unpredictable way,(e.g."and esp,-16"),then IDA marks the function as"fuzzy-sp".
If this command is invoked for an imported function,then a simplified dialog box will appear on the screen.
以下为中文翻译:
Action name:EditFunction
这里您可以更改函数边界、其名称和标志。为了只更改函数结束地址,您可以使用FunctionEnd
命令。
如果当前地址不属于任何函数,IDA发出嘟嘟声。
此命令也允许您更改函数框架参数。您可以更改框架结构的某些部分的大小。
IDA将堆栈视为以下结构:+-------------------------------+|函数参数|+-------------------------------+|返回地址|+-----------------------------------+|保存的寄存器(SI、DI等)
|
+-------------------------------+<-
BP|局部变量|+-----------------------------------+<-SP
对于某些处理器或函数,BP可能等于SP。换句话说,它可以指向堆栈帧的底部。
您可以指定堆栈帧每个部分的字节数。返回地址的大小由IDA计算(可能取决于远函数标志)。
“清除的字节”指定函数返回时添加到SP的字节数。此值将用于计算调用站点的SP更改(用于某些调用约定,如Windows 32位程序中的__stdcall)。
“基于BP的帧”允许IDA自动将[BP+xxx]操作变量转换
为堆栈变量。
“BP等于SP”意味着帧指针指向堆栈的底部。它通常用于设置堆栈帧的处理器,其中EBP和ESP都指向帧的底部(例如MC6816、M32R)。
如果您在不更改任何参数的情况下按
有时,EBP指向堆栈帧的中间。PD(帧指针delta)用于处理此类情况。PD是在访问变量之前从EBP减去的值。
例如:push EBP
lea EBP,[esp-78h]
sub esp,588h
push ebx
push esi
lea eax,[ebp+74h]+-------------------------------+
|
函数参数|+-------------------------------+|返回地址|+-----------------------------------+|保存的寄存器(SI、DI等)|+---------------------------------
+<-典型BP|||||<-实际BP|局部变量||||||+------------------------------+<-SPI-
在我们的示例中,保存的寄存器区域是空的(因为在保存EBX和ESI之前已经初始化了EBP)。“典型BP”和“实际BP”之间的差值为0x78,这是FPD的值。
指定FPD=0x78后,示例的最后一条指令变为lea-eax,[ebp+78h+var_4],
其中var_4=-4
大多数时间,IDA自动计算FPD值。如果失败,用户可以手动指定值。
如果堆栈指针的值以不可预测的方式修改(例如“and esp,-16”),则IDA将该函数标记为“fuzzy-sp”。
如果为导入的函数调用此命令,则屏幕上将显示
一个简化的对话框。
展开阅读全文
︾
读者也喜欢这些内容:
逆向工程师和黑客的区别 为什么逆向工程师都在用ida软件
在信息安全和软件开发领域,逆向工程师和黑客是两个备受关注的角色。尽管两者都涉及代码分析和破解,但在职业目标、方法和道德规范上存在显著差异。同时,IDA软件作为逆向工程师的首选工具,其受欢迎的原因也值得探讨。本文将详细分析“逆向工程师和黑客的区别 为什么逆向工程师都在用ida软件”这一主题,并进一步介绍常用的逆向工程软件。...
阅读全文 >
怎么反汇编一个程序?通过IDA软件反汇编后如何进一步分析程序结构?
在软件开发和安全研究中,反汇编是一个重要的技术手段,通过反汇编,可以将二进制程序转换为汇编代码,从而了解程序的内部工作原理。IDA Pro是一款广泛使用的反汇编工具,它提供了强大的功能和灵活的接口,帮助研究人员深入分析程序结构。那么,怎么反汇编一个程序?通过IDA软件反汇编后如何进一步分析程序结构?本文将详细介绍这些问题,并探讨IDA Pro是否支持苹果M系列芯片。...
阅读全文 >
反编译后代码怎么定位?如何利用IDA反编译功能定位关键代码?
在软件开发和安全领域中,反编译是一项重要的技术。反编译后代码怎么定位?如何利用IDA反编译功能定位关键代码?这些问题常常困扰着初学者和经验丰富的逆向工程师。在这篇文章中,我们将深入探讨这些问题,并提供详细的解决方案。...
阅读全文 >
ida lumina是什么?ida lumina的应用场景有哪些?
在软件开发和逆向工程领域,IDA Pro是一个广为人知的工具,用于反编译和分析二进制文件。而IDA Lumina是IDA Pro中的一个新功能,专注于提高反编译和分析的效率。那么,IDA Lumina具体是什么?它有哪些应用场景?本文将详细解答这些问题,并介绍IDA的不同版本。...
阅读全文 >