Lines Matching refs:pDexFile

400 void dumpFileHeader(const DexFile* pDexFile)  in dumpFileHeader()  argument
402 const DexOptHeader* pOptHeader = pDexFile->pOptHeader; in dumpFileHeader()
403 const DexHeader* pHeader = pDexFile->pHeader; in dumpFileHeader()
467 void dumpOptDirectory(const DexFile* pDexFile) in dumpOptDirectory() argument
469 const DexOptHeader* pOptHeader = pDexFile->pOptHeader; in dumpOptDirectory()
516 void dumpClassDef(DexFile* pDexFile, int idx) in dumpClassDef() argument
522 pClassDef = dexGetClassDef(pDexFile, idx); in dumpClassDef()
523 pEncodedData = dexGetClassData(pDexFile, pClassDef); in dumpClassDef()
557 void dumpInterface(const DexFile* pDexFile, const DexTypeItem* pTypeItem, in dumpInterface() argument
561 dexStringByTypeIdx(pDexFile, pTypeItem->typeIdx); in dumpInterface()
575 void dumpCatches(DexFile* pDexFile, const DexCode* pCode) in dumpCatches() argument
608 dexStringByTypeIdx(pDexFile, handler->typeIdx); in dumpCatches()
625 void dumpPositions(DexFile* pDexFile, const DexCode* pCode, in dumpPositions() argument
630 = dexGetMethodId(pDexFile, pDexMethod->methodIdx); in dumpPositions()
632 = dexStringByTypeIdx(pDexFile, pMethodId->classIdx); in dumpPositions()
634 dexDecodeDebugInfo(pDexFile, pCode, classDescriptor, pMethodId->protoIdx, in dumpPositions()
650 void dumpLocals(DexFile* pDexFile, const DexCode* pCode, in dumpLocals() argument
656 = dexGetMethodId(pDexFile, pDexMethod->methodIdx); in dumpLocals()
658 = dexStringByTypeIdx(pDexFile, pMethodId->classIdx); in dumpLocals()
660 dexDecodeDebugInfo(pDexFile, pCode, classDescriptor, pMethodId->protoIdx, in dumpLocals()
667 bool getMethodInfo(DexFile* pDexFile, u4 methodIdx, FieldMethodInfo* pMethInfo) in getMethodInfo() argument
671 if (methodIdx >= pDexFile->pHeader->methodIdsSize) in getMethodInfo()
674 pMethodId = dexGetMethodId(pDexFile, methodIdx); in getMethodInfo()
675 pMethInfo->name = dexStringById(pDexFile, pMethodId->nameIdx); in getMethodInfo()
676 pMethInfo->signature = dexCopyDescriptorFromMethodId(pDexFile, pMethodId); in getMethodInfo()
679 dexStringByTypeIdx(pDexFile, pMethodId->classIdx); in getMethodInfo()
686 bool getFieldInfo(DexFile* pDexFile, u4 fieldIdx, FieldMethodInfo* pFieldInfo) in getFieldInfo() argument
690 if (fieldIdx >= pDexFile->pHeader->fieldIdsSize) in getFieldInfo()
693 pFieldId = dexGetFieldId(pDexFile, fieldIdx); in getFieldInfo()
694 pFieldInfo->name = dexStringById(pDexFile, pFieldId->nameIdx); in getFieldInfo()
695 pFieldInfo->signature = dexStringByTypeIdx(pDexFile, pFieldId->typeIdx); in getFieldInfo()
697 dexStringByTypeIdx(pDexFile, pFieldId->classIdx); in getFieldInfo()
704 bool getProtoInfo(DexFile* pDexFile, u4 protoIdx, ProtoInfo* pProtoInfo) in getProtoInfo() argument
706 if (protoIdx >= pDexFile->pHeader->protoIdsSize) { in getProtoInfo()
710 const DexProtoId* protoId = dexGetProtoId(pDexFile, protoIdx); in getProtoInfo()
713 if (protoId->returnTypeIdx >= pDexFile->pHeader->typeIdsSize) { in getProtoInfo()
716 pProtoInfo->returnType = dexStringByTypeIdx(pDexFile, protoId->returnTypeIdx); in getProtoInfo()
728 const DexTypeList* paramTypes = dexGetProtoParameters(pDexFile, protoId); in getProtoInfo()
736 if (paramTypes->list[i].typeIdx >= pDexFile->pHeader->typeIdsSize) { in getProtoInfo()
740 const char* param = dexStringByTypeIdx(pDexFile, paramTypes->list[i].typeIdx); in getProtoInfo()
762 const char* getClassDescriptor(DexFile* pDexFile, u4 classIdx) in getClassDescriptor() argument
764 return dexStringByTypeIdx(pDexFile, classIdx); in getClassDescriptor()
776 static char* indexString(DexFile* pDexFile, const DecodedInstruction* pDecInsn, size_t bufSize) in indexString() argument
846 if (index < pDexFile->pHeader->typeIdsSize) { in indexString()
848 getClassDescriptor(pDexFile, index), width, index); in indexString()
854 if (index < pDexFile->pHeader->stringIdsSize) { in indexString()
856 dexStringById(pDexFile, index), width, index); in indexString()
865 if (getMethodInfo(pDexFile, index, &methInfo)) { in indexString()
879 if (getFieldInfo(pDexFile, index, &fieldInfo)) { in indexString()
905 if (getMethodInfo(pDexFile, index, &methInfo) && in indexString()
906 getProtoInfo(pDexFile, secondaryIndex, &protoInfo)) { in indexString()
933 return indexString(pDexFile, pDecInsn, outSize + 1); in indexString()
942 void dumpInstruction(DexFile* pDexFile, const DexCode* pCode, int insnIdx, in dumpInstruction() argument
949 printf("%06zx:", ((u1*)insns - pDexFile->baseAddr) + insnIdx*2); in dumpInstruction()
987 indexBuf = indexString(pDexFile, pDecInsn, 200); in dumpInstruction()
1170 void dumpBytecodes(DexFile* pDexFile, const DexMethod* pDexMethod) in dumpBytecodes() argument
1172 const DexCode* pCode = dexGetCode(pDexFile, pDexMethod); in dumpBytecodes()
1186 getMethodInfo(pDexFile, pDexMethod->methodIdx, &methInfo); in dumpBytecodes()
1187 startAddr = ((u1*)pCode - pDexFile->baseAddr); in dumpBytecodes()
1231 dumpInstruction(pDexFile, pCode, insnIdx, insnWidth, &decInsn); in dumpBytecodes()
1243 void dumpCode(DexFile* pDexFile, const DexMethod* pDexMethod) in dumpCode() argument
1245 const DexCode* pCode = dexGetCode(pDexFile, pDexMethod); in dumpCode()
1253 dumpBytecodes(pDexFile, pDexMethod); in dumpCode()
1255 dumpCatches(pDexFile, pCode); in dumpCode()
1257 dumpPositions(pDexFile, pCode, pDexMethod); in dumpCode()
1258 dumpLocals(pDexFile, pCode, pDexMethod); in dumpCode()
1264 void dumpMethod(DexFile* pDexFile, const DexMethod* pDexMethod, int i) in dumpMethod() argument
1278 pMethodId = dexGetMethodId(pDexFile, pDexMethod->methodIdx); in dumpMethod()
1279 name = dexStringById(pDexFile, pMethodId->nameIdx); in dumpMethod()
1280 typeDescriptor = dexCopyDescriptorFromMethodId(pDexFile, pMethodId); in dumpMethod()
1282 backDescriptor = dexStringByTypeIdx(pDexFile, pMethodId->classIdx); in dumpMethod()
1298 dumpCode(pDexFile, pDexMethod); in dumpMethod()
1407 void dumpSField(const DexFile* pDexFile, const DexField* pSField, int i) in dumpSField() argument
1421 pFieldId = dexGetFieldId(pDexFile, pSField->fieldIdx); in dumpSField()
1422 name = dexStringById(pDexFile, pFieldId->nameIdx); in dumpSField()
1423 typeDescriptor = dexStringByTypeIdx(pDexFile, pFieldId->typeIdx); in dumpSField()
1424 backDescriptor = dexStringByTypeIdx(pDexFile, pFieldId->classIdx); in dumpSField()
1464 void dumpIField(const DexFile* pDexFile, const DexField* pIField, int i) in dumpIField() argument
1466 dumpSField(pDexFile, pIField, i); in dumpIField()
1477 void dumpClass(DexFile* pDexFile, int idx, char** pLastPackage) in dumpClass() argument
1489 pClassDef = dexGetClassDef(pDexFile, idx); in dumpClass()
1497 pEncodedData = dexGetClassData(pDexFile, pClassDef); in dumpClass()
1505 classDescriptor = dexStringByTypeIdx(pDexFile, pClassDef->classIdx); in dumpClass()
1558 dexStringByTypeIdx(pDexFile, pClassDef->superclassIdx); in dumpClass()
1594 pInterfaces = dexGetInterfacesList(pDexFile, pClassDef); in dumpClass()
1597 dumpInterface(pDexFile, dexGetTypeItem(pInterfaces, i), i); in dumpClass()
1603 dumpSField(pDexFile, &pClassData->staticFields[i], i); in dumpClass()
1609 dumpIField(pDexFile, &pClassData->instanceFields[i], i); in dumpClass()
1615 dumpMethod(pDexFile, &pClassData->directMethods[i], i); in dumpClass()
1621 dumpMethod(pDexFile, &pClassData->virtualMethods[i], i); in dumpClass()
1627 fileName = dexStringById(pDexFile, pClassDef->sourceFileIdx); in dumpClass()
1700 void dumpMethodMap(DexFile* pDexFile, const DexMethod* pDexMethod, int idx, in dumpMethodMap() argument
1706 int offset = data - (u1*) pDexFile->pOptHeader; in dumpMethodMap()
1708 pMethodId = dexGetMethodId(pDexFile, pDexMethod->methodIdx); in dumpMethodMap()
1709 name = dexStringById(pDexFile, pMethodId->nameIdx); in dumpMethodMap()
1769 void dumpRegisterMaps(DexFile* pDexFile) in dumpRegisterMaps() argument
1771 const u1* pClassPool = (const u1*)pDexFile->pRegisterMapPool; in dumpRegisterMaps()
1775 int baseFileOffset = (u1*) pClassPool - (u1*) pDexFile->pOptHeader; in dumpRegisterMaps()
1794 pClassDef = dexGetClassDef(pDexFile, idx); in dumpRegisterMaps()
1795 classDescriptor = dexStringByTypeIdx(pDexFile, pClassDef->classIdx); in dumpRegisterMaps()
1813 pEncodedData = dexGetClassData(pDexFile, pClassDef); in dumpRegisterMaps()
1835 dumpMethodMap(pDexFile, &pClassData->directMethods[i], i, &data); in dumpRegisterMaps()
1841 dumpMethodMap(pDexFile, &pClassData->virtualMethods[i], i, &data); in dumpRegisterMaps()
1848 static const DexMapItem* findMapItem(const DexFile* pDexFile, u4 type) in findMapItem() argument
1850 const u4 offset = pDexFile->pHeader->mapOff; in findMapItem()
1851 const DexMapList* list = (const DexMapList*)(pDexFile->baseAddr + offset); in findMapItem()
1860 static void dumpMethodHandles(DexFile* pDexFile) in dumpMethodHandles() argument
1862 const DexMapItem* item = findMapItem(pDexFile, kDexTypeMethodHandleItem); in dumpMethodHandles()
1865 (const DexMethodHandleItem*)(pDexFile->baseAddr + item->offset); in dumpMethodHandles()
1900 getMethodInfo(pDexFile, mh.fieldOrMethodIdx, &info); in dumpMethodHandles()
1902 getFieldInfo(pDexFile, mh.fieldOrMethodIdx, &info); in dumpMethodHandles()
1957 static void dumpCallSites(DexFile* pDexFile) in dumpCallSites() argument
1959 const DexMapItem* item = findMapItem(pDexFile, kDexTypeCallSiteIdItem); in dumpCallSites()
1961 const DexCallSiteId* ids = (const DexCallSiteId*)(pDexFile->baseAddr + item->offset); in dumpCallSites()
1965 const u1* data = pDexFile->baseAddr + ids[index].callSiteOff; in dumpCallSites()
2013 getProtoInfo(pDexFile, idx, &protoInfo); in dumpCallSites()
2028 dexStringById(pDexFile, idx)); in dumpCallSites()
2034 dexStringByTypeIdx(pDexFile, idx)); in dumpCallSites()
2064 void processDexFile(const char* fileName, DexFile* pDexFile) in processDexFile() argument
2071 pDexFile->pHeader->magic +4); in processDexFile()
2075 dumpRegisterMaps(pDexFile); in processDexFile()
2080 dumpFileHeader(pDexFile); in processDexFile()
2081 dumpOptDirectory(pDexFile); in processDexFile()
2087 for (i = 0; i < (int) pDexFile->pHeader->classDefsSize; i++) { in processDexFile()
2089 dumpClassDef(pDexFile, i); in processDexFile()
2091 dumpClass(pDexFile, i, &package); in processDexFile()
2094 dumpMethodHandles(pDexFile); in processDexFile()
2095 dumpCallSites(pDexFile); in processDexFile()
2113 DexFile* pDexFile = NULL; in process() local
2130 pDexFile = dexFileParse((u1*)map.addr, map.length, flags); in process()
2131 if (pDexFile == NULL) { in process()
2139 processDexFile(fileName, pDexFile); in process()
2147 if (pDexFile != NULL) in process()
2148 dexFileFree(pDexFile); in process()