Lines Matching refs:u4
49 static u4 endianSwapU4(u4 value) { in endianSwapU4()
75 u4 fileLen;
84 u4* pDefinedClassBits;
92 static inline u4 fileOffset(const CheckState* state, const void* ptr) { in fileOffset()
99 static inline void* filePointer(const CheckState* state, u4 offset) { in filePointer()
191 #_field, (u4)(_field), #_limit, (u4)(_limit)); \
210 #_field, (u4)(_field), #_limit, (u4)(_limit)); \
233 static bool verifyFieldDefiner(const CheckState* state, u4 definingClass, in verifyFieldDefiner()
234 u4 fieldIdx) { in verifyFieldDefiner()
240 static bool verifyMethodDefiner(const CheckState* state, u4 definingClass, in verifyMethodDefiner()
241 u4 methodIdx) { in verifyMethodDefiner()
259 static bool setDefinedClassBit(const CheckState* state, u4 typeIdx) { in setDefinedClassBit()
260 u4 arrayIdx = typeIdx >> 5; in setDefinedClassBit()
261 u4 bit = 1 << (typeIdx & 0x1f); in setDefinedClassBit()
262 u4* element = &state->pDefinedClassBits[arrayIdx]; in setDefinedClassBit()
307 u4 linkOff = pHeader->linkOff; in swapDexHeader()
308 u4 linkEnd = linkOff + pHeader->linkSize; in swapDexHeader()
309 u4 dataOff = pHeader->dataOff; in swapDexHeader()
310 u4 dataEnd = dataOff + pHeader->dataSize; in swapDexHeader()
323 static bool checkHeaderSection(const CheckState* state, u4 sectionOffset, in checkHeaderSection()
324 u4 sectionCount, u4* endOffset) { in checkHeaderSection()
344 static u4 mapTypeToBitMask(int mapType) { in mapTypeToBitMask()
398 u4 count; in swapMap()
399 u4 dataItemCount = 0; // Total count of items in the data section. in swapMap()
400 u4 dataItemsLeft = state->pHeader->dataSize; // See use below. in swapMap()
401 u4 usedBits = 0; // Bit set: one bit per section in swapMap()
403 u4 lastOffset = 0; in swapMap()
431 u4 icount = item->size; in swapMap()
448 u4 bit = mapTypeToBitMask(item->type); in swapMap()
526 static bool checkMapSection(const CheckState* state, u4 sectionOffset, in checkMapSection()
527 u4 sectionCount, u4* endOffset) { in checkMapSection()
542 sectionOffset + sizeof(u4) + (pMap->size * sizeof(DexMapItem)); in checkMapSection()
687 u4 protoIdx = item - state->pDexFile->pProtoIds; in crossVerifyProtoIdItem()
733 u4 idx0 = dexParameterIteratorNextIndex(&iterator0); in crossVerifyProtoIdItem()
734 u4 idx1 = dexParameterIteratorNextIndex(&iterator); in crossVerifyProtoIdItem()
924 static u4 findFirstClassDataDefiner(const CheckState* state,
926 static u4 findFirstAnnotationsDirectoryDefiner(const CheckState* state,
931 static bool verifyClassDataIsForDef(const CheckState* state, u4 offset, in verifyClassDataIsForDef()
932 u4 definerIdx) { in verifyClassDataIsForDef()
950 u4 dataDefiner = findFirstClassDataDefiner(state, classData); in verifyClassDataIsForDef()
961 u4 offset, u4 definerIdx) { in verifyAnnotationsDirectoryIsForDef()
968 u4 annoDefiner = findFirstAnnotationsDirectoryDefiner(state, dir); in verifyAnnotationsDirectoryIsForDef()
976 u4 classIdx = item->classIdx; in crossVerifyClassDefItem()
1014 u4 size = interfaces->size; in crossVerifyClassDefItem()
1015 u4 i; in crossVerifyClassDefItem()
1038 u4 idx1 = dexTypeListGetIdx(interfaces, i); in crossVerifyClassDefItem()
1039 u4 j; in crossVerifyClassDefItem()
1041 u4 idx2 = dexTypeListGetIdx(interfaces, j); in crossVerifyClassDefItem()
1068 static u1* swapFieldAnnotations(const CheckState* state, u4 count, u1* addr) { in swapFieldAnnotations()
1071 u4 lastIdx = 0; in swapFieldAnnotations()
1097 static u1* swapMethodAnnotations(const CheckState* state, u4 count, u1* addr) { in swapMethodAnnotations()
1100 u4 lastIdx = 0; in swapMethodAnnotations()
1126 static u1* swapParameterAnnotations(const CheckState* state, u4 count, in swapParameterAnnotations()
1130 u4 lastIdx = 0; in swapParameterAnnotations()
1192 static const u1* crossVerifyFieldAnnotations(const CheckState* state, u4 count, in crossVerifyFieldAnnotations()
1193 const u1* addr, u4 definingClass) { in crossVerifyFieldAnnotations()
1213 u4 count, const u1* addr, u4 definingClass) { in crossVerifyMethodAnnotations()
1233 u4 count, const u1* addr, u4 definingClass) { in crossVerifyParameterAnnotations()
1254 static u4 findFirstAnnotationsDirectoryDefiner(const CheckState* state, in findFirstAnnotationsDirectoryDefiner()
1287 u4 definingClass = findFirstAnnotationsDirectoryDefiner(state, item); in crossVerifyAnnotationsDirectoryItem()
1328 u4 count; in swapTypeList()
1349 u4 count; in swapAnnotationSetRefList()
1387 u4* item; in swapAnnotationSetItem()
1388 u4 count; in swapAnnotationSetItem()
1394 CHECK_LIST_SIZE(item, count, sizeof(u4)); in swapAnnotationSetItem()
1406 static u4 annotationItemTypeIdx(const DexAnnotationItem* item) { in annotationItemTypeIdx()
1415 u4 lastIdx = 0; in crossVerifyAnnotationSetItem()
1427 u4 idx = annotationItemTypeIdx(annotation); in crossVerifyAnnotationSetItem()
1444 static bool verifyFields(const CheckState* state, u4 size, in verifyFields()
1446 u4 i; in verifyFields()
1450 u4 accessFlags = field->accessFlags; in verifyFields()
1471 static bool verifyMethods(const CheckState* state, u4 size, in verifyMethods()
1473 u4 i; in verifyMethods()
1480 u4 accessFlags = method->accessFlags; in verifyMethods()
1583 static u4 findFirstClassDataDefiner(const CheckState* state, in findFirstClassDataDefiner()
1586 u4 fieldIdx = classData->staticFields[0].fieldIdx; in findFirstClassDataDefiner()
1592 u4 fieldIdx = classData->instanceFields[0].fieldIdx; in findFirstClassDataDefiner()
1598 u4 methodIdx = classData->directMethods[0].methodIdx; in findFirstClassDataDefiner()
1604 u4 methodIdx = classData->virtualMethods[0].methodIdx; in findFirstClassDataDefiner()
1616 u4 definingClass = findFirstClassDataDefiner(state, classData); in crossVerifyClassDataItem()
1618 u4 i; in crossVerifyClassDataItem()
1660 static u4 setHandlerOffsAndVerify(const CheckState* state, in setHandlerOffsAndVerify()
1661 DexCode* code, u4 firstOffset, u4 handlersSize, u4* handlerOffs) { in setHandlerOffsAndVerify()
1664 u4 offset = firstOffset; in setHandlerOffsAndVerify()
1666 u4 i; in setHandlerOffsAndVerify()
1693 u4 typeIdx = in setHandlerOffsAndVerify()
1703 u4 addr = readAndVerifyUnsignedLeb128(&ptr, fileEnd, &okay); in setHandlerOffsAndVerify()
1717 u4 addr = readAndVerifyUnsignedLeb128(&ptr, fileEnd, &okay); in setHandlerOffsAndVerify()
1742 u4 handlersSize = in swapTriesAndCatches()
1755 u4 handlerOffs[handlersSize]; // list of valid handlerOff values in swapTriesAndCatches()
1756 u4 endOffset = setHandlerOffsAndVerify(state, code, in swapTriesAndCatches()
1765 u4 count = code->triesSize; in swapTriesAndCatches()
1766 u4 lastEnd = 0; in swapTriesAndCatches()
1771 u4 i; in swapTriesAndCatches()
1816 u4 count; in swapCodeItem()
1860 ALOGE("Non-zero padding: %#x", (u4) *insns); in swapCodeItem()
1876 u4 utf16Size = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay); in intraVerifyStringDataItem()
1877 u4 i; in intraVerifyStringDataItem()
1977 u4 i; in intraVerifyDebugInfoItem()
1986 u4 parametersSize = in intraVerifyDebugInfoItem()
2000 u4 parameterName = in intraVerifyDebugInfoItem()
2032 u4 idx; in intraVerifyDebugInfoItem()
2033 u4 regNum = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay); in intraVerifyDebugInfoItem()
2055 u4 regNum = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay); in intraVerifyDebugInfoItem()
2064 u4 idx; in intraVerifyDebugInfoItem()
2065 u4 regNum = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay); in intraVerifyDebugInfoItem()
2092 u4 idx = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay); in intraVerifyDebugInfoItem()
2122 static u4 readUnsignedLittleEndian(const CheckState* state, const u1** pData, in readUnsignedLittleEndian()
2123 u4 size) { in readUnsignedLittleEndian()
2125 u4 result = 0; in readUnsignedLittleEndian()
2126 u4 i; in readUnsignedLittleEndian()
2131 result |= ((u4) *(data++)) << (i * 8); in readUnsignedLittleEndian()
2143 u4 size = readAndVerifyUnsignedLeb128(&data, state->fileEnd, &okay); in verifyEncodedArray()
2168 u4 valueType = headerByte & kDexAnnotationValueTypeMask; in verifyEncodedValue()
2169 u4 valueArg = headerByte >> kDexAnnotationValueArgShift; in verifyEncodedValue()
2208 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1); in verifyEncodedValue()
2217 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1); in verifyEncodedValue()
2227 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1); in verifyEncodedValue()
2236 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1); in verifyEncodedValue()
2287 u4 idx = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay); in verifyEncodedAnnotation()
2304 u4 size = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay); in verifyEncodedAnnotation()
2305 u4 lastIdx = 0; in verifyEncodedAnnotation()
2400 u4 offset, u4 count, ItemVisitorFunction* func, u4 alignment, in iterateSectionWithOptionalUpdate()
2401 u4* nextOffset, int mapType) { in iterateSectionWithOptionalUpdate()
2402 u4 alignmentMask = alignment - 1; in iterateSectionWithOptionalUpdate()
2403 u4 i; in iterateSectionWithOptionalUpdate()
2408 u4 newOffset = (offset + alignmentMask) & ~alignmentMask; in iterateSectionWithOptionalUpdate()
2459 static bool iterateSection(CheckState* state, u4 offset, u4 count, in iterateSection()
2460 ItemVisitorFunction* func, u4 alignment, u4* nextOffset) { in iterateSection()
2470 u4 offset, u4 count, u4 expectedOffset, u4 expectedCount, in checkBoundsAndIterateSection()
2471 ItemVisitorFunction* func, u4 alignment, u4* nextOffset) { in checkBoundsAndIterateSection()
2491 static bool iterateDataSection(CheckState* state, u4 offset, u4 count, in iterateDataSection()
2492 ItemVisitorFunction* func, u4 alignment, u4* nextOffset, int mapType) { in iterateDataSection()
2493 u4 dataStart = state->pHeader->dataOff; in iterateDataSection()
2494 u4 dataEnd = dataStart + state->pHeader->dataSize; in iterateDataSection()
2528 u4 lastOffset = 0; in swapEverythingButHeaderAndMap()
2529 u4 count = pMap->size; in swapEverythingButHeaderAndMap()
2533 u4 sectionOffset = item->offset; in swapEverythingButHeaderAndMap()
2534 u4 sectionCount = item->size; in swapEverythingButHeaderAndMap()
2574 sizeof(u4), &lastOffset); in swapEverythingButHeaderAndMap()
2581 sizeof(u4), &lastOffset); in swapEverythingButHeaderAndMap()
2588 sizeof(u4), &lastOffset); in swapEverythingButHeaderAndMap()
2595 sizeof(u4), &lastOffset); in swapEverythingButHeaderAndMap()
2602 sizeof(u4), &lastOffset); in swapEverythingButHeaderAndMap()
2609 sizeof(u4), &lastOffset); in swapEverythingButHeaderAndMap()
2623 swapTypeList, sizeof(u4), &lastOffset, type); in swapEverythingButHeaderAndMap()
2628 swapAnnotationSetRefList, sizeof(u4), &lastOffset, in swapEverythingButHeaderAndMap()
2634 swapAnnotationSetItem, sizeof(u4), &lastOffset, type); in swapEverythingButHeaderAndMap()
2645 swapCodeItem, sizeof(u4), &lastOffset, type); in swapEverythingButHeaderAndMap()
2674 swapAnnotationsDirectoryItem, sizeof(u4), &lastOffset, in swapEverythingButHeaderAndMap()
2702 u4 count = pMap->size; in crossVerifyEverything()
2706 u4 sectionOffset = item->offset; in crossVerifyEverything()
2707 u4 sectionCount = item->size; in crossVerifyEverything()
2723 crossVerifyStringIdItem, sizeof(u4), NULL); in crossVerifyEverything()
2728 crossVerifyTypeIdItem, sizeof(u4), NULL); in crossVerifyEverything()
2733 crossVerifyProtoIdItem, sizeof(u4), NULL); in crossVerifyEverything()
2738 crossVerifyFieldIdItem, sizeof(u4), NULL); in crossVerifyEverything()
2743 crossVerifyMethodIdItem, sizeof(u4), NULL); in crossVerifyEverything()
2749 u4 definedClassBits[arraySize]; in crossVerifyEverything()
2750 memset(definedClassBits, 0, arraySize * sizeof(u4)); in crossVerifyEverything()
2754 crossVerifyClassDefItem, sizeof(u4), NULL); in crossVerifyEverything()
2761 crossVerifyAnnotationSetRefList, sizeof(u4), NULL); in crossVerifyEverything()
2766 crossVerifyAnnotationSetItem, sizeof(u4), NULL); in crossVerifyEverything()
2776 crossVerifyAnnotationsDirectoryItem, sizeof(u4), NULL); in crossVerifyEverything()
2872 u4 storedFileSize = SWAP4(pHeader->fileSize); in dexSwapAndVerify()
2873 u4 expectedChecksum = SWAP4(pHeader->checksum); in dexSwapAndVerify()