想搞个在各系统通用的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");
获得的 求大神指点下到底哪出错了
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课