Lines Matching refs:u4
49 u4 fileLen;
58 u4* pDefinedClassBits;
66 static inline u4 fileOffset(const CheckState* state, const void* ptr) {
73 static inline void* filePointer(const CheckState* state, u4 offset) {
165 #_field, (u4)(_field), #_limit, (u4)(_limit)); \
184 #_field, (u4)(_field), #_limit, (u4)(_limit)); \
207 static bool verifyFieldDefiner(const CheckState* state, u4 definingClass,
208 u4 fieldIdx) {
214 static bool verifyMethodDefiner(const CheckState* state, u4 definingClass,
215 u4 methodIdx) {
233 static bool setDefinedClassBit(const CheckState* state, u4 typeIdx) {
234 u4 arrayIdx = typeIdx >> 5;
235 u4 bit = 1 << (typeIdx & 0x1f);
236 u4* element = &state->pDefinedClassBits[arrayIdx];
281 u4 linkOff = pHeader->linkOff;
282 u4 linkEnd = linkOff + pHeader->linkSize;
283 u4 dataOff = pHeader->dataOff;
284 u4 dataEnd = dataOff + pHeader->dataSize;
297 static bool checkHeaderSection(const CheckState* state, u4 sectionOffset,
298 u4 sectionCount, u4* endOffset) {
318 static u4 mapTypeToBitMask(int mapType) {
372 u4 count;
373 u4 dataItemCount = 0; // Total count of items in the data section.
374 u4 dataItemsLeft = state->pHeader->dataSize; // See use below.
375 u4 usedBits = 0; // Bit set: one bit per section
377 u4 lastOffset = 0;
381 const u4 sizeOfItem = (u4) sizeof(DexMapItem);
405 u4 icount = item->size;
422 u4 bit = mapTypeToBitMask(item->type);
500 static bool checkMapSection(const CheckState* state, u4 sectionOffset,
501 u4 sectionCount, u4* endOffset) {
516 sectionOffset + sizeof(u4) + (pMap->size * sizeof(DexMapItem));
661 u4 protoIdx = item - state->pDexFile->pProtoIds;
707 u4 idx0 = dexParameterIteratorNextIndex(&iterator0);
708 u4 idx1 = dexParameterIteratorNextIndex(&iterator);
898 static u4 findFirstClassDataDefiner(const CheckState* state,
900 static u4 findFirstAnnotationsDirectoryDefiner(const CheckState* state,
905 static bool verifyClassDataIsForDef(const CheckState* state, u4 offset,
906 u4 definerIdx) {
924 u4 dataDefiner = findFirstClassDataDefiner(state, classData);
935 u4 offset, u4 definerIdx) {
942 u4 annoDefiner = findFirstAnnotationsDirectoryDefiner(state, dir);
950 u4 classIdx = item->classIdx;
988 u4 size = interfaces->size;
989 u4 i;
1012 u4 idx1 = dexTypeListGetIdx(interfaces, i);
1013 u4 j;
1015 u4 idx2 = dexTypeListGetIdx(interfaces, j);
1042 static u1* swapFieldAnnotations(const CheckState* state, u4 count, u1* addr) {
1045 u4 lastIdx = 0;
1047 const u4 sizeOfItem = (u4) sizeof(DexFieldAnnotationsItem);
1072 static u1* swapMethodAnnotations(const CheckState* state, u4 count, u1* addr) {
1075 u4 lastIdx = 0;
1077 const u4 sizeOfItem = (u4) sizeof(DexMethodAnnotationsItem);
1102 static u1* swapParameterAnnotations(const CheckState* state, u4 count,
1106 u4 lastIdx = 0;
1108 const u4 sizeOfItem = (u4) sizeof(DexParameterAnnotationsItem);
1169 static const u1* crossVerifyFieldAnnotations(const CheckState* state, u4 count,
1170 const u1* addr, u4 definingClass) {
1190 u4 count, const u1* addr, u4 definingClass) {
1210 u4 count, const u1* addr, u4 definingClass) {
1231 static u4 findFirstAnnotationsDirectoryDefiner(const CheckState* state,
1264 u4 definingClass = findFirstAnnotationsDirectoryDefiner(state, item);
1305 u4 count;
1312 const u4 sizeOfItem = (u4) sizeof(DexTypeItem);
1328 u4 count;
1335 const u4 sizeOfItem = (u4) sizeof(DexAnnotationSetRefItem);
1368 u4* item;
1369 u4 count;
1376 const u4 sizeOfItem = (u4) sizeof(u4);
1389 static u4 annotationItemTypeIdx(const DexAnnotationItem* item) {
1398 u4 lastIdx = 0;
1410 u4 idx = annotationItemTypeIdx(annotation);
1427 static bool verifyFields(const CheckState* state, u4 size,
1429 u4 i;
1433 u4 accessFlags = field->accessFlags;
1454 static bool verifyMethods(const CheckState* state, u4 size,
1456 u4 i;
1463 u4 accessFlags = method->accessFlags;
1566 static u4 findFirstClassDataDefiner(const CheckState* state,
1569 u4 fieldIdx = classData->staticFields[0].fieldIdx;
1575 u4 fieldIdx = classData->instanceFields[0].fieldIdx;
1581 u4 methodIdx = classData->directMethods[0].methodIdx;
1587 u4 methodIdx = classData->virtualMethods[0].methodIdx;
1599 u4 definingClass = findFirstClassDataDefiner(state, classData);
1601 u4 i;
1643 static u4 setHandlerOffsAndVerify(const CheckState* state,
1644 DexCode* code, u4 firstOffset, u4 handlersSize, u4* handlerOffs) {
1647 u4 offset = firstOffset;
1649 u4 i;
1676 u4 typeIdx =
1686 u4 addr = readAndVerifyUnsignedLeb128(&ptr, fileEnd, &okay);
1700 u4 addr = readAndVerifyUnsignedLeb128(&ptr, fileEnd, &okay);
1725 u4 handlersSize =
1738 u4 handlerOffs[handlersSize]; // list of valid handlerOff values
1739 u4 endOffset = setHandlerOffsAndVerify(state, code,
1748 u4 count = code->triesSize;
1749 u4 lastEnd = 0;
1751 const u4 sizeOfItem = (u4) sizeof(DexTry);
1755 u4 i;
1800 u4 count;
1832 const u4 sizeOfItem = (u4) sizeof(u2);
1846 ALOGE("Non-zero padding: %#x", (u4) *insns);
1862 u4 utf16Size = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay);
1863 u4 i;
1963 u4 i;
1972 u4 parametersSize =
1986 u4 parameterName =
2018 u4 idx;
2019 u4 regNum = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay);
2041 u4 regNum = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay);
2050 u4 idx;
2051 u4 regNum = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay);
2078 u4 idx = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay);
2108 static u4 readUnsignedLittleEndian(const CheckState* state, const u1** pData,
2109 u4 size) {
2111 u4 result = 0;
2112 u4 i;
2117 result |= ((u4) *(data++)) << (i * 8);
2129 u4 size = readAndVerifyUnsignedLeb128(&data, state->fileEnd, &okay);
2154 u4 valueType = headerByte & kDexAnnotationValueTypeMask;
2155 u4 valueArg = headerByte >> kDexAnnotationValueArgShift;
2194 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1);
2203 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1);
2213 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1);
2222 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1);
2273 u4 idx = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay);
2290 u4 size = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay);
2291 u4 lastIdx = 0;
2386 u4 offset, u4 count, ItemVisitorFunction* func, u4 alignment,
2387 u4* nextOffset, int mapType) {
2388 u4 alignmentMask = alignment - 1;
2389 u4 i;
2394 u4 newOffset = (offset + alignmentMask) & ~alignmentMask;
2445 static bool iterateSection(CheckState* state, u4 offset, u4 count,
2446 ItemVisitorFunction* func, u4 alignment, u4* nextOffset) {
2456 u4 offset, u4 count, u4 expectedOffset, u4 expectedCount,
2457 ItemVisitorFunction* func, u4 alignment, u4* nextOffset) {
2477 static bool iterateDataSection(CheckState* state, u4 offset, u4 count,
2478 ItemVisitorFunction* func, u4 alignment, u4* nextOffset, int mapType) {
2479 u4 dataStart = state->pHeader->dataOff;
2480 u4 dataEnd = dataStart + state->pHeader->dataSize;
2514 u4 lastOffset = 0;
2515 u4 count = pMap->size;
2519 u4 sectionOffset = item->offset;
2520 u4 sectionCount = item->size;
2560 sizeof(u4), &lastOffset);
2567 sizeof(u4), &lastOffset);
2574 sizeof(u4), &lastOffset);
2581 sizeof(u4), &lastOffset);
2588 sizeof(u4), &lastOffset);
2595 sizeof(u4), &lastOffset);
2609 swapTypeList, sizeof(u4), &lastOffset, type);
2614 swapAnnotationSetRefList, sizeof(u4), &lastOffset,
2620 swapAnnotationSetItem, sizeof(u4), &lastOffset, type);
2631 swapCodeItem, sizeof(u4), &lastOffset, type);
2660 swapAnnotationsDirectoryItem, sizeof(u4), &lastOffset,
2688 u4 count = pMap->size;
2692 u4 sectionOffset = item->offset;
2693 u4 sectionCount = item->size;
2709 crossVerifyStringIdItem, sizeof(u4), NULL);
2714 crossVerifyTypeIdItem, sizeof(u4), NULL);
2719 crossVerifyProtoIdItem, sizeof(u4), NULL);
2724 crossVerifyFieldIdItem, sizeof(u4), NULL);
2729 crossVerifyMethodIdItem, sizeof(u4), NULL);
2735 u4 definedClassBits[arraySize];
2736 memset(definedClassBits, 0, arraySize * sizeof(u4));
2740 crossVerifyClassDefItem, sizeof(u4), NULL);
2747 crossVerifyAnnotationSetRefList, sizeof(u4), NULL);
2752 crossVerifyAnnotationSetItem, sizeof(u4), NULL);
2762 crossVerifyAnnotationsDirectoryItem, sizeof(u4), NULL);
2859 u4 storedFileSize = SWAP4(pHeader->fileSize);
2860 u4 expectedChecksum = SWAP4(pHeader->checksum);