5 dex文件
2024-10-21 01:05:01
Dex文件中数据结构
类型 |
含义 |
u1 |
等同于uint8_t,表示1字节无符号数 |
u2 |
等同于uint16_t,表示2字节的无符号数 |
u4 |
等同于uint32_t,表示4字节的无符号数 |
u8 |
等同于uint64_t,表示8字节的无符号数 |
sleb128 |
有符号LEB128,可变长度1~5字节 |
uleb128 |
无符号LEB128,可变长度1~5字节 |
uleb128p1 |
无符号LEB128值加1,可变长度1~5字节 |
sleb128,uleb128,uleb128p1是DEX文件中特有的数据类型
每个LEB128由1~5个字节组成,所有字节组合在一起表示一个32位的数据,
每个字节只有7位为有效位,如果第一个字节的最高位为1,则LEB128使用第二个字节,以此类推。如果读取5个字节后下一个字节的最高位仍为1则该dex文件无效,Dalvik虚拟机在验证dex时会返回失败
Dex文件整体结构
Dex由多个结构体组合而成,一个dex有7部份。
DexHeader结构体占用0x70个字节
DexFile源码文件 dalvik\libdex\DexFile.h
/*
* Structure representing a DEX file.
*
* Code should regard DexFile as opaque, using the API calls provided here
* to access specific structures.
*/
struct DexFile {
/* directly-mapped "opt" header */
const DexOptHeader* pOptHeader; /* pointers to directly-mapped structs and arrays in base DEX */
const DexHeader* pHeader;
const DexStringId* pStringIds;
const DexTypeId* pTypeIds;
const DexFieldId* pFieldIds;
const DexMethodId* pMethodIds;
const DexProtoId* pProtoIds;
const DexClassDef* pClassDefs;
const DexLink* pLinkData; /*
* These are mapped out of the "auxillary" section, and may not be
* included in the file.
*/
const DexClassLookup* pClassLookup;
const void* pRegisterMapPool; // RegisterMapClassPool /* points to start of DEX file data */
const u1* baseAddr; /* track memory overhead for auxillary structures */
int overhead; /* additional app-specific data structures associated with the DEX */
//void* auxData;
};
最新文章
- Windows 10 新特性 -- Bing Maps 3D地图开发入门(一)
- c# nullable类型有什么用
- Windows 8.1/2012R2在脱机模式下安装.NET Framework 3.5
- POJ 3321 Apple Tree(后根遍历将树转化成序列,用树状数组维护)
- Mac + IDEA + JRebel破解方法.
- (转载)Cocos2dx-OpenGL ES2.0教程:纹理贴图(6)
- PreparedStatement是如何大幅度提高性能的
- 切换到mint了,纪念一下
- 我和ASP.NET MVC有个约会
- 带拦截器配置的 struts.xml文件
- [Codeforces1132G]Greedy Subsequences——线段树+单调栈
- 【转】python 退出程序的方式
- [开源 .NET 跨平台 Crawler 数据采集 爬虫框架: DotnetSpider] [四] JSON数据解析
- 迷你音乐播放器v1.0正式上线!
- WPF编程 ,TextBlock 显示百分数值的一种简单方法。
- MongoDB(课时11 嵌套集合)
- dubbo核心流程一览
- easyui datagrid 异步加载数据时滚动条有时会自动滚到最底部的问题
- node起server--axios做前端请求----进行CORS--跨域请求
- ECSHOP和SHOPEX快递单号查询中通插件V8.6专版