Lines Matching refs:DexFile

57 constexpr uint32_t MapTypeToBitMask(DexFile::MapItemType map_item_type) {  in MapTypeToBitMask()
59 case DexFile::kDexTypeHeaderItem: return 1 << 0; in MapTypeToBitMask()
60 case DexFile::kDexTypeStringIdItem: return 1 << 1; in MapTypeToBitMask()
61 case DexFile::kDexTypeTypeIdItem: return 1 << 2; in MapTypeToBitMask()
62 case DexFile::kDexTypeProtoIdItem: return 1 << 3; in MapTypeToBitMask()
63 case DexFile::kDexTypeFieldIdItem: return 1 << 4; in MapTypeToBitMask()
64 case DexFile::kDexTypeMethodIdItem: return 1 << 5; in MapTypeToBitMask()
65 case DexFile::kDexTypeClassDefItem: return 1 << 6; in MapTypeToBitMask()
66 case DexFile::kDexTypeCallSiteIdItem: return 1 << 7; in MapTypeToBitMask()
67 case DexFile::kDexTypeMethodHandleItem: return 1 << 8; in MapTypeToBitMask()
68 case DexFile::kDexTypeMapList: return 1 << 9; in MapTypeToBitMask()
69 case DexFile::kDexTypeTypeList: return 1 << 10; in MapTypeToBitMask()
70 case DexFile::kDexTypeAnnotationSetRefList: return 1 << 11; in MapTypeToBitMask()
71 case DexFile::kDexTypeAnnotationSetItem: return 1 << 12; in MapTypeToBitMask()
72 case DexFile::kDexTypeClassDataItem: return 1 << 13; in MapTypeToBitMask()
73 case DexFile::kDexTypeCodeItem: return 1 << 14; in MapTypeToBitMask()
74 case DexFile::kDexTypeStringDataItem: return 1 << 15; in MapTypeToBitMask()
75 case DexFile::kDexTypeDebugInfoItem: return 1 << 16; in MapTypeToBitMask()
76 case DexFile::kDexTypeAnnotationItem: return 1 << 17; in MapTypeToBitMask()
77 case DexFile::kDexTypeEncodedArrayItem: return 1 << 18; in MapTypeToBitMask()
78 case DexFile::kDexTypeAnnotationsDirectoryItem: return 1 << 19; in MapTypeToBitMask()
79 case DexFile::kDexTypeHiddenapiClassData: return 1 << 20; in MapTypeToBitMask()
84 constexpr bool IsDataSectionType(DexFile::MapItemType map_item_type) { in IsDataSectionType()
86 case DexFile::kDexTypeHeaderItem: in IsDataSectionType()
87 case DexFile::kDexTypeStringIdItem: in IsDataSectionType()
88 case DexFile::kDexTypeTypeIdItem: in IsDataSectionType()
89 case DexFile::kDexTypeProtoIdItem: in IsDataSectionType()
90 case DexFile::kDexTypeFieldIdItem: in IsDataSectionType()
91 case DexFile::kDexTypeMethodIdItem: in IsDataSectionType()
92 case DexFile::kDexTypeClassDefItem: in IsDataSectionType()
94 case DexFile::kDexTypeCallSiteIdItem: in IsDataSectionType()
95 case DexFile::kDexTypeMethodHandleItem: in IsDataSectionType()
96 case DexFile::kDexTypeMapList: in IsDataSectionType()
97 case DexFile::kDexTypeTypeList: in IsDataSectionType()
98 case DexFile::kDexTypeAnnotationSetRefList: in IsDataSectionType()
99 case DexFile::kDexTypeAnnotationSetItem: in IsDataSectionType()
100 case DexFile::kDexTypeClassDataItem: in IsDataSectionType()
101 case DexFile::kDexTypeCodeItem: in IsDataSectionType()
102 case DexFile::kDexTypeStringDataItem: in IsDataSectionType()
103 case DexFile::kDexTypeDebugInfoItem: in IsDataSectionType()
104 case DexFile::kDexTypeAnnotationItem: in IsDataSectionType()
105 case DexFile::kDexTypeEncodedArrayItem: in IsDataSectionType()
106 case DexFile::kDexTypeAnnotationsDirectoryItem: in IsDataSectionType()
107 case DexFile::kDexTypeHiddenapiClassData: in IsDataSectionType()
129 const DexFile::Header* const header, in GetString()
144 const DexFile::Header* const header, in GetClass()
159 const DexFile::Header* const header, in GetFieldDescription()
174 const DexFile::Header* const header, in GetMethodDescription()
194 DexFileVerifier(const DexFile* dex_file, in DexFileVerifier()
281 bool CheckPadding(size_t offset, uint32_t aligned_offset, DexFile::MapItemType type);
310 template <DexFile::MapItemType kType>
312 template <DexFile::MapItemType kType>
314 template <DexFile::MapItemType kType>
336 bool CheckInterSectionIterate(size_t offset, uint32_t count, DexFile::MapItemType type);
375 const DexFile* const dex_file_;
380 const DexFile::Header* const header_;
593 if (header_->endian_tag_ != DexFile::kDexEndianConstant) { in CheckHeader()
627 CheckSizeLimit(header_->type_ids_size_, DexFile::kDexNoIndex16, "type-ids") && in CheckHeader()
632 CheckSizeLimit(header_->proto_ids_size_, DexFile::kDexNoIndex16, "proto-ids") && in CheckHeader()
691 DexFile::MapItemType item_type = static_cast<DexFile::MapItemType>(item->type_); in CheckMap()
723 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeHeaderItem)) == 0)) { in CheckMap()
727 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeMapList)) == 0)) { in CheckMap()
731 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeStringIdItem)) == 0 && in CheckMap()
736 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeTypeIdItem)) == 0 && in CheckMap()
741 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeProtoIdItem)) == 0 && in CheckMap()
746 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeFieldIdItem)) == 0 && in CheckMap()
751 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeMethodIdItem)) == 0 && in CheckMap()
756 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeClassDefItem)) == 0 && in CheckMap()
926 DexFile::MapItemType type) { in CheckPadding()
952 uint32_t value_type = header_byte & DexFile::kDexAnnotationValueTypeMask; in CheckEncodedValue()
953 uint32_t value_arg = header_byte >> DexFile::kDexAnnotationValueArgShift; in CheckEncodedValue()
956 case DexFile::kDexAnnotationByte: in CheckEncodedValue()
963 case DexFile::kDexAnnotationShort: in CheckEncodedValue()
964 case DexFile::kDexAnnotationChar: in CheckEncodedValue()
971 case DexFile::kDexAnnotationInt: in CheckEncodedValue()
972 case DexFile::kDexAnnotationFloat: in CheckEncodedValue()
979 case DexFile::kDexAnnotationLong: in CheckEncodedValue()
980 case DexFile::kDexAnnotationDouble: in CheckEncodedValue()
983 case DexFile::kDexAnnotationString: { in CheckEncodedValue()
994 case DexFile::kDexAnnotationType: { in CheckEncodedValue()
1005 case DexFile::kDexAnnotationField: in CheckEncodedValue()
1006 case DexFile::kDexAnnotationEnum: { in CheckEncodedValue()
1017 case DexFile::kDexAnnotationMethod: { in CheckEncodedValue()
1028 case DexFile::kDexAnnotationArray: in CheckEncodedValue()
1037 case DexFile::kDexAnnotationAnnotation: in CheckEncodedValue()
1046 case DexFile::kDexAnnotationNull: in CheckEncodedValue()
1052 case DexFile::kDexAnnotationBoolean: in CheckEncodedValue()
1058 case DexFile::kDexAnnotationMethodType: { in CheckEncodedValue()
1069 case DexFile::kDexAnnotationMethodHandle: { in CheckEncodedValue()
1337 DexFile::MethodHandleType method_handle_type = in CheckIntraMethodHandleItem()
1338 static_cast<DexFile::MethodHandleType>(item->method_handle_type_); in CheckIntraMethodHandleItem()
1339 if (method_handle_type > DexFile::MethodHandleType::kLast) { in CheckIntraMethodHandleItem()
1346 case DexFile::MethodHandleType::kStaticPut: in CheckIntraMethodHandleItem()
1347 case DexFile::MethodHandleType::kStaticGet: in CheckIntraMethodHandleItem()
1348 case DexFile::MethodHandleType::kInstancePut: in CheckIntraMethodHandleItem()
1349 case DexFile::MethodHandleType::kInstanceGet: in CheckIntraMethodHandleItem()
1354 case DexFile::MethodHandleType::kInvokeStatic: in CheckIntraMethodHandleItem()
1355 case DexFile::MethodHandleType::kInvokeInstance: in CheckIntraMethodHandleItem()
1356 case DexFile::MethodHandleType::kInvokeConstructor: in CheckIntraMethodHandleItem()
1357 case DexFile::MethodHandleType::kInvokeDirect: in CheckIntraMethodHandleItem()
1358 case DexFile::MethodHandleType::kInvokeInterface: { in CheckIntraMethodHandleItem()
1747 case DexFile::DBG_END_SEQUENCE: { in CheckIntraDebugInfoItem()
1750 case DexFile::DBG_ADVANCE_PC: { in CheckIntraDebugInfoItem()
1754 case DexFile::DBG_ADVANCE_LINE: { in CheckIntraDebugInfoItem()
1758 case DexFile::DBG_START_LOCAL: { in CheckIntraDebugInfoItem()
1780 case DexFile::DBG_END_LOCAL: in CheckIntraDebugInfoItem()
1781 case DexFile::DBG_RESTART_LOCAL: { in CheckIntraDebugInfoItem()
1789 case DexFile::DBG_START_LOCAL_EXTENDED: { in CheckIntraDebugInfoItem()
1818 case DexFile::DBG_SET_FILE: { in CheckIntraDebugInfoItem()
1839 case DexFile::kDexVisibilityBuild: in CheckIntraAnnotationItem()
1840 case DexFile::kDexVisibilityRuntime: in CheckIntraAnnotationItem()
1841 case DexFile::kDexVisibilitySystem: in CheckIntraAnnotationItem()
2042 template <DexFile::MapItemType kType>
2047 case DexFile::kDexTypeClassDataItem: in CheckIntraSectionIterate()
2048 case DexFile::kDexTypeStringDataItem: in CheckIntraSectionIterate()
2049 case DexFile::kDexTypeDebugInfoItem: in CheckIntraSectionIterate()
2050 case DexFile::kDexTypeAnnotationItem: in CheckIntraSectionIterate()
2051 case DexFile::kDexTypeEncodedArrayItem: in CheckIntraSectionIterate()
2071 case DexFile::kDexTypeStringIdItem: { in CheckIntraSectionIterate()
2078 case DexFile::kDexTypeTypeIdItem: { in CheckIntraSectionIterate()
2084 case DexFile::kDexTypeProtoIdItem: { in CheckIntraSectionIterate()
2090 case DexFile::kDexTypeFieldIdItem: { in CheckIntraSectionIterate()
2096 case DexFile::kDexTypeMethodIdItem: { in CheckIntraSectionIterate()
2102 case DexFile::kDexTypeClassDefItem: { in CheckIntraSectionIterate()
2108 case DexFile::kDexTypeCallSiteIdItem: { in CheckIntraSectionIterate()
2115 case DexFile::kDexTypeMethodHandleItem: { in CheckIntraSectionIterate()
2121 case DexFile::kDexTypeTypeList: { in CheckIntraSectionIterate()
2127 case DexFile::kDexTypeAnnotationSetRefList: { in CheckIntraSectionIterate()
2133 case DexFile::kDexTypeAnnotationSetItem: { in CheckIntraSectionIterate()
2139 case DexFile::kDexTypeClassDataItem: { in CheckIntraSectionIterate()
2145 case DexFile::kDexTypeCodeItem: { in CheckIntraSectionIterate()
2151 case DexFile::kDexTypeStringDataItem: { in CheckIntraSectionIterate()
2157 case DexFile::kDexTypeDebugInfoItem: { in CheckIntraSectionIterate()
2163 case DexFile::kDexTypeAnnotationItem: { in CheckIntraSectionIterate()
2169 case DexFile::kDexTypeEncodedArrayItem: { in CheckIntraSectionIterate()
2175 case DexFile::kDexTypeAnnotationsDirectoryItem: { in CheckIntraSectionIterate()
2181 case DexFile::kDexTypeHiddenapiClassData: { in CheckIntraSectionIterate()
2187 case DexFile::kDexTypeHeaderItem: in CheckIntraSectionIterate()
2188 case DexFile::kDexTypeMapList: in CheckIntraSectionIterate()
2218 template <DexFile::MapItemType kType>
2225 case DexFile::kDexTypeStringIdItem: in CheckIntraIdSection()
2229 case DexFile::kDexTypeTypeIdItem: in CheckIntraIdSection()
2233 case DexFile::kDexTypeProtoIdItem: in CheckIntraIdSection()
2237 case DexFile::kDexTypeFieldIdItem: in CheckIntraIdSection()
2241 case DexFile::kDexTypeMethodIdItem: in CheckIntraIdSection()
2245 case DexFile::kDexTypeClassDefItem: in CheckIntraIdSection()
2267 template <DexFile::MapItemType kType>
2315 DexFile::MapItemType type = static_cast<DexFile::MapItemType>(item->type_); in CheckIntraSection()
2325 if (type == DexFile::kDexTypeClassDataItem) { in CheckIntraSection()
2331 case DexFile::kDexTypeHeaderItem: in CheckIntraSection()
2351 CHECK_INTRA_ID_SECTION_CASE(DexFile::kDexTypeStringIdItem) in CheckIntraSection()
2352 CHECK_INTRA_ID_SECTION_CASE(DexFile::kDexTypeTypeIdItem) in CheckIntraSection()
2353 CHECK_INTRA_ID_SECTION_CASE(DexFile::kDexTypeProtoIdItem) in CheckIntraSection()
2354 CHECK_INTRA_ID_SECTION_CASE(DexFile::kDexTypeFieldIdItem) in CheckIntraSection()
2355 CHECK_INTRA_ID_SECTION_CASE(DexFile::kDexTypeMethodIdItem) in CheckIntraSection()
2356 CHECK_INTRA_ID_SECTION_CASE(DexFile::kDexTypeClassDefItem) in CheckIntraSection()
2359 case DexFile::kDexTypeMapList: in CheckIntraSection()
2380 CHECK_INTRA_SECTION_ITERATE_CASE(DexFile::kDexTypeMethodHandleItem) in CheckIntraSection()
2381 CHECK_INTRA_SECTION_ITERATE_CASE(DexFile::kDexTypeCallSiteIdItem) in CheckIntraSection()
2391 CHECK_INTRA_DATA_SECTION_CASE(DexFile::kDexTypeTypeList) in CheckIntraSection()
2392 CHECK_INTRA_DATA_SECTION_CASE(DexFile::kDexTypeAnnotationSetRefList) in CheckIntraSection()
2393 CHECK_INTRA_DATA_SECTION_CASE(DexFile::kDexTypeAnnotationSetItem) in CheckIntraSection()
2394 CHECK_INTRA_DATA_SECTION_CASE(DexFile::kDexTypeClassDataItem) in CheckIntraSection()
2395 CHECK_INTRA_DATA_SECTION_CASE(DexFile::kDexTypeCodeItem) in CheckIntraSection()
2396 CHECK_INTRA_DATA_SECTION_CASE(DexFile::kDexTypeStringDataItem) in CheckIntraSection()
2397 CHECK_INTRA_DATA_SECTION_CASE(DexFile::kDexTypeDebugInfoItem) in CheckIntraSection()
2398 CHECK_INTRA_DATA_SECTION_CASE(DexFile::kDexTypeAnnotationItem) in CheckIntraSection()
2399 CHECK_INTRA_DATA_SECTION_CASE(DexFile::kDexTypeEncodedArrayItem) in CheckIntraSection()
2400 CHECK_INTRA_DATA_SECTION_CASE(DexFile::kDexTypeAnnotationsDirectoryItem) in CheckIntraSection()
2401 CHECK_INTRA_DATA_SECTION_CASE(DexFile::kDexTypeHiddenapiClassData) in CheckIntraSection()
2535 !CheckOffsetToTypeMap(item->parameters_off_, DexFile::kDexTypeTypeList)) { in CheckInterProtoIdItem()
2584 DCHECK_NE(prev_idx, dex::TypeIndex(DexFile::kDexNoIndex16)); in CheckInterProtoIdItem()
2585 DCHECK_NE(curr_idx, dex::TypeIndex(DexFile::kDexNoIndex16)); in CheckInterProtoIdItem()
2733 !CheckOffsetToTypeMap(item->interfaces_off_, DexFile::kDexTypeTypeList)) { in CheckInterClassDefItem()
2737 !CheckOffsetToTypeMap(item->annotations_off_, DexFile::kDexTypeAnnotationsDirectoryItem)) { in CheckInterClassDefItem()
2741 !CheckOffsetToTypeMap(item->class_data_off_, DexFile::kDexTypeClassDataItem)) { in CheckInterClassDefItem()
2745 !CheckOffsetToTypeMap(item->static_values_off_, DexFile::kDexTypeEncodedArrayItem)) { in CheckInterClassDefItem()
2750 if (header_->GetVersion() >= DexFile::kClassDefinitionOrderEnforcedVersion) { in CheckInterClassDefItem()
2788 if (header_->GetVersion() >= DexFile::kClassDefinitionOrderEnforcedVersion) { in CheckInterClassDefItem()
2874 if (!CheckOffsetToTypeMap(item->data_off_, DexFile::kDexTypeEncodedArrayItem)) { in CheckInterCallSiteIdItem()
2932 !CheckOffsetToTypeMap(item->annotations_off_, DexFile::kDexTypeAnnotationSetItem)) { in CheckInterAnnotationSetRefList()
2949 if (*offsets != 0 && !CheckOffsetToTypeMap(*offsets, DexFile::kDexTypeAnnotationItem)) { in CheckInterAnnotationSetItem()
3008 if (code_off != 0 && !CheckOffsetToTypeMap(code_off, DexFile::kDexTypeCodeItem)) { in CheckInterClassDataItem()
3045 !CheckOffsetToTypeMap(item->class_annotations_off_, DexFile::kDexTypeAnnotationSetItem)) { in CheckInterAnnotationsDirectoryItem()
3061 if (!CheckOffsetToTypeMap(field_item->annotations_off_, DexFile::kDexTypeAnnotationSetItem)) { in CheckInterAnnotationsDirectoryItem()
3079 if (!CheckOffsetToTypeMap(method_item->annotations_off_, DexFile::kDexTypeAnnotationSetItem)) { in CheckInterAnnotationsDirectoryItem()
3098 DexFile::kDexTypeAnnotationSetRefList)) { in CheckInterAnnotationsDirectoryItem()
3110 DexFile::MapItemType type) { in CheckInterSectionIterate()
3114 case DexFile::kDexTypeClassDataItem: in CheckInterSectionIterate()
3136 case DexFile::kDexTypeHeaderItem: in CheckInterSectionIterate()
3137 case DexFile::kDexTypeMethodHandleItem: in CheckInterSectionIterate()
3138 case DexFile::kDexTypeMapList: in CheckInterSectionIterate()
3139 case DexFile::kDexTypeTypeList: in CheckInterSectionIterate()
3140 case DexFile::kDexTypeCodeItem: in CheckInterSectionIterate()
3141 case DexFile::kDexTypeStringDataItem: in CheckInterSectionIterate()
3142 case DexFile::kDexTypeDebugInfoItem: in CheckInterSectionIterate()
3143 case DexFile::kDexTypeAnnotationItem: in CheckInterSectionIterate()
3144 case DexFile::kDexTypeEncodedArrayItem: in CheckInterSectionIterate()
3145 case DexFile::kDexTypeHiddenapiClassData: in CheckInterSectionIterate()
3147 case DexFile::kDexTypeStringIdItem: { in CheckInterSectionIterate()
3153 case DexFile::kDexTypeTypeIdItem: { in CheckInterSectionIterate()
3159 case DexFile::kDexTypeProtoIdItem: { in CheckInterSectionIterate()
3165 case DexFile::kDexTypeFieldIdItem: { in CheckInterSectionIterate()
3171 case DexFile::kDexTypeMethodIdItem: { in CheckInterSectionIterate()
3177 case DexFile::kDexTypeClassDefItem: { in CheckInterSectionIterate()
3187 case DexFile::kDexTypeCallSiteIdItem: { in CheckInterSectionIterate()
3193 case DexFile::kDexTypeAnnotationSetRefList: { in CheckInterSectionIterate()
3199 case DexFile::kDexTypeAnnotationSetItem: { in CheckInterSectionIterate()
3205 case DexFile::kDexTypeClassDataItem: { in CheckInterSectionIterate()
3219 case DexFile::kDexTypeAnnotationsDirectoryItem: { in CheckInterSectionIterate()
3242 if (!CheckOffsetToTypeMap(string_ids[i].string_data_off_, DexFile::kDexTypeStringDataItem)) { in CheckInterSection()
3255 DexFile::MapItemType type = static_cast<DexFile::MapItemType>(item->type_); in CheckInterSection()
3259 case DexFile::kDexTypeHeaderItem: in CheckInterSection()
3260 case DexFile::kDexTypeMapList: in CheckInterSection()
3261 case DexFile::kDexTypeTypeList: in CheckInterSection()
3262 case DexFile::kDexTypeCodeItem: in CheckInterSection()
3263 case DexFile::kDexTypeStringDataItem: in CheckInterSection()
3264 case DexFile::kDexTypeDebugInfoItem: in CheckInterSection()
3265 case DexFile::kDexTypeAnnotationItem: in CheckInterSection()
3266 case DexFile::kDexTypeEncodedArrayItem: in CheckInterSection()
3269 case DexFile::kDexTypeStringIdItem: in CheckInterSection()
3270 case DexFile::kDexTypeTypeIdItem: in CheckInterSection()
3271 case DexFile::kDexTypeProtoIdItem: in CheckInterSection()
3272 case DexFile::kDexTypeFieldIdItem: in CheckInterSection()
3273 case DexFile::kDexTypeMethodIdItem: in CheckInterSection()
3274 case DexFile::kDexTypeClassDefItem: in CheckInterSection()
3275 case DexFile::kDexTypeCallSiteIdItem: in CheckInterSection()
3276 case DexFile::kDexTypeMethodHandleItem: in CheckInterSection()
3277 case DexFile::kDexTypeAnnotationSetRefList: in CheckInterSection()
3278 case DexFile::kDexTypeAnnotationSetItem: in CheckInterSection()
3279 case DexFile::kDexTypeClassDataItem: in CheckInterSection()
3280 case DexFile::kDexTypeAnnotationsDirectoryItem: in CheckInterSection()
3281 case DexFile::kDexTypeHiddenapiClassData: { in CheckInterSection()
3682 bool Verify(const DexFile* dex_file, in Verify()