想搞个在各系统通用的DexHunter,通过修改core.jar loadClassBinaryName注入我的程序
public Class loadClassBinaryName(String paramString, ClassLoader paramClassLoader)
{
defineClasss(paramString, paramClassLoader, this.mCookie);
return defineClass(paramString, paramClassLoader, this.mCookie);
}
但是当运行到
bool need_extra=false;
ClassObject * clazz=NULL;
const u1* data=NULL;
DexClassData* pData = NULL;
bool pass=false;
const DexClassDef *pClassDef = dexGetClassDef(pDvmDex->pDexFile, i);
const char *descriptor = dexGetClassDescriptor(pDvmDex->pDexFile,pClassDef);
ALOGI("--- dumpclass classIdx my %s",descriptor);
if(!strncmp(header,descriptor,8)||!pClassDef->classDataOff)
{
pass=true;
goto classdef;
}
clazz =(ClassObject *) mydvmDefineClass(pDvmDex,descriptor,loader);
ALOGI("--- ifieldCount %d",clazz); 程序出错
这里dvmDefineClass是通过
mydvmDefineClass=(void * (*)(DvmDex *,char const*,Object *)) dlsym(lib, "_Z14dvmDefineClassP6DvmDexPKcP6Object");
获得的 求大神指点下到底哪出错了
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!