日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

5 dex文件

發(fā)布時(shí)間:2025/3/15 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 5 dex文件 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

Dex文件中數(shù)據(jù)結(jié)構(gòu)

類型

含義

u1

等同于uint8_t,表示1字節(jié)無(wú)符號(hào)數(shù)

u2

等同于uint16_t,表示2字節(jié)的無(wú)符號(hào)數(shù)

u4

等同于uint32_t,表示4字節(jié)的無(wú)符號(hào)數(shù)

u8

等同于uint64_t,表示8字節(jié)的無(wú)符號(hào)數(shù)

sleb128

有符號(hào)LEB128,可變長(zhǎng)度1~5字節(jié)

uleb128

無(wú)符號(hào)LEB128,可變長(zhǎng)度1~5字節(jié)

uleb128p1

無(wú)符號(hào)LEB128值加1,可變長(zhǎng)度1~5字節(jié)

?

sleb128,uleb128,uleb128p1是DEX文件中特有的數(shù)據(jù)類型

每個(gè)LEB128由1~5個(gè)字節(jié)組成,所有字節(jié)組合在一起表示一個(gè)32位的數(shù)據(jù),

每個(gè)字節(jié)只有7位為有效位,如果第一個(gè)字節(jié)的最高位為1,則LEB128使用第二個(gè)字節(jié),以此類推。如果讀取5個(gè)字節(jié)后下一個(gè)字節(jié)的最高位仍為1則該dex文件無(wú)效,Dalvik虛擬機(jī)在驗(yàn)證dex時(shí)會(huì)返回失敗

?

Dex文件整體結(jié)構(gòu)

Dex由多個(gè)結(jié)構(gòu)體組合而成,一個(gè)dex有7部份。

DexHeader結(jié)構(gòu)體占用0x70個(gè)字節(jié)

DexFile源碼文件 dalvik\libdex\DexFile.h

3 /* 4 * Structure representing a DEX file. 5 * 6 * Code should regard DexFile as opaque, using the API calls provided here 7 * to access specific structures. 8 */ 9 struct DexFile { 10 /* directly-mapped "opt" header */ 11 const DexOptHeader* pOptHeader; 12 13 /* pointers to directly-mapped structs and arrays in base DEX */ 14 const DexHeader* pHeader; 15 const DexStringId* pStringIds; 16 const DexTypeId* pTypeIds; 17 const DexFieldId* pFieldIds; 18 const DexMethodId* pMethodIds; 19 const DexProtoId* pProtoIds; 20 const DexClassDef* pClassDefs; 21 const DexLink* pLinkData; 22 23 /* 24 * These are mapped out of the "auxillary" section, and may not be 25 * included in the file. 26 */ 27 const DexClassLookup* pClassLookup; 28 const void* pRegisterMapPool; // RegisterMapClassPool 29 30 /* points to start of DEX file data */ 31 const u1* baseAddr; 32 33 /* track memory overhead for auxillary structures */ 34 int overhead; 35 36 /* additional app-specific data structures associated with the DEX */ 37 //void* auxData; 38 };

轉(zhuǎn)載于:https://www.cnblogs.com/heixiang/p/10965084.html

總結(jié)

以上是生活随笔為你收集整理的5 dex文件的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。