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

crashes (armv7) #23

Closed
Xset-s opened this issue Feb 10, 2018 · 10 comments
Closed

crashes (armv7) #23

Xset-s opened this issue Feb 10, 2018 · 10 comments

Comments

@Xset-s
Copy link

Xset-s commented Feb 10, 2018

Code:
default

Error:
default

@jmpews
Copy link
Owner

jmpews commented Feb 10, 2018

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)

@Xset-s
Copy link
Author

Xset-s commented Feb 10, 2018

default

default

It crashes when lib loads
default

@Xset-s
Copy link
Author

Xset-s commented Feb 10, 2018

Hm. No, it crashes after post-call 🤔

default

@jmpews
Copy link
Owner

jmpews commented Feb 10, 2018

emmm, i just test ok :(

android sdk version ?

@Xset-s
Copy link
Author

Xset-s commented Feb 10, 2018

android-19

@jmpews
Copy link
Owner

jmpews commented Feb 10, 2018

emmm, sorry, it's 4.am now, i need sleep, and test again on morning. use the HookZz/demo/.zip ?

@Xset-s
Copy link
Author

Xset-s commented Feb 10, 2018

Ok :)
No, i use my own library and another apk. But it used to work

@jmpews
Copy link
Owner

jmpews commented Feb 11, 2018

i test armv7 again, none crash case. 🤔

@Xset-s
Copy link
Author

Xset-s commented Feb 11, 2018

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

@jmpews
Copy link
Owner

jmpews commented Feb 13, 2018

fixed

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

2 participants