Dex File Format
来源:互联网 发布:淘宝上怎么出售qq号码 编辑:程序博客网 时间:2024/06/02 05:21
Dex File Format
Introduction
This information is based on an old version of the Android SDK from before the G1 was released. The format has changed somewhat since then and I believe Google has released official documentation.If you've been paying attention to the tech news lately you might have heard about a little something called Android from Google. Android is a new mobile phone platform based on Linux and Java, but unlike other Java platforms Android uses a non-standard JVM called Dalvik. While Google has promised to release much (all?) of Android under an open source license, they haven't done so yet and they also haven't released any documentation on this new VM. Being somewhat impatient, I've taken it upon myself to do some reverse engineering and put together some documentation of my own. This page documents the Dex file format that compiled programs get translated into for use on the Dalvik VM. I hope to write some documentation on the VM itself in the near future.
File Header
Dex files start with a simple header with some checksums and offsets to other structuresNotes: All non-string fields are stored in little-endian format. It would appear that the checksum and signature fields are assumed to be zero when calculating the checksum and signature.
String Table
This table stores the length and offsets for every string in the Dex file including string constants, class names, variable names and more. Each entry has the following format:Notes: Although the length of the string is stored in this table. All strings also have C-style null-terminators
Class List
A list of all classes referenced or conatined in this dex file. Each entry has the following format:Field Table
A table of fields of all classes defined in this dex file. Each entry has the following format:Method Table
A table of methods of all classes defined in this dex file. Each entry has the following format:Class Definition Table
A table of class definitions for all classes either defined in this dex file or has a method or field accessed by code in this dex file. Each entry has the following format:Notes: Any of the list offset fields can be NULL in which case the class doesn't have any elements of that type. Not every class in the class list will necessarily have an entry in the class definition table.
Field List
Stores data for pre-initialized fields in a class. The list is formed of a 32-bit integer containing the number of entries followed by the entries themselves. Each field has an entry with the following format:Notes: If the field does not have a pre-initialized value it will be filled with 0 for primitive types and -1 for object types.
Method List
A list of methods for a particular class. Begins with a 32-bit integer that contains the number of items in the list followed by entries in the following format.Code Header
This header contains information about the code that implements a method.Notes: The code offset field actually points to a 32-bit integer that contains the number of 16-bit words in the instruction stream. The actual VM instructions follow this integer.
Local Variable List
A list of local variables for a particular method. Begins with a 32-bit integer that contains the number of items in the list. Each entry has the following format:Notes: This list will include local variables that are arguments to the method as well as the "this" variable for non-static methods.
ToDo
Add documentation on Position list and constant objects for pre-initialized fields.Questions
If you have any questions about this document feel free to send me an e-mail at pavone@retrodev.com.- Dex File Format
- dex file format
- file format
- 各种 file format
- avi file format(转载)
- PE file format LUEVELSMEYER
- all File Format
- BMP file format
- MICROSOFT EXCEL FILE FORMAT
- The WAVE file format
- The PE file format
- SWF File Format Specification
- GIF File Format Summary
- BMP file format
- RealMedia File Format (RMFF)
- PBL(PBD) File Format
- SWF File Format Specification
- The PE file format
- python 汉字转换成百分号格式
- ODI知识模块--IKM Oracle Incremental Update
- 关于将自定义图片加入uinavigation
- Java中的值传递和引用传递
- 网络安全基础篇之<十>
- Dex File Format
- ListView多类型Item
- 冯玉祥之变
- 基类中成员的访问限定符和派生类的继承方式
- 用对象和用指向基类的指针访问成员函数
- Java程序优化的一些最佳实践
- MFC中获取各种类(文档、视图、框架、应用程序)指针的方法
- C#基础(4)
- Handlebars的registerHelper方法实现if标签判断是否等于某个特定值