Lines Matching refs:pDexFile
392 void dumpFileHeader(const DexFile* pDexFile)
394 const DexOptHeader* pOptHeader = pDexFile->pOptHeader;
395 const DexHeader* pHeader = pDexFile->pHeader;
459 void dumpOptDirectory(const DexFile* pDexFile)
461 const DexOptHeader* pOptHeader = pDexFile->pOptHeader;
508 void dumpClassDef(DexFile* pDexFile, int idx)
514 pClassDef = dexGetClassDef(pDexFile, idx);
515 pEncodedData = dexGetClassData(pDexFile, pClassDef);
549 void dumpInterface(const DexFile* pDexFile, const DexTypeItem* pTypeItem,
553 dexStringByTypeIdx(pDexFile, pTypeItem->typeIdx);
567 void dumpCatches(DexFile* pDexFile, const DexCode* pCode)
600 dexStringByTypeIdx(pDexFile, handler->typeIdx);
617 void dumpPositions(DexFile* pDexFile, const DexCode* pCode,
622 = dexGetMethodId(pDexFile, pDexMethod->methodIdx);
624 = dexStringByTypeIdx(pDexFile, pMethodId->classIdx);
626 dexDecodeDebugInfo(pDexFile, pCode, classDescriptor, pMethodId->protoIdx,
642 void dumpLocals(DexFile* pDexFile, const DexCode* pCode,
648 = dexGetMethodId(pDexFile, pDexMethod->methodIdx);
650 = dexStringByTypeIdx(pDexFile, pMethodId->classIdx);
652 dexDecodeDebugInfo(pDexFile, pCode, classDescriptor, pMethodId->protoIdx,
659 bool getMethodInfo(DexFile* pDexFile, u4 methodIdx, FieldMethodInfo* pMethInfo)
663 if (methodIdx >= pDexFile->pHeader->methodIdsSize)
666 pMethodId = dexGetMethodId(pDexFile, methodIdx);
667 pMethInfo->name = dexStringById(pDexFile, pMethodId->nameIdx);
668 pMethInfo->signature = dexCopyDescriptorFromMethodId(pDexFile, pMethodId);
671 dexStringByTypeIdx(pDexFile, pMethodId->classIdx);
678 bool getFieldInfo(DexFile* pDexFile, u4 fieldIdx, FieldMethodInfo* pFieldInfo)
682 if (fieldIdx >= pDexFile->pHeader->fieldIdsSize)
685 pFieldId = dexGetFieldId(pDexFile, fieldIdx);
686 pFieldInfo->name = dexStringById(pDexFile, pFieldId->nameIdx);
687 pFieldInfo->signature = dexStringByTypeIdx(pDexFile, pFieldId->typeIdx);
689 dexStringByTypeIdx(pDexFile, pFieldId->classIdx);
697 const char* getClassDescriptor(DexFile* pDexFile, u4 classIdx)
699 return dexStringByTypeIdx(pDexFile, classIdx);
711 static char* indexString(DexFile* pDexFile,
770 if (index < pDexFile->pHeader->typeIdsSize) {
772 getClassDescriptor(pDexFile, index), width, index);
778 if (index < pDexFile->pHeader->stringIdsSize) {
780 dexStringById(pDexFile, index), width, index);
789 if (getMethodInfo(pDexFile, index, &methInfo)) {
803 if (getFieldInfo(pDexFile, index, &fieldInfo)) {
840 return indexString(pDexFile, pDecInsn, buf, outSize);
849 void dumpInstruction(DexFile* pDexFile, const DexCode* pCode, int insnIdx,
857 printf("%06x:", ((u1*)insns - pDexFile->baseAddr) + insnIdx*2);
891 indexBuf = indexString(pDexFile, pDecInsn,
1057 void dumpBytecodes(DexFile* pDexFile, const DexMethod* pDexMethod)
1059 const DexCode* pCode = dexGetCode(pDexFile, pDexMethod);
1069 getMethodInfo(pDexFile, pDexMethod->methodIdx, &methInfo);
1070 startAddr = ((u1*)pCode - pDexFile->baseAddr);
1114 dumpInstruction(pDexFile, pCode, insnIdx, insnWidth, &decInsn);
1126 void dumpCode(DexFile* pDexFile, const DexMethod* pDexMethod)
1128 const DexCode* pCode = dexGetCode(pDexFile, pDexMethod);
1136 dumpBytecodes(pDexFile, pDexMethod);
1138 dumpCatches(pDexFile, pCode);
1140 dumpPositions(pDexFile, pCode, pDexMethod);
1141 dumpLocals(pDexFile, pCode, pDexMethod);
1147 void dumpMethod(DexFile* pDexFile, const DexMethod* pDexMethod, int i)
1161 pMethodId = dexGetMethodId(pDexFile, pDexMethod->methodIdx);
1162 name = dexStringById(pDexFile, pMethodId->nameIdx);
1163 typeDescriptor = dexCopyDescriptorFromMethodId(pDexFile, pMethodId);
1165 backDescriptor = dexStringByTypeIdx(pDexFile, pMethodId->classIdx);
1181 dumpCode(pDexFile, pDexMethod);
1290 void dumpSField(const DexFile* pDexFile, const DexField* pSField, int i)
1304 pFieldId = dexGetFieldId(pDexFile, pSField->fieldIdx);
1305 name = dexStringById(pDexFile, pFieldId->nameIdx);
1306 typeDescriptor = dexStringByTypeIdx(pDexFile, pFieldId->typeIdx);
1307 backDescriptor = dexStringByTypeIdx(pDexFile, pFieldId->classIdx);
1347 void dumpIField(const DexFile* pDexFile, const DexField* pIField, int i)
1349 dumpSField(pDexFile, pIField, i);
1360 void dumpClass(DexFile* pDexFile, int idx, char** pLastPackage)
1372 pClassDef = dexGetClassDef(pDexFile, idx);
1380 pEncodedData = dexGetClassData(pDexFile, pClassDef);
1388 classDescriptor = dexStringByTypeIdx(pDexFile, pClassDef->classIdx);
1441 dexStringByTypeIdx(pDexFile, pClassDef->superclassIdx);
1477 pInterfaces = dexGetInterfacesList(pDexFile, pClassDef);
1480 dumpInterface(pDexFile, dexGetTypeItem(pInterfaces, i), i);
1486 dumpSField(pDexFile, &pClassData->staticFields[i], i);
1492 dumpIField(pDexFile, &pClassData->instanceFields[i], i);
1498 dumpMethod(pDexFile, &pClassData->directMethods[i], i);
1504 dumpMethod(pDexFile, &pClassData->virtualMethods[i], i);
1510 fileName = dexStringById(pDexFile, pClassDef->sourceFileIdx);
1583 void dumpMethodMap(DexFile* pDexFile, const DexMethod* pDexMethod, int idx,
1589 int offset = data - (u1*) pDexFile->pOptHeader;
1591 pMethodId = dexGetMethodId(pDexFile, pDexMethod->methodIdx);
1592 name = dexStringById(pDexFile, pMethodId->nameIdx);
1652 void dumpRegisterMaps(DexFile* pDexFile)
1654 const u1* pClassPool = (const u1*)pDexFile->pRegisterMapPool;
1658 int baseFileOffset = (u1*) pClassPool - (u1*) pDexFile->pOptHeader;
1677 pClassDef = dexGetClassDef(pDexFile, idx);
1678 classDescriptor = dexStringByTypeIdx(pDexFile, pClassDef->classIdx);
1696 pEncodedData = dexGetClassData(pDexFile, pClassDef);
1718 dumpMethodMap(pDexFile, &pClassData->directMethods[i], i, &data);
1724 dumpMethodMap(pDexFile, &pClassData->virtualMethods[i], i, &data);
1734 void processDexFile(const char* fileName, DexFile* pDexFile)
1741 pDexFile->pHeader->magic +4);
1745 dumpRegisterMaps(pDexFile);
1750 dumpFileHeader(pDexFile);
1751 dumpOptDirectory(pDexFile);
1757 for (i = 0; i < (int) pDexFile->pHeader->classDefsSize; i++) {
1759 dumpClassDef(pDexFile, i);
1761 dumpClass(pDexFile, i, &package);
1780 DexFile* pDexFile = NULL;
1797 pDexFile = dexFileParse((u1*)map.addr, map.length, flags);
1798 if (pDexFile == NULL) {
1806 processDexFile(fileName, pDexFile);
1814 if (pDexFile != NULL)
1815 dexFileFree(pDexFile);