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

pthread_join Pointer 对象为空 #655

Open
q601180252 opened this issue Aug 7, 2024 · 0 comments
Open

pthread_join Pointer 对象为空 #655

q601180252 opened this issue Aug 7, 2024 · 0 comments

Comments

@q601180252
Copy link

q601180252 commented Aug 7, 2024

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

`

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

1 participant