IDA逆向:结构体的逆向
2024-09-07 06:36:36
源代码:
int _tmain(int argc, _TCHAR* argv[])
{
struct v1 {
int a;
short b;
char c;
int d;
double e;
};
v1* heap_struct = (v1*)malloc(sizeof(v1));
heap_struct->a = ;
heap_struct->b = ;
heap_struct->c = ;
heap_struct->d = ;
heap_struct->e = ;
return ; }
逆向分析:
结构体中的数据字段是通过名称访问的,但编译器将名称访问转换为数字偏移
所以在反汇编中难以区别
堆分配结构体
push ; Size
call ds:__imp__malloc
add esp,
cmp esi, esp
call j___RTC_CheckEsp
mov [ebp+heap_struct], eax
mov eax, [ebp+heap_struct]
mov dword ptr [eax],
mov eax,
mov ecx, [ebp+heap_struct]
mov [ecx+], ax
mov eax, [ebp+heap_struct]
mov byte ptr [eax+],
mov eax, [ebp+heap_struct]
mov dword ptr [eax+],
mov eax, [ebp+heap_struct]
fld ds:__real@
fstp qword ptr [eax+10h]
原类型 大小 偏移
int (dword)
short ()
char (byte)
int (dword)
double (qword)
为默认4字节对齐
总结:全局和栈分配方式中的结构体 与 普通变量相似 难以区分
最新文章
- tab+tab
- 1125mysqbinlog日志
- BZOJ4260: Codechef REBXOR
- linq to sql 扩展方法
- struts2与spring集成时action的class属性值意义
- Http报头Accept与Content-Type的差别
- SSE图像算法优化系列十:简单的一个肤色检测算法的SSE优化。
- Ocelot概述
- Linux 网卡聚合
- 【Core】在mvc使用EF
- C code example for strdup
- 【转】Linux 移动或重命名文件/目录-mv 的10个实用例子
- 基于数据库构建分布式的ID生成方案
- Lintcode: Majority Number II 解题报告
- selenium之数据驱动框架应用WPS个人中心自动签到
- hadoo异常——org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException
- 【MediaElement】WPF视频播放器【2】
- C语言错误处理方法、C++异常处理方法(throw, try, catch)简介
- 一键生成ssl自签名证书脚本
- 理解Python的装饰器
热门文章
- HDU 3400 Line belt (三分嵌套)
- GXU - 7D - 区间求和 - 前缀和
- HTML5 为 <;input>; 增加的属性 ; 为 <;form>; 增加的如需属性
- 基于XML的AOP配置
- Educational Codeforces Round 64 (Rated for Div. 2)D(并查集,图)
- java加密MD5实现及密码验证
- 七层登录——VB.NET版
- C#正则表达式快速入门
- thinkphp5加密解密
- java poi操作创建xslx或xsl文件,存本地和进行网络传输两种方式集成