zhkl0228 / unidbg

Allows you to emulate an Android native library, and an experimental iOS emulation
Apache License 2.0
3.88k stars 966 forks source link

unidbg更新前的没问题,最近版更新unidbg后会包java.lang.NullPointerException #376

Open rookiexjl opened 3 years ago

rookiexjl commented 3 years ago

[13:51:37 129] WARN [com.github.unidbg.linux.ARM32SyscallHandler] (ARM32SyscallHandler:469) - handleInterrupt intno=2, NR=-1073744456, svcNumber=0x11e, PC=unidbg@0xfffe0274, LR=RX@0x40001bad[libnative-lib.so]0x1bad, syscall=null java.lang.NullPointerException at com.github.unidbg.linux.android.dvm.AbstractJni.callObjectMethod(AbstractJni.java:783) at com.github.unidbg.linux.android.dvm.AbstractJni.callObjectMethod(AbstractJni.java:747)

rookiexjl commented 3 years ago

这是 正常的这段 JNIEnv->CallObjectMethod(android.content.pm.PackageManager@17f7cd29, getPackageInfo("xxxxxxxxx", 0x40) => android.content.pm.PackageInfo@346d61be) was called from RX@0x40001bad[libnative-lib.so]0x1bad [0x40000000][libnative-lib.so][0x01bb7] [0x40000000][libnative-lib.so][0x03b63] _x3x_y2y1 + 0x22

zhkl0228 commented 3 years ago

有样本吗?

rookiexjl commented 3 years ago

有 lilac的博客 小黑盒 https://blog.csdn.net/qq_38851536/article/details/118115569?spm=1001.2014.3001.5501

rookiexjl commented 3 years ago
 case "android/content/pm/PackageManager->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;": {
            StringObject packageName = varArg.getObjectArg(0);//varArg.getObjectArg(0); ##这里开始为null
            int flags = varArg.getIntArg(1);
            if (log.isDebugEnabled()) {
                log.debug("getPackageInfo packageName=" +packageName.getValue()+ ", flags=0x" + Integer.toHexString(flags));
            }
            return new PackageInfo(vm, packageName.value, flags);
        } 
zhkl0228 commented 3 years ago

用仓库master最新版可以正常执行

rookiexjl commented 3 years ago

感谢