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

arm32 hook crash in Vivo X6A android 5.0.2 #88

Open
WindySha opened this issue Sep 9, 2021 · 1 comment
Open

arm32 hook crash in Vivo X6A android 5.0.2 #88

WindySha opened this issue Sep 9, 2021 · 1 comment

Comments

@WindySha
Copy link

WindySha commented Sep 9, 2021

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: #1 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: #2 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: #3 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: #4 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: #5 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: #6 pc 00810ad1 /data/dalvik-cache/arm/data@[email protected]@[email protected]

@jubupx
Copy link

jubupx commented Sep 23, 2021

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;

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

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