unidbg icon indicating copy to clipboard operation
unidbg copied to clipboard

pthread_join Pointer 对象为空

Open q601180252 opened this issue 6 months ago • 0 comments

` 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);
        }
    });

`

q601180252 avatar Aug 07 '24 11:08 q601180252