Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

测试dy遇到的情况 #31

Closed
JiangJianCong opened this issue Jul 17, 2019 · 4 comments
Closed

测试dy遇到的情况 #31

JiangJianCong opened this issue Jul 17, 2019 · 4 comments

Comments

@JiangJianCong
Copy link

你好,在测试dy的时候又遇到一个问题,下面是一些错误日志和截图,请问这是什么情况?

>-----------------------------------------------------------------------------<
[11:19:19 654]GetByteArrayRegion array=ByteArray{value=[B@153f5a29}, start=0, length=17, buf=unicorn@0x402cd030, md5=1b5de627b4a25553baf1f72af9afb96d, hex=31313a32323a33333a34343a35353a3636
size: 17
0000: 31 31 3A 32 32 3A 33 33 3A 34 34 3A 35 35 3A 36    11:22:33:44:55:6
0010: 36                                                 6
^-----------------------------------------------------------------------------^
[11:19:19 655] DEBUG [cn.banny.unidbg.linux.android.dvm.DalvikVM] (DalvikVM$9:143) - DeleteLocalRef object=unicorn@0xfffe0920
[11:19:19 656] DEBUG [cn.banny.unidbg.linux.android.dvm.DalvikVM] (DalvikVM$9:143) - DeleteLocalRef object=unicorn@0xfffe0920
[11:19:19 656] DEBUG [cn.banny.unidbg.linux.android.dvm.DalvikVM] (DalvikVM$9:143) - DeleteLocalRef object=unicorn@0xfffe0920
[11:19:19 656] DEBUG [cn.banny.unidbg.linux.android.dvm.DalvikVM] (DalvikVM$9:143) - DeleteLocalRef object=unicorn@0xfffe0920
>>> r0=0x1200011 r1=0x0 r2=0x0, r3=0x0 r4=0xbffffc08 r5=0x4fbb09ad r6=0x9bd8bb44 r7=0x78 r9=0xac98b1ca r10=0xbfffeec8 fp=0x1bba0160 ip=0xbfffec90 sp=0xbfffec80 lr=0x401092b5 pc=0x401075ec cpsr: N=0, Z=0, C=1, V=0, T=0, mode=0b10000
[11:19:19 659]  WARN [cn.banny.unidbg.linux.ARMSyscallHandler] (ARMSyscallHandler:377) - handleInterrupt intno=2, NR=120, svcNumber=0x0, PC=unicorn@0x401075ec[libc.so]0x175ec, syscall=null
java.lang.NullPointerException
	at cn.banny.unidbg.linux.ARMSyscallHandler.hook(ARMSyscallHandler.java:201)
	at unicorn.Unicorn.invokeInterruptCallbacks(Unicorn.java:123)
	at unicorn.Unicorn.emu_start(Native Method)
	at cn.banny.unidbg.AbstractEmulator.emulate(AbstractEmulator.java:267)
	at cn.banny.unidbg.AbstractEmulator.eFunc(AbstractEmulator.java:360)
	at cn.banny.unidbg.arm.AbstractARMEmulator.eFunc(AbstractARMEmulator.java:201)
	at cn.banny.unidbg.linux.LinuxModule.emulateFunction(LinuxModule.java:154)
	at cn.banny.unidbg.linux.android.dvm.DvmClass.callStaticJniMethod(DvmClass.java:140)

image

@zhkl0228
Copy link
Owner

加一个child_stack判断null再试下

@JiangJianCong
Copy link
Author

JiangJianCong commented Jul 17, 2019

加一个child_stack判断null再试下

试了下 就到这里报错了 还是child_stack为null

修改代码:

case 120:
                    Pointer child_stack = UnicornPointer.register(emulator, ArmConst.UC_ARM_REG_R1);
                    int fn = ((Number) u.reg_read(ArmConst.UC_ARM_REG_R5)).intValue();
                    int arg = ((Number) u.reg_read(ArmConst.UC_ARM_REG_R6)).intValue();
                    if (child_stack!=null && child_stack.getInt(-4) == fn && child_stack.getInt(-8) == arg) {
                        u.reg_write(ArmConst.UC_ARM_REG_R0, bionic_clone(u, emulator));
                    } else {
                        u.reg_write(ArmConst.UC_ARM_REG_R0, pthread_clone(u, emulator));
                    }
                    return;

[12:46:44 312]  WARN [cn.banny.unidbg.linux.ARMSyscallHandler] (ARMSyscallHandler:377) - handleInterrupt intno=2, NR=120, svcNumber=0x0, PC=unicorn@0x401075ec[libc.so]0x175ec, syscall=null
java.lang.NullPointerException
	at cn.banny.unidbg.linux.ARMSyscallHandler.pthread_clone(ARMSyscallHandler.java:624)
	at cn.banny.unidbg.linux.ARMSyscallHandler.hook(ARMSyscallHandler.java:204)
	at unicorn.Unicorn.invokeInterruptCallbacks(Unicorn.java:123)
	at unicorn.Unicorn.emu_start(Native Method)
	at cn.banny.unidbg.AbstractEmulator.emulate(AbstractEmulator.java:267)
	at cn.banny.unidbg.AbstractEmulator.eFunc(AbstractEmulator.java:360)
	at cn.banny.unidbg.arm.AbstractARMEmulator.eFunc(AbstractARMEmulator.java:201)
	at cn.banny.unidbg.linux.LinuxModule.emulateFunction(LinuxModule.java:154)
	at cn.banny.unidbg.linux.android.dvm.DvmClass.callStaticJniMethod(DvmClass.java:140)

image

@zhkl0228
Copy link
Owner

这个系统调用注释掉没关系

@JiangJianCong
Copy link
Author

这个系统调用注释掉没关系

哦哦 好,注释掉好像可以继续运行。谢谢了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants