unidbg
unidbg copied to clipboard
pthread_join Pointer 对象为空
` IWhale whale = Whale.getInstance(emulator); Symbol free = emulator.getMemory().findModule("libc.so").findSymbolByName("pthread_join"); final AtomicLong value_ptr = new AtomicLong();
whale.inlineHookFunction(free, new ReplaceCallback() {
@Override
public HookStatus onCall(Emulator<?> emulator, long originFunction) {
Pointer ptr = emulator.getContext().getPointerArg(1);
if (ptr != null) {
if (emulator.is64Bit()) {
ptr.setLong(0, value_ptr.get());
} else {
ptr.setInt(0, (int) value_ptr.get());
}
} else {
System.out.println("pthread_join ptr is null");
}
return HookStatus.LR(emulator, 0);
}
});
`