Lines Matching refs:pDexFile

105 const char* dexStringAndSizeById(const DexFile* pDexFile, u4 idx,  in dexStringAndSizeById()  argument
107 const DexStringId* pStringId = dexGetStringId(pDexFile, idx); in dexStringAndSizeById()
108 const u1* ptr = pDexFile->baseAddr + pStringId->stringDataOff; in dexStringAndSizeById()
177 static void classLookupAdd(DexFile* pDexFile, DexClassLookup* pLookup, in classLookupAdd() argument
181 (const char*) (pDexFile->baseAddr + stringOff); in classLookupAdd()
183 (const DexClassDef*) (pDexFile->baseAddr + classDefOff); in classLookupAdd()
211 DexClassLookup* dexCreateClassLookup(DexFile* pDexFile) in dexCreateClassLookup() argument
220 assert(pDexFile != NULL); in dexCreateClassLookup()
229 numEntries = dexRoundUpPower2(pDexFile->pHeader->classDefsSize * 2); in dexCreateClassLookup()
239 for (i = 0; i < (int)pDexFile->pHeader->classDefsSize; i++) { in dexCreateClassLookup()
243 pClassDef = dexGetClassDef(pDexFile, i); in dexCreateClassLookup()
244 pString = dexStringByTypeIdx(pDexFile, pClassDef->classIdx); in dexCreateClassLookup()
246 classLookupAdd(pDexFile, pLookup, in dexCreateClassLookup()
247 (u1*)pString - pDexFile->baseAddr, in dexCreateClassLookup()
248 (u1*)pClassDef - pDexFile->baseAddr, &numProbes); in dexCreateClassLookup()
257 pDexFile->pHeader->classDefsSize, numEntries, in dexCreateClassLookup()
258 (100 * pDexFile->pHeader->classDefsSize) / numEntries, in dexCreateClassLookup()
269 void dexFileSetupBasicPointers(DexFile* pDexFile, const u1* data) { in dexFileSetupBasicPointers() argument
272 pDexFile->baseAddr = data; in dexFileSetupBasicPointers()
273 pDexFile->pHeader = pHeader; in dexFileSetupBasicPointers()
274 pDexFile->pStringIds = (const DexStringId*) (data + pHeader->stringIdsOff); in dexFileSetupBasicPointers()
275 pDexFile->pTypeIds = (const DexTypeId*) (data + pHeader->typeIdsOff); in dexFileSetupBasicPointers()
276 pDexFile->pFieldIds = (const DexFieldId*) (data + pHeader->fieldIdsOff); in dexFileSetupBasicPointers()
277 pDexFile->pMethodIds = (const DexMethodId*) (data + pHeader->methodIdsOff); in dexFileSetupBasicPointers()
278 pDexFile->pProtoIds = (const DexProtoId*) (data + pHeader->protoIdsOff); in dexFileSetupBasicPointers()
279 pDexFile->pClassDefs = (const DexClassDef*) (data + pHeader->classDefsOff); in dexFileSetupBasicPointers()
280 pDexFile->pLinkData = (const DexLink*) (data + pHeader->linkOff); in dexFileSetupBasicPointers()
291 DexFile* pDexFile = NULL; in dexFileParse() local
301 pDexFile = (DexFile*) malloc(sizeof(DexFile)); in dexFileParse()
302 if (pDexFile == NULL) in dexFileParse()
304 memset(pDexFile, 0, sizeof(DexFile)); in dexFileParse()
317 pDexFile->pOptHeader = (const DexOptHeader*) data; in dexFileParse()
319 pDexFile->pOptHeader->dexOffset, pDexFile->pOptHeader->flags); in dexFileParse()
322 if (!dexParseOptData(data, length, pDexFile)) in dexFileParse()
326 data += pDexFile->pOptHeader->dexOffset; in dexFileParse()
327 length -= pDexFile->pOptHeader->dexOffset; in dexFileParse()
328 if (pDexFile->pOptHeader->dexLength > length) { in dexFileParse()
330 pDexFile->pOptHeader->dexLength, (int) length); in dexFileParse()
333 length = pDexFile->pOptHeader->dexLength; in dexFileParse()
336 dexFileSetupBasicPointers(pDexFile, data); in dexFileParse()
337 pHeader = pDexFile->pHeader; in dexFileParse()
359 const DexOptHeader* pOptHeader = pDexFile->pOptHeader; in dexFileParse()
416 if (result != 0 && pDexFile != NULL) { in dexFileParse()
417 dexFileFree(pDexFile); in dexFileParse()
418 pDexFile = NULL; in dexFileParse()
420 return pDexFile; in dexFileParse()
428 void dexFileFree(DexFile* pDexFile) in dexFileFree() argument
430 if (pDexFile == NULL) in dexFileFree()
433 free(pDexFile); in dexFileFree()
441 const DexClassDef* dexFindClass(const DexFile* pDexFile, in dexFindClass() argument
444 const DexClassLookup* pLookup = pDexFile->pClassLookup; in dexFindClass()
465 str = (const char*) (pDexFile->baseAddr + offset); in dexFindClass()
468 (pDexFile->baseAddr + pLookup->table[idx].classDefOffset); in dexFindClass()