Closed yhs0602 closed 4 years ago
When I copy the .so file to internal storage(/data/data/com.kyhsgeekcode.disassembler/files/tmp.so) I get this error with the above (modified)code. 12-25 19:38:56.450 E/Disassembler(954): plthook_open error: create_link_map_fname error
@KYHSGeekCode Sorry for my too late reply. I had not used plthook in android. Now I have learned how to run tests in android emulators and have some experience about Android NDK.
The RTLD_NOLOAD
option is by design. Plthook changes PLT entries in the current process. The file to be hooked must be loaded.
If you need to hook function calls in a not-loaded library, use the latest code of plthook and pass the return value of dlopen()
to plthook_open_by_handle()
. The internal logic of plthook for macOS was changed by this commit.
I really thank you for this library! However,
I got this error using this code:
So I tried modifying to
Then I get this error:
12-25 19:36:12.580 E/linker (954): library "/storage/emulated/0/adaTest/libhello-jni.so" ("/storage/emulated/0/adaTest/libhello-jni.so") needed or dlopened by "/data/app/com.kyhsgeekcode.disassembler-2/lib/arm/libhello-jni.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/com.kyhsgeekcode.disassembler-2/lib/arm:/data/app/com.kyhsgeekcode.disassembler-2/base.apk!/lib/armeabi-v7a", permitted_paths="/data:/mnt/expand:/data/data/com.kyhsgeekcode.disassembler"] 12-25 19:36:12.580 E/Disassembler(954): plthook_open error: dlopen error: dlopen failed: library "/storage/emulated/0/adaTest/libhello-jni.so" needed or dlopened by "/data/app/com.kyhsgeekcode.disassembler-2/lib/arm/libhello-jni.so" is not accessible for the namespace "classloader-namespace"
Do you know how to use it well on android?