Closed Xset-s closed 6 years ago
try the latest commit, or like this ZzHook((void *)send, (void *)fake_send, (void **)&orig_send, common_pre_call, common_post_call, true);
, use the true
as the last arg. (ps: have a look with the demo project)
It crashes when lib loads
Hm. No, it crashes after post-call 🤔
emmm, i just test ok :(
android sdk version ?
android-19
emmm, sorry, it's 4.am now, i need sleep, and test again on morning. use the HookZz/demo/.zip
?
Ok :) No, i use my own library and another apk. But it used to work
i test armv7 again, none crash case. 🤔
My build log:
C:\Users\Xset\Desktop\ElfHook\HookZz>ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk APP_ABI=armeabi-v7a APP_PLATFORM=android-19
Android NDK: WARNING:Android.mk:hookzz: LOCAL_LDLIBS is always ignored for static libraries
[armeabi-v7a] Compile thumb : hookzz <= allocator.c
[armeabi-v7a] Compile thumb : hookzz <= interceptor.c
[armeabi-v7a] Compile thumb : hookzz <= memory.c
[armeabi-v7a] Compile thumb : hookzz <= stack.c
[armeabi-v7a] Compile thumb : hookzz <= tools.c
[armeabi-v7a] Compile thumb : hookzz <= trampoline.c
[armeabi-v7a] Compile thumb : hookzz <= interceptor-linux.c
[armeabi-v7a] Compile thumb : hookzz <= memory-linux.c
[armeabi-v7a] Compile thumb : hookzz <= thread-posix.c
[armeabi-v7a] Compile thumb : hookzz <= instructions.c
[armeabi-v7a] Compile thumb : hookzz <= reader-arm.c
[armeabi-v7a] Compile thumb : hookzz <= reader-thumb.c
[armeabi-v7a] Compile thumb : hookzz <= regs-arm.c
[armeabi-v7a] Compile thumb : hookzz <= relocator-arm.c
././src/platforms/arch-arm/relocator-arm.c:48:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
1 warning generated.
[armeabi-v7a] Compile thumb : hookzz <= relocator-thumb.c
././src/platforms/arch-arm/relocator-thumb.c:120:16: warning: incompatible integer to pointer conversion initializing
'zz_addr_t *' (aka 'unsigned long *') with an expression of type 'zz_addr_t' (aka 'unsigned long'); take the
address with & [-Wint-conversion]
zz_addr_t *temp_address = insn_ctx->address;
^ ~~~~~~~~~~~~~~~~~
&
1 warning generated.
[armeabi-v7a] Compile thumb : hookzz <= writer-arm.c
[armeabi-v7a] Compile thumb : hookzz <= writer-thumb.c
[armeabi-v7a] Compile thumb : hookzz <= backend-arm-helper.c
[armeabi-v7a] Compile thumb : hookzz <= interceptor-arm.c
././src/platforms/backend-arm/interceptor-arm.c:19:52: warning: incompatible pointer to integer conversion passing
'void *' to parameter of type 'zz_addr_t' (aka 'unsigned long') [-Wint-conversion]
zz_arm_writer_init(&backend->arm_writer, NULL, NULL);
^~~~
C:\Users\Xset\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\5.0.300080\include\stddef.h:105:16: note:
expanded from macro 'NULL'
# define NULL ((void*)0)
^~~~~~~~~~
./src\platforms/arch-arm/writer-arm.h:30:82: note: passing argument to parameter 'target_ptr' here
void zz_arm_writer_init(ZzARMAssemblerWriter *self, zz_ptr_t data_ptr, zz_addr_t target_ptr);
^
././src/platforms/backend-arm/interceptor-arm.c:23:56: warning: incompatible pointer to integer conversion passing
'void *' to parameter of type 'zz_addr_t' (aka 'unsigned long') [-Wint-conversion]
zz_thumb_writer_init(&backend->thumb_writer, NULL, NULL);
^~~~
C:\Users\Xset\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\5.0.300080\include\stddef.h:105:16: note:
expanded from macro 'NULL'
# define NULL ((void*)0)
^~~~~~~~~~
./src\platforms/arch-arm/writer-thumb.h:31:86: note: passing argument to parameter 'target_ptr' here
void zz_thumb_writer_init(ZzThumbAssemblerWriter *self, zz_ptr_t data_ptr, zz_addr_t target_ptr);
^
././src/platforms/backend-arm/interceptor-arm.c:145:67: warning: incompatible pointer to integer conversion passing
'char [256]' to parameter of type 'zz_addr_t' (aka 'unsigned long') [-Wint-conversion]
zz_thumb_writer_reset(thumb_writer, temp_code_slice_data, temp_code_slice_data);
^~~~~~~~~~~~~~~~~~~~
./src\platforms/arch-arm/writer-thumb.h:33:87: note: passing argument to parameter 'target_ptr' here
void zz_thumb_writer_reset(ZzThumbAssemblerWriter *self, zz_ptr_t data_ptr, zz_addr_t target_ptr);
^
3 warnings generated.
[armeabi-v7a] Compile thumb : hookzz <= thunker-arm.c
[armeabi-v7a] Compile thumb : hookzz <= common_memory_kit.c
[armeabi-v7a] Compile thumb : hookzz <= linux_memory_kit.c
[armeabi-v7a] Compile thumb : hookzz <= posix_memory_kit.c
[armeabi-v7a] Compile thumb : hookzz <= posix_thread_kit.c
[armeabi-v7a] StaticLibrary : libhookzz.a
fixed
Code:
Error: