Home | History | Annotate | Download | only in libdex

Lines Matching refs:u4

49     u4                fileLen;
60 u4* pDefinedClassBits;
68 static inline u4 fileOffset(const CheckState* state, const void* ptr) {
75 static inline void* filePointer(const CheckState* state, u4 offset) {
167 #_field, (u4)(_field), #_limit, (u4)(_limit)); \
186 #_field, (u4)(_field), #_limit, (u4)(_limit)); \
209 static bool verifyFieldDefiner(const CheckState* state, u4 definingClass,
210 u4 fieldIdx) {
216 static bool verifyMethodDefiner(const CheckState* state, u4 definingClass,
217 u4 methodIdx) {
235 static bool setDefinedClassBit(const CheckState* state, u4 typeIdx) {
236 u4 arrayIdx = typeIdx >> 5;
237 u4 bit = 1 << (typeIdx & 0x1f);
238 u4* element = &state->pDefinedClassBits[arrayIdx];
283 u4 linkOff = pHeader->linkOff;
284 u4 linkEnd = linkOff + pHeader->linkSize;
285 u4 dataOff = pHeader->dataOff;
286 u4 dataEnd = dataOff + pHeader->dataSize;
299 static bool checkHeaderSection(const CheckState* state, u4 sectionOffset,
300 u4 sectionCount, u4* endOffset) {
320 static u4 mapTypeToBitMask(int mapType) {
376 u4 count;
377 u4 dataItemCount = 0; // Total count of items in the data section.
378 u4 dataItemsLeft = state->pHeader->dataSize; // See use below.
379 u4 usedBits = 0; // Bit set: one bit per section
381 u4 lastOffset = 0;
385 const u4 sizeOfItem = (u4) sizeof(DexMapItem);
409 u4 icount = item->size;
426 u4 bit = mapTypeToBitMask(item->type);
510 static bool checkMapSection(const CheckState* state, u4 sectionOffset,
511 u4 sectionCount, u4* endOffset) {
526 sectionOffset + sizeof(u4) + (pMap->size * sizeof(DexMapItem));
671 u4 protoIdx = item - state->pDexFile->pProtoIds;
717 u4 idx0 = dexParameterIteratorNextIndex(&iterator0);
718 u4 idx1 = dexParameterIteratorNextIndex(&iterator);
908 static u4 findFirstClassDataDefiner(const CheckState* state,
910 static u4 findFirstAnnotationsDirectoryDefiner(const CheckState* state,
915 static bool verifyClassDataIsForDef(const CheckState* state, u4 offset,
916 u4 definerIdx) {
934 u4 dataDefiner = findFirstClassDataDefiner(state, classData);
945 u4 offset, u4 definerIdx) {
952 u4 annoDefiner = findFirstAnnotationsDirectoryDefiner(state, dir);
960 u4 classIdx = item->classIdx;
998 u4 size = interfaces->size;
999 u4 i;
1022 u4 idx1 = dexTypeListGetIdx(interfaces, i);
1023 u4 j;
1025 u4 idx2 = dexTypeListGetIdx(interfaces, j);
1102 static u1* swapFieldAnnotations(const CheckState* state, u4 count, u1* addr) {
1105 u4 lastIdx = 0;
1107 const u4 sizeOfItem = (u4) sizeof(DexFieldAnnotationsItem);
1132 static u1* swapMethodAnnotations(const CheckState* state, u4 count, u1* addr) {
1135 u4 lastIdx = 0;
1137 const u4 sizeOfItem = (u4) sizeof(DexMethodAnnotationsItem);
1162 static u1* swapParameterAnnotations(const CheckState* state, u4 count,
1166 u4 lastIdx = 0;
1168 const u4 sizeOfItem = (u4) sizeof(DexParameterAnnotationsItem);
1249 static const u1* crossVerifyFieldAnnotations(const CheckState* state, u4 count,
1250 const u1* addr, u4 definingClass) {
1270 u4 count, const u1* addr, u4 definingClass) {
1290 u4 count, const u1* addr, u4 definingClass) {
1311 static u4 findFirstAnnotationsDirectoryDefiner(const CheckState* state,
1344 u4 definingClass = findFirstAnnotationsDirectoryDefiner(state, item);
1385 u4 count;
1392 const u4 sizeOfItem = (u4) sizeof(DexTypeItem);
1408 u4 count;
1415 const u4 sizeOfItem = (u4) sizeof(DexAnnotationSetRefItem);
1448 u4* item;
1449 u4 count;
1456 const u4 sizeOfItem = (u4) sizeof(u4);
1469 static u4 annotationItemTypeIdx(const DexAnnotationItem* item) {
1478 u4 lastIdx = 0;
1490 u4 idx = annotationItemTypeIdx(annotation);
1507 static bool verifyFields(const CheckState* state, u4 size,
1509 u4 i;
1513 u4 accessFlags = field->accessFlags;
1534 static bool verifyMethods(const CheckState* state, u4 size,
1536 u4 i;
1543 u4 accessFlags = method->accessFlags;
1646 static u4 findFirstClassDataDefiner(const CheckState* state,
1649 u4 fieldIdx = classData->staticFields[0].fieldIdx;
1655 u4 fieldIdx = classData->instanceFields[0].fieldIdx;
1661 u4 methodIdx = classData->directMethods[0].methodIdx;
1667 u4 methodIdx = classData->virtualMethods[0].methodIdx;
1679 u4 definingClass = findFirstClassDataDefiner(state, classData);
1681 u4 i;
1723 static u4 setHandlerOffsAndVerify(const CheckState* state,
1724 DexCode* code, u4 firstOffset, u4 handlersSize, u4* handlerOffs) {
1727 u4 offset = firstOffset;
1729 u4 i;
1756 u4 typeIdx =
1766 u4 addr = readAndVerifyUnsignedLeb128(&ptr, fileEnd, &okay);
1780 u4 addr = readAndVerifyUnsignedLeb128(&ptr, fileEnd, &okay);
1805 u4 handlersSize =
1818 u4 handlerOffs[handlersSize]; // list of valid handlerOff values
1819 u4 endOffset = setHandlerOffsAndVerify(state, code,
1828 u4 count = code->triesSize;
1829 u4 lastEnd = 0;
1831 const u4 sizeOfItem = (u4) sizeof(DexTry);
1835 u4 i;
1880 u4 count;
1912 const u4 sizeOfItem = (u4) sizeof(u2);
1926 ALOGE("Non-zero padding: %#x", (u4) *insns);
1942 u4 utf16Size = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay);
1943 u4 i;
2043 u4 i;
2052 u4 parametersSize =
2066 u4 parameterName =
2098 u4 idx;
2099 u4 regNum = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay);
2121 u4 regNum = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay);
2130 u4 idx;
2131 u4 regNum = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay);
2158 u4 idx = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay);
2188 static u4 readUnsignedLittleEndian(const CheckState* state, const u1** pData,
2189 u4 size) {
2191 u4 result = 0;
2192 u4 i;
2197 result |= ((u4) *(data++)) << (i * 8);
2209 u4 size = readAndVerifyUnsignedLeb128(&data, state->fileEnd, &okay);
2227 static u4 numberOfMethodHandles(const CheckState* state) {
2241 u4 valueType = headerByte & kDexAnnotationValueTypeMask;
2242 u4 valueArg = headerByte >> kDexAnnotationValueArgShift;
2281 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1);
2290 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1);
2299 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1);
2308 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1);
2318 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1);
2327 u4 idx = readUnsignedLittleEndian(state, &data, valueArg + 1);
2378 u4 idx = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay);
2395 u4 size = readAndVerifyUnsignedLeb128(&data, fileEnd, &okay);
2396 u4 lastIdx = 0;
2491 u4 offset, u4 count, ItemVisitorFunction* func, u4 alignment,
2492 u4* nextOffset, int mapType) {
2493 u4 alignmentMask = alignment - 1;
2494 u4 i;
2499 u4 newOffset = (offset + alignmentMask) & ~alignmentMask;
2550 static bool iterateSection(CheckState* state, u4 offset, u4 count,
2551 ItemVisitorFunction* func, u4 alignment, u4* nextOffset) {
2561 u4 offset, u4 count, u4 expectedOffset, u4 expectedCount,
2562 ItemVisitorFunction* func, u4 alignment, u4* nextOffset) {
2582 static bool iterateDataSection(CheckState* state, u4 offset, u4 count,
2583 u4 alignment, u4* nextOffset, int mapType) {
2584 u4 dataStart = state->pHeader->dataOff;
2585 u4 dataEnd = dataStart + state->pHeader->dataSize;
2619 u4 lastOffset = 0;
2620 u4 count = pMap->size;
2624 u4 sectionOffset = item->offset;
2625 u4 sectionCount = item->size;
2665 sizeof(u4), &lastOffset);
2672 sizeof(u4), &lastOffset);
2679 sizeof(u4), &lastOffset);
2686 sizeof(u4), &lastOffset);
2693 sizeof(u4), &lastOffset);
2700 sizeof(u4), &lastOffset);
2706 swapCallSiteId, sizeof(u4), &lastOffset);
2712 swapMethodHandleItem, sizeof(u4), &lastOffset);
2726 swapTypeList, sizeof(u4), &lastOffset, type);
2731 swapAnnotationSetRefList, sizeof(u4), &lastOffset,
2737 swapAnnotationSetItem, sizeof(u4), &lastOffset, type);
2748 swapCodeItem, sizeof(u4), &lastOffset, type);
2777 swapAnnotationsDirectoryItem, sizeof(u4), &lastOffset,
2805 u4 count = pMap->size;
2809 u4 sectionOffset = item->offset;
2810 u4 sectionCount = item->size;
2826 crossVerifyStringIdItem, sizeof(u4), NULL);
2831 crossVerifyTypeIdItem, sizeof(u4), NULL);
2836 crossVerifyProtoIdItem, sizeof(u4), NULL);
2841 crossVerifyFieldIdItem, sizeof(u4), NULL);
2846 crossVerifyMethodIdItem, sizeof(u4), NULL);
2852 u4 definedClassBits[arraySize];
2853 memset(definedClassBits, 0, arraySize * sizeof(u4));
2857 crossVerifyClassDefItem, sizeof(u4), NULL);
2864 crossVerifyCallSiteId, sizeof(u4), NULL);
2869 crossVerifyMethodHandleItem, sizeof(u4), NULL);
2874 crossVerifyAnnotationSetRefList, sizeof(u4), NULL);
2879 crossVerifyAnnotationSetItem, sizeof(u4), NULL);
2889 crossVerifyAnnotationsDirectoryItem, sizeof(u4), NULL);
2964 u4 expectedLen = SWAP4(pHeader->fileSize);
2983 u4 storedFileSize = SWAP4(pHeader->fileSize);
2984 u4 expectedChecksum = SWAP4(pHeader->checksum);