We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
xh_core.c中未引入stdio.h导致编译时产生如下错误: jni/xh_core.c:140:5: error: use of undeclared identifier 'FILE' FILE *fp;
xh_elf.h中一些宏重复定义或者没有定义:
jni/xh_elf.c:61:9: error: 'ELF_R_SYM' macro redefined [-Werror,-Wmacro-redefined] #define ELF_R_SYM(info) ELF32_R_SYM(info) ^ /Users/killer/AndTool/ndk/platforms/android-14/arch-arm/usr/include/sys/exec_elf.h:559:9: note: previous definition is here #define ELF_R_SYM ELF32_R_SYM ^ jni/xh_elf.c:62:9: error: 'ELF_R_TYPE' macro redefined [-Werror,-Wmacro-redefined] #define ELF_R_TYPE(info) ELF32_R_TYPE(info) ^ /Users/killer/AndTool/ndk/platforms/android-14/arch-arm/usr/include/sys/exec_elf.h:560:9: note: previous definition is here #define ELF_R_TYPE ELF32_R_TYPE ^ jni/xh_elf.c:906:14: error: use of undeclared identifier 'DT_ANDROID_REL' case DT_ANDROID_REL: ^ jni/xh_elf.c:907:14: error: use of undeclared identifier 'DT_ANDROID_RELA' case DT_ANDROID_RELA: ^ jni/xh_elf.c:913:14: error: use of undeclared identifier 'DT_ANDROID_RELSZ' case DT_ANDROID_RELSZ: ^ jni/xh_elf.c:914:14: error: use of undeclared identifier 'DT_ANDROID_RELASZ' case DT_ANDROID_RELASZ: ^ jni/xh_elf.c:927:14: error: use of undeclared identifier 'DT_GNU_HASH' case DT_GNU_HASH: ^ jni/xh_elf.c:1026:28: error: use of undeclared identifier 'R_ARM_JUMP_SLOT' if(is_plt && r_type != R_GENERIC_JUMP_SLOT) return 0; ^ jni/xh_elf.c:48:29: note: expanded from macro 'R_GENERIC_JUMP_SLOT' #define R_GENERIC_JUMP_SLOT R_ARM_JUMP_SLOT //.rel.plt ^ jni/xh_elf.c:1027:30: error: use of undeclared identifier 'R_ARM_GLOB_DAT' if(!is_plt && (r_type != R_GENERIC_GLOB_DAT && r_type != R_GENERIC_ABS)) return 0; ^ jni/xh_elf.c:49:29: note: expanded from macro 'R_GENERIC_GLOB_DAT' #define R_GENERIC_GLOB_DAT R_ARM_GLOB_DAT //.rel.dyn ^ jni/xh_elf.c:1027:62: error: use of undeclared identifier 'R_ARM_ABS32' if(!is_plt && (r_type != R_GENERIC_GLOB_DAT && r_type != R_GENERIC_ABS)) return 0; ^ jni/xh_elf.c:50:29: note: expanded from macro 'R_GENERIC_ABS' #define R_GENERIC_ABS R_ARM_ABS32 //.rel.dyn ^ 10 errors generated.
The text was updated successfully, but these errors were encountered:
谢谢反馈!
应该是NDK版本差异导致的编译问题。我们目前使用的NDK版本是r16b,我已经修改了readme加入了对NDK版本的说明。
根据规范,fopen和FILE确实应该include stdio.h。已修复。
ELF宏重复定义。xhook中自己定义的一些ELF宏,确实和旧版本NDK中定义的ELF宏有冲突。已修复。
ELF宏未定义。这个问题还是请你升级到最新版的NDK解决吧,android ELF格式的扩展还是比较频繁的,旧版本NDK中的宏定义肯定会有缺少。我这边目前不太可能去维护和测试旧版本NDK的兼容性。抱歉。
Sorry, something went wrong.
ok!用最新的版本测试成功。多谢楼主提供好用的hook。
No branches or pull requests
xh_core.c中未引入stdio.h导致编译时产生如下错误:
jni/xh_core.c:140:5: error: use of undeclared identifier 'FILE'
FILE *fp;
xh_elf.h中一些宏重复定义或者没有定义:
jni/xh_elf.c:61:9: error: 'ELF_R_SYM' macro redefined [-Werror,-Wmacro-redefined]
#define ELF_R_SYM(info) ELF32_R_SYM(info)
^
/Users/killer/AndTool/ndk/platforms/android-14/arch-arm/usr/include/sys/exec_elf.h:559:9: note: previous definition is here
#define ELF_R_SYM ELF32_R_SYM
^
jni/xh_elf.c:62:9: error: 'ELF_R_TYPE' macro redefined [-Werror,-Wmacro-redefined]
#define ELF_R_TYPE(info) ELF32_R_TYPE(info)
^
/Users/killer/AndTool/ndk/platforms/android-14/arch-arm/usr/include/sys/exec_elf.h:560:9: note: previous definition is here
#define ELF_R_TYPE ELF32_R_TYPE
^
jni/xh_elf.c:906:14: error: use of undeclared identifier 'DT_ANDROID_REL'
case DT_ANDROID_REL:
^
jni/xh_elf.c:907:14: error: use of undeclared identifier 'DT_ANDROID_RELA'
case DT_ANDROID_RELA:
^
jni/xh_elf.c:913:14: error: use of undeclared identifier 'DT_ANDROID_RELSZ'
case DT_ANDROID_RELSZ:
^
jni/xh_elf.c:914:14: error: use of undeclared identifier 'DT_ANDROID_RELASZ'
case DT_ANDROID_RELASZ:
^
jni/xh_elf.c:927:14: error: use of undeclared identifier 'DT_GNU_HASH'
case DT_GNU_HASH:
^
jni/xh_elf.c:1026:28: error: use of undeclared identifier 'R_ARM_JUMP_SLOT'
if(is_plt && r_type != R_GENERIC_JUMP_SLOT) return 0;
^
jni/xh_elf.c:48:29: note: expanded from macro 'R_GENERIC_JUMP_SLOT'
#define R_GENERIC_JUMP_SLOT R_ARM_JUMP_SLOT //.rel.plt
^
jni/xh_elf.c:1027:30: error: use of undeclared identifier 'R_ARM_GLOB_DAT'
if(!is_plt && (r_type != R_GENERIC_GLOB_DAT && r_type != R_GENERIC_ABS)) return 0;
^
jni/xh_elf.c:49:29: note: expanded from macro 'R_GENERIC_GLOB_DAT'
#define R_GENERIC_GLOB_DAT R_ARM_GLOB_DAT //.rel.dyn
^
jni/xh_elf.c:1027:62: error: use of undeclared identifier 'R_ARM_ABS32'
if(!is_plt && (r_type != R_GENERIC_GLOB_DAT && r_type != R_GENERIC_ABS)) return 0;
^
jni/xh_elf.c:50:29: note: expanded from macro 'R_GENERIC_ABS'
#define R_GENERIC_ABS R_ARM_ABS32 //.rel.dyn
^
10 errors generated.
The text was updated successfully, but these errors were encountered: