当前位置:网站首页>IDA PRO中汇编结构体识别
IDA PRO中汇编结构体识别
2022-07-31 21:33:00 【不会写代码的丝丽】
概述
我们有如下一段代码:
#include<stdio.h>
struct My_Struct
{
char name[500];
int age;
int height;
};
struct My_Struct obtainStruct() {
struct My_Struct p = {
"sdsdsds",2,3 };
printf("%s\r\n", p.name);
printf("diff %d\r\n", (size_t)&p.age-(size_t)&p.name);
printf("%d\r\n", p.height);
return p;
}
int main()
{
struct My_Struct p =obtainStruct();
printf("%s\r\n", p.name);
printf("%d\r\n", p.age);
printf("%d\r\n", p.height);
return 0;
}
我们首先把一些call调用的函数名称加上
首先我们注意到个细节 栈区有两个变量默认名称分别为var_3fc和ArgList刚好相差508个字节。而这个字节大小正好是我们定义My_Struct结构体的大小。
另外这里都是 IDA提示都是负数并且都是基于EBP进行加减得到,所以这两个数都是本地变量,而不是函数调用传入的。
举个例子:
具体原因也比较简单:
你可以参阅以下图的栈图结构:
从上图可知 栈区临时定义的变量会在EBP之下,传入的参数会在EBP之上。EBP-xxx 可以得到临时变量 ,而EBP+可以得到传入参数等。
我们打开IDA PRO的结构体视图按下insert键插入一个新的自定义结构体
在上面右键可以添加相对应字段
我们最后利用IDA 看看这段代码的本质含义:
边栏推荐
- Apache EventMesh distributed event-driven multi-runtime
- Architecture Battalion Module 8 Homework
- Qualcomm cDSP simple programming example (to query Qualcomm cDSP usage, signature), RK3588 npu usage query
- 【公开课预告】:超分辨率技术在视频画质增强领域的研究与应用
- Returns a zero-length array or empty collection, do not return null
- 【论文精读】iNeRF
- 【Yugong Series】July 2022 Go Teaching Course 025-Recursive Function
- Architect 04 - Application Service Encryption Design and Practice
- 【核心概念】图像分类和目标检测中的正负样本划分以及架构理解
- ECCV 2022 Huake & ETH propose OSFormer, the first one-stage Transformer framework for camouflaging instance segmentation!The code is open source!...
猜你喜欢
Daily practice——Randomly generate an integer between 1-100 and see how many times you can guess.Requirements: The number of guesses cannot exceed 7 times, and after each guess, it will prompt "bigger"
NVIDIA已经开始测试AD106和AD107 GPU核心的显卡产品
Chapter Six
21. Support Vector Machine - Introduction to Kernel Functions
GateWay implements load balancing
高通cDSP简单编程例子(实现查询高通cDSP使用率、签名),RK3588 npu使用率查询
第七章
[Code Hoof Set Novice Village 600 Questions] Leading to the combination of formulas and programs
【PIMF】OpenHarmony 啃论文俱乐部—盘点开源鸿蒙三方库【3】
The principle of ReentrantLock (to be continued)
随机推荐
PCB stackup design
关注!海泰方圆加入《个人信息保护自律公约》
Several methods of mysql backup table
Financial profitability and solvency indicators
ojdbc8 "Recommended Collection"Talking about the algorithm security of network security
sqlite3简单操作
Flink_CDC construction and simple use
pytorch lstm时间序列预测问题踩坑「建议收藏」
linux view redis version command (linux view mysql version number)
Pytorch lstm time series prediction problem stepping on the pit "recommended collection"
-xms -xmx(information value)
grep command written test questions
Poker Game in C# -- Introduction and Code Implementation of Blackjack Rules
Routing interception of WeChat applet
微信小程序的路由拦截
spark reports an error OutOfMemory "recommended collection"
uni-app中的renderjs使用
Three.js入门
Basic Grammar Introduction of Carbon Tutorial (Tutorial)