Lines Matching refs:u4
48 u4 fileLen;
59 u4* pDefinedClassBits;
67 static inline u4 fileOffset(const CheckState* state, const void* ptr) { in fileOffset()
74 static inline void* filePointer(const CheckState* state, u4 offset) { in filePointer()
142 u4 _dummy; \
167 #_field, (u4)(_field), #_limit, (u4)(_limit)); \
186 #_field, (u4)(_field), #_limit, (u4)(_limit)); \
209 static bool verifyFieldDefiner(const CheckState* state, u4 definingClass, in verifyFieldDefiner()
210 u4 fieldIdx) { in verifyFieldDefiner()
216 static bool verifyMethodDefiner(const CheckState* state, u4 definingClass, in verifyMethodDefiner()
217 u4 methodIdx) { in verifyMethodDefiner()
235 static bool setDefinedClassBit(const CheckState* state, u4 typeIdx) { in setDefinedClassBit()
236 u4 arrayIdx = typeIdx >> 5; in setDefinedClassBit()
237 u4 bit = 1 << (typeIdx & 0x1f); in setDefinedClassBit()
238 u4* element = &state->pDefinedClassBits[arrayIdx]; in setDefinedClassBit()
283 u4 linkOff = pHeader->linkOff; in swapDexHeader()
284 u4 linkEnd = linkOff + pHeader->linkSize; in swapDexHeader()
285 u4 dataOff = pHeader->dataOff; in swapDexHeader()
286 u4 dataEnd = dataOff + pHeader->dataSize; in swapDexHeader()
299 static bool checkHeaderSection(const CheckState* state, u4 sectionOffset, in checkHeaderSection()
300 u4 sectionCount, u4* endOffset) { in checkHeaderSection()
320 static u4 mapTypeToBitMask(int mapType) { in mapTypeToBitMask()
376 u4 count; in swapMap()
377 u4 dataItemCount = 0; // Total count of items in the data section. in swapMap()
378 u4 dataItemsLeft = state->pHeader->dataSize; // See use below. in swapMap()
379 u4 usedBits = 0; // Bit set: one bit per section in swapMap()
381 u4 lastOffset = 0; in swapMap()
385 const u4 sizeOfItem = (u4) sizeof(DexMapItem); in swapMap()
409 u4 icount = item->size; in swapMap()
426 u4 bit = mapTypeToBitMask(item->type); in swapMap()
510 static bool checkMapSection(const CheckState* state, u4 sectionOffset, in checkMapSection()
511 u4 sectionCount, u4* endOffset) { in checkMapSection()
526 sectionOffset + sizeof(u4) + (pMap->size * sizeof(DexMapItem)); in checkMapSection()
671 u4 protoIdx = item - state->pDexFile->pProtoIds; in crossVerifyProtoIdItem()
717 u4 idx0 = dexParameterIteratorNextIndex(&iterator0); in crossVerifyProtoIdItem()
718 u4 idx1 = dexParameterIteratorNextIndex(&iterator); in crossVerifyProtoIdItem()
908 static u4 findFirstClassDataDefiner(const CheckState* state,
910 static u4 findFirstAnnotationsDirectoryDefiner(const CheckState* state,
915 static bool verifyClassDataIsForDef(const CheckState* state, u4 offset, in verifyClassDataIsForDef()
916 u4 definerIdx) { in verifyClassDataIsForDef()
934 u4 dataDefiner = findFirstClassDataDefiner(state, classData); in verifyClassDataIsForDef()
945 u4 offset, u4 definerIdx) { in verifyAnnotationsDirectoryIsForDef()
952 u4 annoDefiner = findFirstAnnotationsDirectoryDefiner(state, dir); in verifyAnnotationsDirectoryIsForDef()
960 u4 classIdx = item->classIdx; in crossVerifyClassDefItem()
998 u4 size = interfaces->size; in crossVerifyClassDefItem()
999 u4 i; in crossVerifyClassDefItem()
1022 u4 idx1 = dexTypeListGetIdx(interfaces, i); in crossVerifyClassDefItem()
1023 u4 j; in crossVerifyClassDefItem()
1025 u4 idx2 = dexTypeListGetIdx(interfaces, j); in crossVerifyClassDefItem()
1102 static u1* swapFieldAnnotations(const CheckState* state, u4 count, u1* addr) { in swapFieldAnnotations()
1105 u4 lastIdx = 0; in swapFieldAnnotations()
1107 const u4 sizeOfItem = (u4) sizeof(DexFieldAnnotationsItem); in swapFieldAnnotations()
1132 static u1* swapMethodAnnotations(const CheckState* state, u4 count, u1* addr) { in swapMethodAnnotations()
1135 u4 lastIdx = 0; in swapMethodAnnotations()
1137 const u4 sizeOfItem = (u4) sizeof(DexMethodAnnotationsItem); in swapMethodAnnotations()
1162 static u1* swapParameterAnnotations(const CheckState* state, u4 count, in swapParameterAnnotations()
1166 u4 lastIdx = 0; in swapParameterAnnotations()
1168 const u4 sizeOfItem = (u4) sizeof(DexParameterAnnotationsItem); in swapParameterAnnotations()
1249 static const u1* crossVerifyFieldAnnotations(const CheckState* state, u4 count, in crossVerifyFieldAnnotations()
1250 const u1* addr, u4 definingClass) { in crossVerifyFieldAnnotations()
1270 u4 count, const u1* addr, u4 definingClass) { in crossVerifyMethodAnnotations()
1290 u4 count, const u1* addr, u4 definingClass) { in crossVerifyParameterAnnotations()
1311 static u4 findFirstAnnotationsDirectoryDefiner(const CheckState* state, in findFirstAnnotationsDirectoryDefiner()
1344 u4 definingClass = findFirstAnnotationsDirectoryDefiner(state, item); in crossVerifyAnnotationsDirectoryItem()
1385 u4 count; in swapTypeList()
1392 const u4 sizeOfItem = (u4) sizeof(DexTypeItem); in swapTypeList()
1408 u4 count; in swapAnnotationSetRefList()
1415 const u4 sizeOfItem = (u4) sizeof(DexAnnotationSetRefItem); in swapAnnotationSetRefList()
1448 u4* item; in swapAnnotationSetItem()
1449 u4 count; in swapAnnotationSetItem()
1456 const u4 sizeOfItem = (u4) sizeof(u4); in swapAnnotationSetItem()
1469 static u4 annotationItemTypeIdx(const DexAnnotationItem* item) { in annotationItemTypeIdx()
1478 u4 lastIdx = 0; in crossVerifyAnnotationSetItem()
1490 u4 idx = annotationItemTypeIdx(annotation); in crossVerifyAnnotationSetItem()
1507 static bool verifyFields(const CheckState* state, u4 size, in verifyFields()
1509 u4 i; in verifyFields()
1513 u4 accessFlags = field->accessFlags; in verifyFields()
1534 static bool verifyMethods(const CheckState* state, u4 size, in verifyMethods()
1536 u4 i; in verifyMethods()
1543 u4 accessFlags = method->accessFlags; in verifyMethods()
1646 static u4 findFirstClassDataDefiner(const CheckState* state, in findFirstClassDataDefiner()
1649 u4 fieldIdx = classData->staticFields[0].fieldIdx; in findFirstClassDataDefiner()
1655 u4 fieldIdx = classData->instanceFields[0].fieldIdx; in findFirstClassDataDefiner()
1661 u4 methodIdx = classData->directMethods[0].methodIdx; in findFirstClassDataDefiner()
1667 u4 methodIdx = classData->virtualMethods[0].methodIdx; in findFirstClassDataDefiner()
1679 u4 definingClass = findFirstClassDataDefiner(state, classData); in crossVerifyClassDataItem()
1681 u4 i; in crossVerifyClassDataItem()
1723 static u4 setHandlerOffsAndVerify(const CheckState* state, in setHandlerOffsAndVerify()
1724 DexCode* code, u4 firstOffset, u4 handlersSize, u4* handlerOffs) { in setHandlerOffsAndVerify()
1727 u4 offset = firstOffset; in setHandlerOffsAndVerify()
1729 u4 i; in setHandlerOffsAndVerify()
1756 u4 typeIdx = in setHandlerOffsAndVerify()
1766 u4 addr = readAndVerifyUnsignedLeb128(&ptr, fileEnd, &okay); in setHandlerOffsAndVerify()
1780 u4 addr = readAndVerifyUnsignedLeb128(&ptr, fileEnd, &okay); in setHandlerOffsAndVerify()
1805 u4 handlersSize = in swapTriesAndCatches()
1818 u4 handlerOffs[handlersSize]; // list of valid handlerOff values in swapTriesAndCatches()
1819 u4 endOffset = setHandlerOffsAndVerify(state, code, in swapTriesAndCatches()
1828 u4 count = code->triesSize; in swapTriesAndCatches()
1829 u4 lastEnd = 0; in swapTriesAndCatches()
1831 const u4 sizeOfItem = (u4) sizeof(DexTry); in swapTriesAndCatches()
1835 u4 i; in swapTriesAndCatches()
1880 u4 count; in swapCodeItem()
1912 const u4 sizeOfItem = (u4) sizeof(u2); in swapCodeItem()
1926 ALOGE("Non-zero padding: %#x", (u4) *insns); in swapCodeItem()
1942 u4 utf16Size = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay); in intraVerifyStringDataItem()
1943 u4 i; in intraVerifyStringDataItem()
2043 u4 i; in intraVerifyDebugInfoItem()
2052 u4 parametersSize = in intraVerifyDebugInfoItem()
2066 u4 parameterName = in intraVerifyDebugInfoItem()
2098 u4 idx; in intraVerifyDebugInfoItem()
2099 u4 regNum = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay); in intraVerifyDebugInfoItem()
2121 u4 regNum = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay); in intraVerifyDebugInfoItem()
2130 u4 idx; in intraVerifyDebugInfoItem()
2131 u4 regNum = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay); in intraVerifyDebugInfoItem()
2158 u4 idx = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay); in intraVerifyDebugInfoItem()
2188 static u4 readUnsignedLittleEndian(const CheckState* state, const u1** pData, in readUnsignedLittleEndian()
2189 u4 size) { in readUnsignedLittleEndian()
2191 u4 result = 0; in readUnsignedLittleEndian()
2192 u4 i; in readUnsignedLittleEndian()
2197 result |= ((u4) *(data++)) << (i * 8); in readUnsignedLittleEndian()
2209 u4 size = readAndVerifyUnsignedLeb128(&data, state->fileEnd, &okay); in verifyEncodedArray()
2227 static u4 numberOfMethodHandles(const CheckState* state) { in numberOfMethodHandles()
2241 u4 valueType = headerByte & kDexAnnotationValueTypeMask; in verifyEncodedValue()
2242 u4 valueArg = headerByte >> kDexAnnotationValueArgShift; in verifyEncodedValue()
2281 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1); in verifyEncodedValue()
2290 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1); in verifyEncodedValue()
2299 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1); in verifyEncodedValue()
2308 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1); in verifyEncodedValue()
2318 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1); in verifyEncodedValue()
2327 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1); in verifyEncodedValue()
2378 u4 idx = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay); in verifyEncodedAnnotation()
2395 u4 size = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay); in verifyEncodedAnnotation()
2396 u4 lastIdx = 0; in verifyEncodedAnnotation()
2478 u4 offset, u4 count, ItemVisitorFunction* func, u4 alignment, in iterateSectionWithOptionalUpdate()
2479 u4* nextOffset, int mapType) { in iterateSectionWithOptionalUpdate()
2480 u4 alignmentMask = alignment - 1; in iterateSectionWithOptionalUpdate()
2481 u4 i; in iterateSectionWithOptionalUpdate()
2486 u4 newOffset = (offset + alignmentMask) & ~alignmentMask; in iterateSectionWithOptionalUpdate()
2537 static bool iterateSection(CheckState* state, u4 offset, u4 count, in iterateSection()
2538 ItemVisitorFunction* func, u4 alignment, u4* nextOffset) { in iterateSection()
2548 u4 offset, u4 count, u4 expectedOffset, u4 expectedCount, in checkBoundsAndIterateSection()
2549 ItemVisitorFunction* func, u4 alignment, u4* nextOffset) { in checkBoundsAndIterateSection()
2569 static bool iterateDataSection(CheckState* state, u4 offset, u4 count, in iterateDataSection()
2570 ItemVisitorFunction* func, u4 alignment, u4* nextOffset, int mapType) { in iterateDataSection()
2571 u4 dataStart = state->pHeader->dataOff; in iterateDataSection()
2572 u4 dataEnd = dataStart + state->pHeader->dataSize; in iterateDataSection()
2606 u4 lastOffset = 0; in swapEverythingButHeaderAndMap()
2607 u4 count = pMap->size; in swapEverythingButHeaderAndMap()
2611 u4 sectionOffset = item->offset; in swapEverythingButHeaderAndMap()
2612 u4 sectionCount = item->size; in swapEverythingButHeaderAndMap()
2652 sizeof(u4), &lastOffset); in swapEverythingButHeaderAndMap()
2659 sizeof(u4), &lastOffset); in swapEverythingButHeaderAndMap()
2666 sizeof(u4), &lastOffset); in swapEverythingButHeaderAndMap()
2673 sizeof(u4), &lastOffset); in swapEverythingButHeaderAndMap()
2680 sizeof(u4), &lastOffset); in swapEverythingButHeaderAndMap()
2687 sizeof(u4), &lastOffset); in swapEverythingButHeaderAndMap()
2693 swapCallSiteId, sizeof(u4), &lastOffset); in swapEverythingButHeaderAndMap()
2699 swapMethodHandleItem, sizeof(u4), &lastOffset); in swapEverythingButHeaderAndMap()
2713 swapTypeList, sizeof(u4), &lastOffset, type); in swapEverythingButHeaderAndMap()
2718 swapAnnotationSetRefList, sizeof(u4), &lastOffset, in swapEverythingButHeaderAndMap()
2724 swapAnnotationSetItem, sizeof(u4), &lastOffset, type); in swapEverythingButHeaderAndMap()
2735 swapCodeItem, sizeof(u4), &lastOffset, type); in swapEverythingButHeaderAndMap()
2764 swapAnnotationsDirectoryItem, sizeof(u4), &lastOffset, in swapEverythingButHeaderAndMap()
2792 u4 count = pMap->size; in crossVerifyEverything()
2796 u4 sectionOffset = item->offset; in crossVerifyEverything()
2797 u4 sectionCount = item->size; in crossVerifyEverything()
2813 crossVerifyStringIdItem, sizeof(u4), NULL); in crossVerifyEverything()
2818 crossVerifyTypeIdItem, sizeof(u4), NULL); in crossVerifyEverything()
2823 crossVerifyProtoIdItem, sizeof(u4), NULL); in crossVerifyEverything()
2828 crossVerifyFieldIdItem, sizeof(u4), NULL); in crossVerifyEverything()
2833 crossVerifyMethodIdItem, sizeof(u4), NULL); in crossVerifyEverything()
2839 u4 definedClassBits[arraySize]; in crossVerifyEverything()
2840 memset(definedClassBits, 0, arraySize * sizeof(u4)); in crossVerifyEverything()
2844 crossVerifyClassDefItem, sizeof(u4), NULL); in crossVerifyEverything()
2851 crossVerifyCallSiteId, sizeof(u4), NULL); in crossVerifyEverything()
2856 crossVerifyMethodHandleItem, sizeof(u4), NULL); in crossVerifyEverything()
2861 crossVerifyAnnotationSetRefList, sizeof(u4), NULL); in crossVerifyEverything()
2866 crossVerifyAnnotationSetItem, sizeof(u4), NULL); in crossVerifyEverything()
2876 crossVerifyAnnotationsDirectoryItem, sizeof(u4), NULL); in crossVerifyEverything()
2952 u4 expectedLen = SWAP4(pHeader->fileSize); in dexSwapAndVerify()
2971 u4 storedFileSize = SWAP4(pHeader->fileSize); in dexSwapAndVerify()
2972 u4 expectedChecksum = SWAP4(pHeader->checksum); in dexSwapAndVerify()