Dex 文件布局 - method_handles 和 call_site_ids 部分的偏移量和大小

Dex file layout - offset and size of method_handles and call_site_ids sections

我正在尝试了解 here 所述的 Dalvik 可执行文件 (dex) 的文件布局。但是,我找不到布局中描述的 call_site_idsmethod_handles 部分的偏移量和长度。

大多数其他部分(string_idstype_ids)在 header 中都有一个偏移量和长度字段,或者被引用为距文件开头的偏移量。 call_site_itemmethod_handle_item 似乎都被称为在其他地方各自部分的索引(例如,参见 VALUE_METHOD_HANDLEhere)。

我查看了@JesusFreke 的 smali project 的源代码,但它似乎没有处理这些部分。

我错过了什么吗?感谢您的帮助!

call_sites_ids 和 method_handles 部分仅在 dex 版本 38 中添加。该版本被编码为 dex magic.

的一部分

要找到 call_site_ids 和 method_handles 部分的偏移量和长度,您必须查看 map_list section that's typically at the end of the file (see: map_off in the header_item)。

call_site_items 被放置在现有的 encoded_array 数据部分。