asLody / SandHook

Android ART Hook/Native Inline Hook/Single Instruction Hook - support 4.4 - 11.0 32/64 bit - Xposed API Compat
Other
2.03k stars 443 forks source link

arm32 hook crash in Vivo X6A android 5.0.2 #88

Open WindySha opened 2 years ago

WindySha commented 2 years ago

2021-09-10 01:01:28.382 11566-11566/? I/DEBUG: pid: 6915, tid: 6915, name: com.lemon.lv >>> com.lemon.lv <<< 2021-09-10 01:01:28.402 11566-11566/? I/DEBUG: #01 pc 00036605 /data/app/com.lemon.lv-1/lib/arm/libsandhook.so (_ZN8SandHook7Decoder12Arm32Decoder11DisassembleEPvjRNS0_11InstVisitorEb+640) 2021-09-10 01:01:28.402 11566-11566/? I/DEBUG: #02 pc 0003738f /data/app/com.lemon.lv-1/lib/arm/libsandhook.so (ZN8SandHook3Asm15CodeRelocateA328RelocateEPvjS2+80) 2021-09-10 01:01:28.402 11566-11566/? I/DEBUG: #03 pc 000367f1 /data/app/com.lemon.lv-1/lib/arm/libsandhook.so (ZN8SandHook4Hook22InlineHookArm32Android4HookEPvS2+240) 2021-09-10 01:01:28.402 11566-11566/? I/DEBUG: #04 pc 00030be7 /data/app/com.lemon.lv-1/lib/arm/libsandhook.so (hookClassInit+206) 2021-09-10 01:01:28.402 11566-11566/? I/DEBUG: #05 pc 0002ede1 /data/app/com.lemon.lv-1/lib/arm/libsandhook.so (Java_com_swift_sandhook_SandHook_initForPendingHook+64) 2021-09-10 01:01:28.402 11566-11566/? I/DEBUG: #06 pc 00810ad1 /data/dalvik-cache/arm/data@app@com.lemon.lv-1@base.apk@classes.dex

jubupx commented 2 years ago

bool Visit(BaseUnit unit, void pc) override { ...................................... delete unit;<=== 这里在一些特殊处理指令的情况下 return false; }; ----> if (!visitor.Visit(unit, pc)) { break; }

    pc = reinterpret_cast<InstA64 *>((Addr)pc + unit->Size());<===这里调用

========try to fix ================ reinterpret_cast<BaseInst>(unit)->Disassemble(); unit->Ref(); if (!visitor.Visit(unit, pc)) { break; } pc = reinterpret_cast<void>((Addr)pc + unit->Size()); unit->Release(); if(unit->RefCount() == 0) delete unit;

看看这样能不能解决问题, 祝好运!