arminject icon indicating copy to clipboard operation
arminject copied to clipboard

problem with running make test

Open lemon57 opened this issue 5 years ago • 8 comments

I installed adb and sdk\ndk and added path to ndk-build to ./zshrc but whatever I have the problem:

Android NDK: WARNING: APP_STL stlport_shared is deprecated and will be removed in the next release. Please switch to either c++_static or c++_shared. See https://developer.android.com/ndk/guides/cpp-support.html for more information. make[1]: Entering directory `/Users/plrs/code/arminject' [armeabi-v7a] Compile++ thumb: hook <= main.cpp [armeabi-v7a] Compile++ thumb: hook <= hook.cpp

jni/libhook/hook.cpp:101:5: error: no matching function for call to 'mprotect' mprotect(aligned_pointer, pagesize, PROT_WRITE | PROT_READ); ^~~~~~~~ /Users/plrs/Library/android/sdk/ndk-bundle/sysroot/usr/include/sys/mman.h:77:5: note: candidate function not viable: 1st argument ('const void *') would lose const qualifier

int mprotect(void* __addr, size_t __size, int __prot); ^ jni/libhook/hook.cpp:106:5: error: no matching function for call to 'mprotect' mprotect(aligned_pointer, pagesize, PROT_READ); ^~~~~~~~ /Users/plrs/Library/android/sdk/ndk-bundle/sysroot/usr/include/sys/mman.h:77:5: note: candidate function not viable: 1st argument ('const void *') would lose const qualifier

int mprotect(void* __addr, size_t __size, int __prot); ^ 2 errors generated.

make[1]: *** [obj/local/armeabi-v7a/objs/hook/hook.o] Error 1 make[1]: Leaving directory `/Users/plrs/code/arminject' make: *** [all] Error 2

What does it mean? What is the problem?

lemon57 avatar Aug 05 '18 10:08 lemon57

Same Problem I'm Gonna Look Into It And See What I Can Find.

DaveZb-X0F avatar Aug 30 '18 19:08 DaveZb-X0F

Ok, thank you

lemon57 avatar Aug 30 '18 20:08 lemon57

Sorry, I do not speak english well. I have the same problem as the author. Who did not understand the problem?

Valew17 avatar Sep 04 '18 08:09 Valew17

same problem here

delmotte avatar Sep 19 '18 14:09 delmotte

remove const qualifier from aligned_pointer definition:

const void *aligned_pointer = (const void*)(addr & ~(pagesize - 1)); 

to

void *aligned_pointer = (void*)(addr & ~(pagesize - 1));

sergk79 avatar Oct 03 '18 17:10 sergk79

remove const qualifier from aligned_pointer definition: const void aligned_pointer = (const void)(addr & ~(pagesize - 1)); to void aligned_pointer = (void)(addr & ~(pagesize - 1));

It works for me, thanks

fabricezhang avatar Dec 10 '18 09:12 fabricezhang

I have the same issue I try @sergk79 solution and now I got this error

make[1]: Entering directory /home/ahmed/Desktop/arminject-master' [armeabi-v7a] Compile++ thumb: hook <= main.cpp [armeabi-v7a] Compile++ thumb: hook <= hook.cpp jni/libhook/hook.cpp:99:10: error: variable has incomplete type 'void' void aligned_pointer = (void)(addr & ~(pagesize - 1)); ^ 1 error generated. make[1]: *** [obj/local/armeabi-v7a/objs/hook/hook.o] Error 1 make[1]: Leaving directory /home/ahmed/Desktop/arminject-master' Makefile:2: recipe for target 'all' failed make: *** [all] Error 2

can someone guide me for a solution !!!

8lbiasian avatar Jan 23 '19 19:01 8lbiasian

@8lbiasian it looks like github dropped all the asterisks from the code snippet I've posted earlier, the proper change should look like this: void *aligned_pointer = (void*)(addr & ~(pagesize - 1));

sergk79 avatar Jan 23 '19 21:01 sergk79