Lines Matching refs:dex
104 const char* DexFileVerifier::CheckLoadStringByIdx(dex::StringIndex idx, const char* error_string) { in CheckLoadStringByIdx()
111 const char* DexFileVerifier::CheckLoadStringByTypeIdx(dex::TypeIndex type_idx, in CheckLoadStringByTypeIdx()
119 const dex::FieldId* DexFileVerifier::CheckLoadFieldId(uint32_t idx, const char* error_string) { in CheckLoadFieldId()
126 const dex::MethodId* DexFileVerifier::CheckLoadMethodId(uint32_t idx, const char* err_string) { in CheckLoadMethodId()
133 const dex::ProtoId* DexFileVerifier::CheckLoadProtoId(dex::ProtoIndex idx, in CheckLoadProtoId()
157 const dex::MethodId* (var) = CheckLoadMethodId(idx, error_string); \
164 const dex::FieldId* (var) = CheckLoadFieldId(idx, fmt); \
388 const dex::MapList* map = reinterpret_cast<const dex::MapList*>(begin_ + header_->map_off_); in CheckMap()
390 if (!CheckListSize(map, 1, sizeof(dex::MapList), "maplist content")) { in CheckMap()
394 const dex::MapItem* item = map->list_; in CheckMap()
404 if (!CheckListSize(item, count, sizeof(dex::MapItem), "map size")) { in CheckMap()
528 bool DexFileVerifier::CheckAndGetHandlerOffsets(const dex::CodeItem* code_item, in CheckAndGetHandlerOffsets()
581 dex::TypeIndex class_type_index, in CheckClassDataItemField()
589 dex::TypeIndex my_class_index = in CheckClassDataItemField()
590 (reinterpret_cast<const dex::FieldId*>(begin_ + header_->field_ids_off_) + idx)->class_idx_; in CheckClassDataItemField()
618 dex::TypeIndex class_type_index, in CheckClassDataItemMethod()
627 const dex::MethodId& method_id = in CheckClassDataItemMethod()
628 *(reinterpret_cast<const dex::MethodId*>(begin_ + header_->method_ids_off_) + idx); in CheckClassDataItemMethod()
631 dex::TypeIndex my_class_index = method_id.class_idx_; in CheckClassDataItemMethod()
912 dex::TypeIndex* class_type_index, in FindClassIndexAndDef()
913 const dex::ClassDef** output_class_def) { in FindClassIndexAndDef()
925 (reinterpret_cast<const dex::FieldId*>(begin_ + header_->field_ids_off_) + index)-> in FindClassIndexAndDef()
929 (reinterpret_cast<const dex::MethodId*>(begin_ + header_->method_ids_off_) + index)-> in FindClassIndexAndDef()
940 const dex::ClassDef* class_def_begin = in FindClassIndexAndDef()
941 reinterpret_cast<const dex::ClassDef*>(begin_ + header_->class_defs_off_); in FindClassIndexAndDef()
943 const dex::ClassDef* class_def = class_def_begin + i; in FindClassIndexAndDef()
967 bool DexFileVerifier::CheckStaticFieldTypes(const dex::ClassDef* class_def) { in CheckStaticFieldTypes()
980 const dex::TypeId& type_id = dex_file_->GetTypeId(dex_file_->GetFieldId(index).type_idx_); in CheckStaticFieldTypes()
1070 dex::TypeIndex* class_type_index, in CheckIntraClassDataItemFields()
1071 const dex::ClassDef** class_def) { in CheckIntraClassDataItemFields()
1122 dex::TypeIndex* class_type_index, in CheckIntraClassDataItemMethods()
1123 const dex::ClassDef** class_def) { in CheckIntraClassDataItemMethods()
1177 dex::TypeIndex class_type_index; in CheckIntraClassDataItem()
1178 const dex::ClassDef* class_def = nullptr; in CheckIntraClassDataItem()
1234 const dex::CodeItem* code_item = reinterpret_cast<const dex::CodeItem*>(ptr_); in CheckIntraCodeItem()
1235 if (!CheckListSize(code_item, 1, sizeof(dex::CodeItem), "code")) { in CheckIntraCodeItem()
1277 const dex::TryItem* try_items = accessor.TryItems().begin(); in CheckIntraCodeItem()
1278 if (!CheckListSize(try_items, try_items_size, sizeof(dex::TryItem), "try_items size")) { in CheckIntraCodeItem()
1560 const dex::HiddenapiClassData* item = reinterpret_cast<const dex::HiddenapiClassData*>(ptr_); in CheckIntraHiddenapiClassData()
1587 const dex::ClassDef& class_def = dex_file_->GetClassDef(i); in CheckIntraHiddenapiClassData()
1660 const dex::AnnotationsDirectoryItem* item = in CheckIntraAnnotationsDirectoryItem()
1661 reinterpret_cast<const dex::AnnotationsDirectoryItem*>(ptr_); in CheckIntraAnnotationsDirectoryItem()
1662 if (!CheckListSize(item, 1, sizeof(dex::AnnotationsDirectoryItem), "annotations_directory")) { in CheckIntraAnnotationsDirectoryItem()
1667 const dex::FieldAnnotationsItem* field_item = in CheckIntraAnnotationsDirectoryItem()
1668 reinterpret_cast<const dex::FieldAnnotationsItem*>(item + 1); in CheckIntraAnnotationsDirectoryItem()
1672 sizeof(dex::FieldAnnotationsItem), in CheckIntraAnnotationsDirectoryItem()
1689 const dex::MethodAnnotationsItem* method_item = in CheckIntraAnnotationsDirectoryItem()
1690 reinterpret_cast<const dex::MethodAnnotationsItem*>(field_item); in CheckIntraAnnotationsDirectoryItem()
1694 sizeof(dex::MethodAnnotationsItem), in CheckIntraAnnotationsDirectoryItem()
1711 const dex::ParameterAnnotationsItem* parameter_item = in CheckIntraAnnotationsDirectoryItem()
1712 reinterpret_cast<const dex::ParameterAnnotationsItem*>(method_item); in CheckIntraAnnotationsDirectoryItem()
1714 if (!CheckListSize(parameter_item, parameter_count, sizeof(dex::ParameterAnnotationsItem), in CheckIntraAnnotationsDirectoryItem()
1765 if (!CheckListSize(ptr_, 1, sizeof(dex::StringId), "string_ids")) { in CheckIntraSectionIterate()
1768 ptr_ += sizeof(dex::StringId); in CheckIntraSectionIterate()
1772 if (!CheckListSize(ptr_, 1, sizeof(dex::TypeId), "type_ids")) { in CheckIntraSectionIterate()
1775 ptr_ += sizeof(dex::TypeId); in CheckIntraSectionIterate()
1779 if (!CheckListSize(ptr_, 1, sizeof(dex::ProtoId), "proto_ids")) { in CheckIntraSectionIterate()
1782 ptr_ += sizeof(dex::ProtoId); in CheckIntraSectionIterate()
1786 if (!CheckListSize(ptr_, 1, sizeof(dex::FieldId), "field_ids")) { in CheckIntraSectionIterate()
1789 ptr_ += sizeof(dex::FieldId); in CheckIntraSectionIterate()
1793 if (!CheckListSize(ptr_, 1, sizeof(dex::MethodId), "method_ids")) { in CheckIntraSectionIterate()
1796 ptr_ += sizeof(dex::MethodId); in CheckIntraSectionIterate()
1800 if (!CheckListSize(ptr_, 1, sizeof(dex::ClassDef), "class_defs")) { in CheckIntraSectionIterate()
1803 ptr_ += sizeof(dex::ClassDef); in CheckIntraSectionIterate()
1807 if (!CheckListSize(ptr_, 1, sizeof(dex::CallSiteIdItem), "call_site_ids")) { in CheckIntraSectionIterate()
1810 ptr_ += sizeof(dex::CallSiteIdItem); in CheckIntraSectionIterate()
1814 if (!CheckListSize(ptr_, 1, sizeof(dex::MethodHandleItem), "method_handles")) { in CheckIntraSectionIterate()
1817 ptr_ += sizeof(dex::MethodHandleItem); in CheckIntraSectionIterate()
1821 if (!CheckList(sizeof(dex::TypeItem), "type_list", &ptr_)) { in CheckIntraSectionIterate()
1827 if (!CheckList(sizeof(dex::AnnotationSetRefItem), "annotation_set_ref_list", &ptr_)) { in CheckIntraSectionIterate()
1994 const dex::MapList* map = reinterpret_cast<const dex::MapList*>(begin_ + header_->map_off_); in CheckIntraSection()
1995 const dex::MapItem* item = map->list_; in CheckIntraSection()
2059 ptr_ += sizeof(uint32_t) + (map->size_ * sizeof(dex::MapItem)); in CheckIntraSection()
2060 offset = section_offset + sizeof(uint32_t) + (map->size_ * sizeof(dex::MapItem)); in CheckIntraSection()
2119 dex::TypeIndex DexFileVerifier::FindFirstClassDataDefiner(const uint8_t* ptr, bool* success) { in FindFirstClassDataDefiner()
2127 *success = false; return dex::TypeIndex(DexFile::kDexNoIndex16)) in FindFirstClassDataDefiner()
2135 *success = false; return dex::TypeIndex(DexFile::kDexNoIndex16)) in FindFirstClassDataDefiner()
2139 return dex::TypeIndex(DexFile::kDexNoIndex16); in FindFirstClassDataDefiner()
2142 dex::TypeIndex DexFileVerifier::FindFirstAnnotationsDirectoryDefiner(const uint8_t* ptr, in FindFirstAnnotationsDirectoryDefiner()
2144 const dex::AnnotationsDirectoryItem* item = in FindFirstAnnotationsDirectoryDefiner()
2145 reinterpret_cast<const dex::AnnotationsDirectoryItem*>(ptr); in FindFirstAnnotationsDirectoryDefiner()
2149 dex::FieldAnnotationsItem* field_items = (dex::FieldAnnotationsItem*) (item + 1); in FindFirstAnnotationsDirectoryDefiner()
2151 *success = false; return dex::TypeIndex(DexFile::kDexNoIndex16)) in FindFirstAnnotationsDirectoryDefiner()
2156 dex::MethodAnnotationsItem* method_items = (dex::MethodAnnotationsItem*) (item + 1); in FindFirstAnnotationsDirectoryDefiner()
2158 *success = false; return dex::TypeIndex(DexFile::kDexNoIndex16)) in FindFirstAnnotationsDirectoryDefiner()
2163 dex::ParameterAnnotationsItem* parameter_items = (dex::ParameterAnnotationsItem*) (item + 1); in FindFirstAnnotationsDirectoryDefiner()
2165 *success = false; return dex::TypeIndex(DexFile::kDexNoIndex16)) in FindFirstAnnotationsDirectoryDefiner()
2169 return dex::TypeIndex(DexFile::kDexNoIndex16); in FindFirstAnnotationsDirectoryDefiner()
2173 const dex::StringId* item = reinterpret_cast<const dex::StringId*>(ptr_); in CheckInterStringIdItem()
2182 const dex::StringId* prev_item = reinterpret_cast<const dex::StringId*>(previous_item_); in CheckInterStringIdItem()
2191 ptr_ += sizeof(dex::StringId); in CheckInterStringIdItem()
2196 const dex::TypeId* item = reinterpret_cast<const dex::TypeId*>(ptr_); in CheckInterTypeIdItem()
2208 const dex::TypeId* prev_item = reinterpret_cast<const dex::TypeId*>(previous_item_); in CheckInterTypeIdItem()
2217 ptr_ += sizeof(dex::TypeId); in CheckInterTypeIdItem()
2222 const dex::ProtoId* item = reinterpret_cast<const dex::ProtoId*>(ptr_); in CheckInterProtoIdItem()
2265 const dex::ProtoId* prev = reinterpret_cast<const dex::ProtoId*>(previous_item_); in CheckInterProtoIdItem()
2274 dex::TypeIndex prev_idx = prev_it.GetTypeIdx(); in CheckInterProtoIdItem()
2275 dex::TypeIndex curr_idx = curr_it.GetTypeIdx(); in CheckInterProtoIdItem()
2276 DCHECK_NE(prev_idx, dex::TypeIndex(DexFile::kDexNoIndex16)); in CheckInterProtoIdItem()
2277 DCHECK_NE(curr_idx, dex::TypeIndex(DexFile::kDexNoIndex16)); in CheckInterProtoIdItem()
2298 ptr_ += sizeof(dex::ProtoId); in CheckInterProtoIdItem()
2303 const dex::FieldId* item = reinterpret_cast<const dex::FieldId*>(ptr_); in CheckInterFieldIdItem()
2328 const dex::FieldId* prev_item = reinterpret_cast<const dex::FieldId*>(previous_item_); in CheckInterFieldIdItem()
2345 ptr_ += sizeof(dex::FieldId); in CheckInterFieldIdItem()
2350 const dex::MethodId* item = reinterpret_cast<const dex::MethodId*>(ptr_); in CheckInterMethodIdItem()
2375 const dex::MethodId* prev_item = reinterpret_cast<const dex::MethodId*>(previous_item_); in CheckInterMethodIdItem()
2392 ptr_ += sizeof(dex::MethodId); in CheckInterMethodIdItem()
2397 const dex::ClassDef* item = reinterpret_cast<const dex::ClassDef*>(ptr_); in CheckInterClassDefItem()
2459 const dex::ClassDef* superclass_def = dex_file_->FindClassDef(item->superclass_idx_); in CheckInterClassDefItem()
2483 const dex::TypeList* interfaces = dex_file_->GetInterfacesList(*item); in CheckInterClassDefItem()
2498 const dex::ClassDef* interface_def = in CheckInterClassDefItem()
2528 dex::TypeIndex idx1 = interfaces->GetTypeItem(i).type_idx_; in CheckInterClassDefItem()
2530 dex::TypeIndex idx2 = interfaces->GetTypeItem(j).type_idx_; in CheckInterClassDefItem()
2543 dex::TypeIndex data_definer = FindFirstClassDataDefiner(data, &success); in CheckInterClassDefItem()
2548 (data_definer != dex::TypeIndex(DexFile::kDexNoIndex16)))) { in CheckInterClassDefItem()
2563 dex::TypeIndex annotations_definer = FindFirstAnnotationsDirectoryDefiner(data, &success); in CheckInterClassDefItem()
2568 (annotations_definer != dex::TypeIndex(DexFile::kDexNoIndex16)))) { in CheckInterClassDefItem()
2574 ptr_ += sizeof(dex::ClassDef); in CheckInterClassDefItem()
2579 const dex::CallSiteIdItem* item = reinterpret_cast<const dex::CallSiteIdItem*>(ptr_); in CheckInterCallSiteIdItem()
2629 ptr_ += sizeof(dex::CallSiteIdItem); in CheckInterCallSiteIdItem()
2634 const dex::MethodHandleItem* item = reinterpret_cast<const dex::MethodHandleItem*>(ptr_); in CheckInterMethodHandleItem()
2662 ptr_ += sizeof(dex::MethodHandleItem); in CheckInterMethodHandleItem()
2667 const dex::AnnotationSetRefList* list = reinterpret_cast<const dex::AnnotationSetRefList*>(ptr_); in CheckInterAnnotationSetRefList()
2668 const dex::AnnotationSetRefItem* item = list->list_; in CheckInterAnnotationSetRefList()
2684 const dex::AnnotationSetItem* set = reinterpret_cast<const dex::AnnotationSetItem*>(ptr_); in CheckInterAnnotationSetItem()
2695 const dex::AnnotationItem* annotation = in CheckInterAnnotationSetItem()
2696 reinterpret_cast<const dex::AnnotationItem*>(begin_ + *offsets); in CheckInterAnnotationSetItem()
2716 dex::TypeIndex defining_class = FindFirstClassDataDefiner(ptr_, &success); in CheckInterClassDataItem()
2747 const dex::AnnotationsDirectoryItem* item = in CheckInterAnnotationsDirectoryItem()
2748 reinterpret_cast<const dex::AnnotationsDirectoryItem*>(ptr_); in CheckInterAnnotationsDirectoryItem()
2750 dex::TypeIndex defining_class = FindFirstAnnotationsDirectoryDefiner(ptr_, &success); in CheckInterAnnotationsDirectoryItem()
2761 const dex::FieldAnnotationsItem* field_item = in CheckInterAnnotationsDirectoryItem()
2762 reinterpret_cast<const dex::FieldAnnotationsItem*>(item + 1); in CheckInterAnnotationsDirectoryItem()
2778 const dex::MethodAnnotationsItem* method_item = in CheckInterAnnotationsDirectoryItem()
2779 reinterpret_cast<const dex::MethodAnnotationsItem*>(field_item); in CheckInterAnnotationsDirectoryItem()
2795 const dex::ParameterAnnotationsItem* parameter_item = in CheckInterAnnotationsDirectoryItem()
2796 reinterpret_cast<const dex::ParameterAnnotationsItem*>(method_item); in CheckInterAnnotationsDirectoryItem()
2952 const dex::MapList* map = reinterpret_cast<const dex::MapList*>(begin_ + header_->map_off_); in CheckInterSection()
2953 const dex::MapItem* item = map->list_; in CheckInterSection()
3056 dex::StringIndex string_idx) { in GetStringOrError()
3062 const dex::StringId* string_id = in GetStringOrError()
3063 reinterpret_cast<const dex::StringId*>(begin + header->string_ids_off_) + string_idx.index_; in GetStringOrError()
3077 dex::TypeIndex class_idx) { in GetClassOrError()
3084 const dex::TypeId* type_id = in GetClassOrError()
3085 reinterpret_cast<const dex::TypeId*>(begin + header->type_ids_off_) + class_idx.index_; in GetClassOrError()
3098 const dex::FieldId* field_id = in GetFieldDescriptionOrError()
3099 reinterpret_cast<const dex::FieldId*>(begin + header->field_ids_off_) + idx; in GetFieldDescriptionOrError()
3115 const dex::MethodId* method_id = in GetMethodDescriptionOrError()
3116 reinterpret_cast<const dex::MethodId*>(begin + header->method_ids_off_) + idx; in GetMethodDescriptionOrError()
3207 const dex::StringId* first = reinterpret_cast<const dex::StringId*>( in FindStringRangesForMethodNames()
3209 const dex::StringId* last = first + header_->string_ids_size_; in FindStringRangesForMethodNames()
3211 auto get_string = [begin = begin_](const dex::StringId& id) { in FindStringRangesForMethodNames()
3216 auto compare = [&get_string](const dex::StringId& lhs, const char* rhs) { in FindStringRangesForMethodNames()
3456 const dex::MethodId* const method_id = CheckLoadMethodId(method_index, in CheckConstructorProperties()
3467 const dex::ProtoId* const proto_id = CheckLoadProtoId(method_id->proto_idx_, in CheckConstructorProperties()