Lines Matching refs:dex

40 namespace dex {  namespace
179 std::string GetString(dex::StringIndex string_idx) { in GetString()
182 const dex::StringId& string_id = in GetString()
183 OffsetToPtr<dex::StringId>(header_->string_ids_off_)[string_idx.index_]; in GetString()
192 std::string GetClass(dex::TypeIndex class_idx) { in GetClass()
196 const dex::TypeId& type_id = OffsetToPtr<dex::TypeId>(header_->type_ids_off_)[class_idx.index_]; in GetClass()
208 const dex::FieldId& field_id = OffsetToPtr<dex::FieldId>(header_->field_ids_off_)[idx]; in GetFieldDescription()
220 const dex::MethodId& method_id = OffsetToPtr<dex::MethodId>(header_->method_ids_off_)[idx]; in GetMethodDescription()
268 bool CheckAndGetHandlerOffsets(const dex::CodeItem* code_item,
273 dex::TypeIndex class_type_index);
277 dex::TypeIndex class_type_index,
291 bool CheckStaticFieldTypes(const dex::ClassDef& class_def);
398 bool VerifyTypeDescriptor(dex::TypeIndex idx, const char* error_msg, ExtraCheckFn extra_check);
475 bool DexFileVerifier::VerifyTypeDescriptor(dex::TypeIndex idx, in VerifyTypeDescriptor()
692 sizeof(dex::MapList), in CheckHeader()
737 const dex::MapList* map = OffsetToPtr<dex::MapList>(header_->map_off_); in CheckMap()
739 if (!CheckListSize(map, 1, sizeof(dex::MapList), "maplist content")) { in CheckMap()
743 const dex::MapItem* item = map->list_; in CheckMap()
753 if (!CheckListSize(item, count, sizeof(dex::MapItem), "map size")) { in CheckMap()
859 bool DexFileVerifier::CheckAndGetHandlerOffsets(const dex::CodeItem* code_item, in CheckAndGetHandlerOffsets()
912 dex::TypeIndex class_type_index) { in CheckClassDataItemField()
917 dex::TypeIndex my_class_index = in CheckClassDataItemField()
918 OffsetToPtr<dex::FieldId>(header_->field_ids_off_)[idx].class_idx_; in CheckClassDataItemField()
939 dex::TypeIndex class_type_index, in CheckClassDataItemMethod()
945 const dex::MethodId& method_id = OffsetToPtr<dex::MethodId>(header_->method_ids_off_)[idx]; in CheckClassDataItemMethod()
948 dex::TypeIndex my_class_index = method_id.class_idx_; in CheckClassDataItemMethod()
1264 bool DexFileVerifier::CheckStaticFieldTypes(const dex::ClassDef& class_def) { in CheckStaticFieldTypes()
1275 const dex::TypeId& type_id = dex_file_->GetTypeId(dex_file_->GetFieldId(index).type_idx_); in CheckStaticFieldTypes()
1365 if (!CheckListSize(ptr_, 1, sizeof(dex::TypeId), "type_ids")) { in CheckIntraTypeIdItem()
1369 const dex::TypeId* type_id = reinterpret_cast<const dex::TypeId*>(ptr_); in CheckIntraTypeIdItem()
1376 ptr_ += sizeof(dex::TypeId); in CheckIntraTypeIdItem()
1381 if (!CheckListSize(ptr_, 1, sizeof(dex::ProtoId), "proto_ids")) { in CheckIntraProtoIdItem()
1385 const dex::ProtoId* proto_id = reinterpret_cast<const dex::ProtoId*>(ptr_); in CheckIntraProtoIdItem()
1393 ptr_ += sizeof(dex::ProtoId); in CheckIntraProtoIdItem()
1398 if (!CheckListSize(ptr_, 1, sizeof(dex::FieldId), "field_ids")) { in CheckIntraFieldIdItem()
1402 const dex::FieldId* field_id = reinterpret_cast<const dex::FieldId*>(ptr_); in CheckIntraFieldIdItem()
1409 ptr_ += sizeof(dex::FieldId); in CheckIntraFieldIdItem()
1414 if (!CheckListSize(ptr_, 1, sizeof(dex::MethodId), "method_ids")) { in CheckIntraMethodIdItem()
1418 const dex::MethodId* method_id = reinterpret_cast<const dex::MethodId*>(ptr_); in CheckIntraMethodIdItem()
1425 ptr_ += sizeof(dex::MethodId); in CheckIntraMethodIdItem()
1430 if (!CheckListSize(ptr_, 1, sizeof(dex::ClassDef), "class_defs")) { in CheckIntraClassDefItem()
1434 const dex::ClassDef* class_def = reinterpret_cast<const dex::ClassDef*>(ptr_); in CheckIntraClassDefItem()
1463 ptr_ += sizeof(dex::ClassDef); in CheckIntraClassDefItem()
1468 if (!CheckListSize(ptr_, 1, sizeof(dex::MethodHandleItem), "method_handles")) { in CheckIntraMethodHandleItem()
1472 const dex::MethodHandleItem* item = reinterpret_cast<const dex::MethodHandleItem*>(ptr_); in CheckIntraMethodHandleItem()
1503 ptr_ += sizeof(dex::MethodHandleItem); in CheckIntraMethodHandleItem()
1508 const dex::TypeList* type_list = reinterpret_cast<const dex::TypeList*>(ptr_); in CheckIntraTypeList()
1509 if (!CheckList(sizeof(dex::TypeItem), "type_list", &ptr_)) { in CheckIntraTypeList()
1663 const dex::CodeItem* code_item = reinterpret_cast<const dex::CodeItem*>(ptr_); in CheckIntraCodeItem()
1702 const dex::TryItem* try_items = accessor.TryItems().begin(); in CheckIntraCodeItem()
1703 if (!CheckListSize(try_items, try_items_size, sizeof(dex::TryItem), "try_items size")) { in CheckIntraCodeItem()
2019 const dex::HiddenapiClassData* item = reinterpret_cast<const dex::HiddenapiClassData*>(ptr_); in CheckIntraHiddenapiClassData()
2049 const dex::AnnotationsDirectoryItem* item = in CheckIntraAnnotationsDirectoryItem()
2050 reinterpret_cast<const dex::AnnotationsDirectoryItem*>(ptr_); in CheckIntraAnnotationsDirectoryItem()
2051 if (!CheckListSize(item, 1, sizeof(dex::AnnotationsDirectoryItem), "annotations_directory")) { in CheckIntraAnnotationsDirectoryItem()
2056 const dex::FieldAnnotationsItem* field_item = in CheckIntraAnnotationsDirectoryItem()
2057 reinterpret_cast<const dex::FieldAnnotationsItem*>(item + 1); in CheckIntraAnnotationsDirectoryItem()
2061 sizeof(dex::FieldAnnotationsItem), in CheckIntraAnnotationsDirectoryItem()
2081 const dex::MethodAnnotationsItem* method_item = in CheckIntraAnnotationsDirectoryItem()
2082 reinterpret_cast<const dex::MethodAnnotationsItem*>(field_item); in CheckIntraAnnotationsDirectoryItem()
2086 sizeof(dex::MethodAnnotationsItem), in CheckIntraAnnotationsDirectoryItem()
2106 const dex::ParameterAnnotationsItem* parameter_item = in CheckIntraAnnotationsDirectoryItem()
2107 reinterpret_cast<const dex::ParameterAnnotationsItem*>(method_item); in CheckIntraAnnotationsDirectoryItem()
2109 if (!CheckListSize(parameter_item, parameter_count, sizeof(dex::ParameterAnnotationsItem), in CheckIntraAnnotationsDirectoryItem()
2165 if (!CheckListSize(ptr_, 1, sizeof(dex::StringId), "string_ids")) { in CheckIntraSectionIterate()
2168 ptr_ += sizeof(dex::StringId); in CheckIntraSectionIterate()
2202 if (!CheckListSize(ptr_, 1, sizeof(dex::CallSiteIdItem), "call_site_ids")) { in CheckIntraSectionIterate()
2205 ptr_ += sizeof(dex::CallSiteIdItem); in CheckIntraSectionIterate()
2221 if (!CheckList(sizeof(dex::AnnotationSetRefItem), "annotation_set_ref_list", &ptr_)) { in CheckIntraSectionIterate()
2388 const dex::MapList* map = OffsetToPtr<dex::MapList>(header_->map_off_); in CheckIntraSection()
2389 const dex::MapItem* item = map->list_; in CheckIntraSection()
2457 ptr_ += sizeof(uint32_t) + (map->size_ * sizeof(dex::MapItem)); in CheckIntraSection()
2539 const dex::AnnotationsDirectoryItem* item = in FindFirstAnnotationsDirectoryDefiner()
2540 reinterpret_cast<const dex::AnnotationsDirectoryItem*>(ptr); in FindFirstAnnotationsDirectoryDefiner()
2543 dex::FieldAnnotationsItem* field_items = (dex::FieldAnnotationsItem*) (item + 1); in FindFirstAnnotationsDirectoryDefiner()
2549 dex::MethodAnnotationsItem* method_items = (dex::MethodAnnotationsItem*) (item + 1); in FindFirstAnnotationsDirectoryDefiner()
2555 dex::ParameterAnnotationsItem* parameter_items = (dex::ParameterAnnotationsItem*) (item + 1); in FindFirstAnnotationsDirectoryDefiner()
2564 const dex::HiddenapiClassData* item = reinterpret_cast<const dex::HiddenapiClassData*>(ptr_); in CheckInterHiddenapiClassData()
2575 const dex::ClassDef& class_def = dex_file_->GetClassDef(i); in CheckInterHiddenapiClassData()
2648 const dex::StringId* item = reinterpret_cast<const dex::StringId*>(ptr_); in CheckInterStringIdItem()
2654 const dex::StringId* prev_item = reinterpret_cast<const dex::StringId*>(previous_item_); in CheckInterStringIdItem()
2663 ptr_ += sizeof(dex::StringId); in CheckInterStringIdItem()
2668 const dex::TypeId* item = reinterpret_cast<const dex::TypeId*>(ptr_); in CheckInterTypeIdItem()
2673 size_t index = item - OffsetToPtr<dex::TypeId>(header_->type_ids_off_); in CheckInterTypeIdItem()
2676 dex::TypeIndex(static_cast<decltype(dex::TypeIndex::index_)>(index)), in CheckInterTypeIdItem()
2685 const dex::TypeId* prev_item = reinterpret_cast<const dex::TypeId*>(previous_item_); in CheckInterTypeIdItem()
2694 ptr_ += sizeof(dex::TypeId); in CheckInterTypeIdItem()
2699 const dex::ProtoId* item = reinterpret_cast<const dex::ProtoId*>(ptr_); in CheckInterProtoIdItem()
2742 const dex::ProtoId* prev = reinterpret_cast<const dex::ProtoId*>(previous_item_); in CheckInterProtoIdItem()
2751 dex::TypeIndex prev_idx = prev_it.GetTypeIdx(); in CheckInterProtoIdItem()
2752 dex::TypeIndex curr_idx = curr_it.GetTypeIdx(); in CheckInterProtoIdItem()
2753 DCHECK_NE(prev_idx, dex::TypeIndex(DexFile::kDexNoIndex16)); in CheckInterProtoIdItem()
2754 DCHECK_NE(curr_idx, dex::TypeIndex(DexFile::kDexNoIndex16)); in CheckInterProtoIdItem()
2775 ptr_ += sizeof(dex::ProtoId); in CheckInterProtoIdItem()
2780 const dex::FieldId* item = reinterpret_cast<const dex::FieldId*>(ptr_); in CheckInterFieldIdItem()
2805 const dex::FieldId* prev_item = reinterpret_cast<const dex::FieldId*>(previous_item_); in CheckInterFieldIdItem()
2822 ptr_ += sizeof(dex::FieldId); in CheckInterFieldIdItem()
2827 const dex::MethodId* item = reinterpret_cast<const dex::MethodId*>(ptr_); in CheckInterMethodIdItem()
2851 const dex::MethodId* prev_item = reinterpret_cast<const dex::MethodId*>(previous_item_); in CheckInterMethodIdItem()
2868 ptr_ += sizeof(dex::MethodId); in CheckInterMethodIdItem()
2873 const dex::ClassDef* item = reinterpret_cast<const dex::ClassDef*>(ptr_); in CheckInterClassDefItem()
2953 const dex::TypeList* interfaces = dex_file_->GetInterfacesList(*item); in CheckInterClassDefItem()
2996 dex::TypeIndex idx1 = interfaces->GetTypeItem(i).type_idx_; in CheckInterClassDefItem()
2998 dex::TypeIndex idx2 = interfaces->GetTypeItem(j).type_idx_; in CheckInterClassDefItem()
3034 ptr_ += sizeof(dex::ClassDef); in CheckInterClassDefItem()
3039 const dex::CallSiteIdItem* item = reinterpret_cast<const dex::CallSiteIdItem*>(ptr_); in CheckInterCallSiteIdItem()
3095 ptr_ += sizeof(dex::CallSiteIdItem); in CheckInterCallSiteIdItem()
3100 const dex::AnnotationSetRefList* list = reinterpret_cast<const dex::AnnotationSetRefList*>(ptr_); in CheckInterAnnotationSetRefList()
3101 const dex::AnnotationSetRefItem* item = list->list_; in CheckInterAnnotationSetRefList()
3117 const dex::AnnotationSetItem* set = reinterpret_cast<const dex::AnnotationSetItem*>(ptr_); in CheckInterAnnotationSetItem()
3128 const dex::AnnotationItem* annotation = OffsetToPtr<dex::AnnotationItem>(*offsets); in CheckInterAnnotationSetItem()
3157 const dex::TypeIndex class_type_index(defining_class); in CheckInterClassDataItem()
3158 const dex::ClassDef& class_def = dex_file_->GetClassDef(defined_class_indexes_[defining_class]); in CheckInterClassDataItem()
3163 const dex::FieldId& field = dex_file_->GetFieldId(read_field.GetIndex()); in CheckInterClassDataItem()
3186 const dex::MethodId& method = dex_file_->GetMethodId(it->GetIndex()); in CheckInterClassDataItem()
3212 const dex::AnnotationsDirectoryItem* item = in CheckInterAnnotationsDirectoryItem()
3213 reinterpret_cast<const dex::AnnotationsDirectoryItem*>(ptr_); in CheckInterAnnotationsDirectoryItem()
3223 const dex::FieldAnnotationsItem* field_item = in CheckInterAnnotationsDirectoryItem()
3224 reinterpret_cast<const dex::FieldAnnotationsItem*>(item + 1); in CheckInterAnnotationsDirectoryItem()
3229 const dex::FieldId& field = dex_file_->GetFieldId(field_item->field_idx_); in CheckInterAnnotationsDirectoryItem()
3241 const dex::MethodAnnotationsItem* method_item = in CheckInterAnnotationsDirectoryItem()
3242 reinterpret_cast<const dex::MethodAnnotationsItem*>(field_item); in CheckInterAnnotationsDirectoryItem()
3247 const dex::MethodId& method = dex_file_->GetMethodId(method_item->method_idx_); in CheckInterAnnotationsDirectoryItem()
3259 const dex::ParameterAnnotationsItem* parameter_item = in CheckInterAnnotationsDirectoryItem()
3260 reinterpret_cast<const dex::ParameterAnnotationsItem*>(method_item); in CheckInterAnnotationsDirectoryItem()
3265 const dex::MethodId& parameter_method = dex_file_->GetMethodId(parameter_item->method_idx_); in CheckInterAnnotationsDirectoryItem()
3417 const dex::StringId* string_ids = OffsetToPtr<dex::StringId>(header_->string_ids_off_); in CheckInterSection()
3424 const dex::MapList* map = OffsetToPtr<dex::MapList>(header_->map_off_); in CheckInterSection()
3425 const dex::MapItem* item = map->list_; in CheckInterSection()
3592 const dex::StringId* first = OffsetToPtr<dex::StringId>(header_->string_ids_off_); in FindStringRangesForMethodNames()
3593 const dex::StringId* last = first + header_->string_ids_size_; in FindStringRangesForMethodNames()
3595 auto get_string = [this](const dex::StringId& id) { in FindStringRangesForMethodNames()
3600 auto compare = [&get_string](const dex::StringId& lhs, const char* rhs) { in FindStringRangesForMethodNames()
3842 const dex::MethodId& method_id = dex_file_->GetMethodId(method_index); in CheckConstructorProperties()