dex文件格式
数据结构
u1:等同于uint8_t,表示1字节的无符号数
u2
u4
u8
sleb128:有符号LEB128,可变长度15字节5字节
uleb128:无符号LEB128,可变长度1
uleb128p1:无符号LEB128指加1,可变长度1~5字节
uleb128:
1 | 00001001 10000111 01100101 624485的2进制表示 |
sleb128:
1 | 11110110 01111000 10011011 -624485的2进制表示(呵呵,负数在计算机中是如何表示的,大家没有忘吧:)补码啊补码) |
文件结构
header:
1 | /* |
string_ids: the list of DexStringId
1 | struct DexStringId { |
type_ids: the list of DexTypeId
1 | struct DexTypeId { |
proto_ids: the list ofDexProtoId
1 | struct DexProtoId { |
field_ids: the list of DexFieldId
1 | struct DexFieldId { |
method_ids: the list of DexMethodId
1 | struct DexMethodId { |
class_defs: the list of DexClassDef
1 | struct DexClassDef { |
map:the list of DexMapItem and the list size
1 | struct DexMapList { |
1 | struct DexMapItem { |