首页
社区
课程
招聘
[原创]Hook Java的的一个改进版本
发表于: 2014-9-29 11:09 32831

[原创]Hook Java的的一个改进版本

2014-9-29 11:09
32831
收藏
免费 3
支持
分享
最新回复 (33)
雪    币: 4
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
26
期待楼主把更加完整的东西拿出来
2016-3-23 14:14
0
雪    币: 191
活跃值: (195)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
27
好文章哦,看起来比以前老版本的精简了很多,多谢分享
2016-5-8 15:37
0
雪    币: 3
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
28
学习了,谢谢分享
2016-5-24 15:14
0
雪    币: 4
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
29
非常感谢大神,
我做了下测试,最后卡在如何在method_handler 函数中,写callback?
比如我已经hook到了:"android/net/wifi/WifiInfo","getMacAddress" 函数,现在想实现该函数,不知道如何才能实现?
期待解答,谢谢
2016-8-18 17:05
0
雪    币: 0
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
30
不行啊,编译报错,已经把ndk-patch解压到NDK_DIR/platforms/android-xx/arch-arm/usr目录下了
以下是报错信息,求大神指点!

00:34:08 **** Incremental Build of configuration Default for project AllHookInOne ****
"D:\\android\\ndk\\ndk-build.cmd" all
Android NDK: WARNING: APP_PLATFORM android-16 is larger than android:minSdkVersion 14 in ./AndroidManifest.xml   
Android NDK: WARNING:jni/Android.mk:onehook: non-system libraries in linker flags: -landroid_runtime -lart -ldvm   
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES   
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the   
Android NDK:     current module   
[armeabi] Compile++ thumb: onehook <= JavaMethodHook.cpp
[armeabi] Compile++ thumb: onehook <= ArtMethodHook.cpp
[armeabi] Compile++ thumb: onehook <= DalvikMethodHook.cpp
In file included from D:/android/ndk/platforms/android-16/arch-arm/usr/include/utils/String16.h:22:0,
                 from D:/android/ndk/platforms/android-16/arch-arm/usr/include/binder/IBinder.h:22,
                 from D:/android/ndk/platforms/android-16/arch-arm/usr/include/android_runtime/AndroidRuntime.h:23,
                 from jni/JavaHook/DalvikMethodHook.cpp:1:
D:/android/ndk/platforms/android-16/arch-arm/usr/include/utils/Unicode.h:25:18: warning: redeclaration of C++ built-in type 'char32_t' [-fpermissive]
D:/android/ndk/platforms/android-16/arch-arm/usr/include/utils/Unicode.h:26:18: warning: redeclaration of C++ built-in type 'char16_t' [-fpermissive]
[armeabi] Compile thumb  : onehook <= art_quick_proxy.S
[armeabi] Compile++ thumb: onehook <= elfhook.cpp
jni/ElfHook/elfhook.cpp: In function 'int replaceFunc(void*, void*, void**)':
jni/ElfHook/elfhook.cpp:53:2: warning: format '%p' expects argument of type 'void*', but argument 6 has type 'uint32_t {aka unsigned int}' [-Wformat]
[armeabi] Compile++ thumb: onehook <= elfio.cpp
[armeabi] Compile++ thumb: onehook <= elfutils.cpp
[armeabi] Compile++ thumb: onehook <= main.cpp
[armeabi] SharedLibrary  : libonehook.so
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: warning: hidden symbol '__aeabi_atexit' in D:/android/ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/libgnustl_static.a(atexit_arm.o) is referenced by DSO D:/android/ndk/platforms/android-16/arch-arm/usr/lib/libandroid_runtime.so
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: warning: hidden symbol '__aeabi_atexit' in D:/android/ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/libgnustl_static.a(atexit_arm.o) is referenced by DSO D:/android/ndk/platforms/android-16/arch-arm/usr/lib/libutils.so
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: warning: hidden symbol '__aeabi_atexit' in D:/android/ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/libgnustl_static.a(atexit_arm.o) is referenced by DSO D:/android/ndk/platforms/android-16/arch-arm/usr/lib/libart.so
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot find -ldvm
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmFindClass(char const*):jni/JavaHook/DalvikMethodHook.cpp:190: error: undefined reference to 'dvmDescriptorToName(char const*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmFindClass(char const*):jni/JavaHook/DalvikMethodHook.cpp:193: error: undefined reference to 'dvmThreadSelf()'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmFindClass(char const*):jni/JavaHook/DalvikMethodHook.cpp:193: error: undefined reference to 'dvmDecodeIndirectRef(Thread*, _jobject*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:203: error: undefined reference to 'dexProtoGetParameterCount(DexProto const*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:205: error: undefined reference to 'dvmFindSystemClass(char const*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:208: error: undefined reference to 'dvmAllocArrayByClass'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:231: error: undefined reference to 'dvmFindPrimitiveClass(char)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:231: error: undefined reference to 'dvmBoxPrimitive(JValue, ClassObject*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:233: error: undefined reference to 'dvmReleaseTrackedAlloc'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:240: error: undefined reference to 'dvmFindPrimitiveClass(char)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:240: error: undefined reference to 'dvmBoxPrimitive(JValue, ClassObject*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:241: error: undefined reference to 'dvmReleaseTrackedAlloc'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmGetMethodParamTypes(Method const*, char const*):jni/JavaHook/DalvikMethodHook.cpp:256: error: undefined reference to 'dexProtoGetParameterCount(DexProto const*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmGetMethodParamTypes(Method const*, char const*):jni/JavaHook/DalvikMethodHook.cpp:257: error: undefined reference to 'dvmFindSystemClass(char const*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmGetMethodParamTypes(Method const*, char const*):jni/JavaHook/DalvikMethodHook.cpp:260: error: undefined reference to 'dvmAllocArrayByClass'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmGetMethodParamTypes(Method const*, char const*):jni/JavaHook/DalvikMethodHook.cpp:288: error: undefined reference to 'dvmFindPrimitiveClass(char)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmGetMethodParamTypes(Method const*, char const*):jni/JavaHook/DalvikMethodHook.cpp:293: error: undefined reference to 'dvmFindSystemClass(char const*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function method_handler(unsigned int const*, JValue*, Method const*, Thread*):jni/JavaHook/DalvikMethodHook.cpp:332: error: undefined reference to 'dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function method_handler(unsigned int const*, JValue*, Method const*, Thread*):jni/JavaHook/DalvikMethodHook.cpp:334: error: undefined reference to 'dvmReleaseTrackedAlloc'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dalvik_java_method_hook(_JNIEnv*, HookInfo*):jni/JavaHook/DalvikMethodHook.cpp:371: error: undefined reference to 'dvmGetBoxedReturnType(Method const*)'
collect2: ld returned 1 exit status
make.exe: *** [obj/local/armeabi/libonehook.so] Error 1

00:34:17 Build Finished (took 8s.441ms)
2016-8-28 00:35
0
雪    币: 0
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
31
不行啊,编译报错,已经把ndk-patch解压到NDK_DIR/platforms/android-xx/arch-arm/usr目录下了
以下是报错信息,求大神指点!

00:34:08 **** Incremental Build of configuration Default for project AllHookInOne ****
"D:\\android\\ndk\\ndk-build.cmd" all
Android NDK: WARNING: APP_PLATFORM android-16 is larger than android:minSdkVersion 14 in ./AndroidManifest.xml   
Android NDK: WARNING:jni/Android.mk:onehook: non-system libraries in linker flags: -landroid_runtime -lart -ldvm   
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES   
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the   
Android NDK:     current module   
[armeabi] Compile++ thumb: onehook <= JavaMethodHook.cpp
[armeabi] Compile++ thumb: onehook <= ArtMethodHook.cpp
[armeabi] Compile++ thumb: onehook <= DalvikMethodHook.cpp
In file included from D:/android/ndk/platforms/android-16/arch-arm/usr/include/utils/String16.h:22:0,
                 from D:/android/ndk/platforms/android-16/arch-arm/usr/include/binder/IBinder.h:22,
                 from D:/android/ndk/platforms/android-16/arch-arm/usr/include/android_runtime/AndroidRuntime.h:23,
                 from jni/JavaHook/DalvikMethodHook.cpp:1:
D:/android/ndk/platforms/android-16/arch-arm/usr/include/utils/Unicode.h:25:18: warning: redeclaration of C++ built-in type 'char32_t' [-fpermissive]
D:/android/ndk/platforms/android-16/arch-arm/usr/include/utils/Unicode.h:26:18: warning: redeclaration of C++ built-in type 'char16_t' [-fpermissive]
[armeabi] Compile thumb  : onehook <= art_quick_proxy.S
[armeabi] Compile++ thumb: onehook <= elfhook.cpp
jni/ElfHook/elfhook.cpp: In function 'int replaceFunc(void*, void*, void**)':
jni/ElfHook/elfhook.cpp:53:2: warning: format '%p' expects argument of type 'void*', but argument 6 has type 'uint32_t {aka unsigned int}' [-Wformat]
[armeabi] Compile++ thumb: onehook <= elfio.cpp
[armeabi] Compile++ thumb: onehook <= elfutils.cpp
[armeabi] Compile++ thumb: onehook <= main.cpp
[armeabi] SharedLibrary  : libonehook.so
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: warning: hidden symbol '__aeabi_atexit' in D:/android/ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/libgnustl_static.a(atexit_arm.o) is referenced by DSO D:/android/ndk/platforms/android-16/arch-arm/usr/lib/libandroid_runtime.so
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: warning: hidden symbol '__aeabi_atexit' in D:/android/ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/libgnustl_static.a(atexit_arm.o) is referenced by DSO D:/android/ndk/platforms/android-16/arch-arm/usr/lib/libutils.so
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: warning: hidden symbol '__aeabi_atexit' in D:/android/ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/libgnustl_static.a(atexit_arm.o) is referenced by DSO D:/android/ndk/platforms/android-16/arch-arm/usr/lib/libart.so
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot find -ldvm
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmFindClass(char const*):jni/JavaHook/DalvikMethodHook.cpp:190: error: undefined reference to 'dvmDescriptorToName(char const*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmFindClass(char const*):jni/JavaHook/DalvikMethodHook.cpp:193: error: undefined reference to 'dvmThreadSelf()'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmFindClass(char const*):jni/JavaHook/DalvikMethodHook.cpp:193: error: undefined reference to 'dvmDecodeIndirectRef(Thread*, _jobject*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:203: error: undefined reference to 'dexProtoGetParameterCount(DexProto const*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:205: error: undefined reference to 'dvmFindSystemClass(char const*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:208: error: undefined reference to 'dvmAllocArrayByClass'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:231: error: undefined reference to 'dvmFindPrimitiveClass(char)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:231: error: undefined reference to 'dvmBoxPrimitive(JValue, ClassObject*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:233: error: undefined reference to 'dvmReleaseTrackedAlloc'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:240: error: undefined reference to 'dvmFindPrimitiveClass(char)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:240: error: undefined reference to 'dvmBoxPrimitive(JValue, ClassObject*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmBoxMethodArgs(Method const*, unsigned int const*):jni/JavaHook/DalvikMethodHook.cpp:241: error: undefined reference to 'dvmReleaseTrackedAlloc'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmGetMethodParamTypes(Method const*, char const*):jni/JavaHook/DalvikMethodHook.cpp:256: error: undefined reference to 'dexProtoGetParameterCount(DexProto const*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmGetMethodParamTypes(Method const*, char const*):jni/JavaHook/DalvikMethodHook.cpp:257: error: undefined reference to 'dvmFindSystemClass(char const*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmGetMethodParamTypes(Method const*, char const*):jni/JavaHook/DalvikMethodHook.cpp:260: error: undefined reference to 'dvmAllocArrayByClass'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmGetMethodParamTypes(Method const*, char const*):jni/JavaHook/DalvikMethodHook.cpp:288: error: undefined reference to 'dvmFindPrimitiveClass(char)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dvmGetMethodParamTypes(Method const*, char const*):jni/JavaHook/DalvikMethodHook.cpp:293: error: undefined reference to 'dvmFindSystemClass(char const*)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function method_handler(unsigned int const*, JValue*, Method const*, Thread*):jni/JavaHook/DalvikMethodHook.cpp:332: error: undefined reference to 'dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function method_handler(unsigned int const*, JValue*, Method const*, Thread*):jni/JavaHook/DalvikMethodHook.cpp:334: error: undefined reference to 'dvmReleaseTrackedAlloc'
D:/android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/onehook/JavaHook/DalvikMethodHook.o: in function dalvik_java_method_hook(_JNIEnv*, HookInfo*):jni/JavaHook/DalvikMethodHook.cpp:371: error: undefined reference to 'dvmGetBoxedReturnType(Method const*)'
collect2: ld returned 1 exit status
make.exe: *** [obj/local/armeabi/libonehook.so] Error 1

00:34:17 Build Finished (took 8s.441ms)
2016-8-28 00:37
0
雪    币: 11
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
32
学习mark一下!
2016-8-31 15:24
0
雪    币: 0
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
33
楼主这个需要添加什么库文件吗?还是Android版本不对?
jni/JavaHook/DalvikMethodHook.cpp:190: error: undefined reference to 'dvmDescriptorToName(char const*)'
jni/JavaHook/DalvikMethodHook.cpp:193: error: undefined reference to 'dvmThreadSelf()'
jni/JavaHook/DalvikMethodHook.cpp:193: error: undefined reference to 'dvmDecodeIndirectRef(Thread*, _jobject*)'
jni/JavaHook/DalvikMethodHook.cpp:203: error: undefined reference to 'dexProtoGetParameterCount(DexProto const*)'
jni/JavaHook/DalvikMethodHook.cpp:205: error: undefined reference to 'dvmFindSystemClass(char const*)'
jni/JavaHook/DalvikMethodHook.cpp:208: error: undefined reference to 'dvmAllocArrayByClass'
jni/JavaHook/DalvikMethodHook.cpp:231: error: undefined reference to 'dvmFindPrimitiveClass(char)'
jni/JavaHook/DalvikMethodHook.cpp:231: error: undefined reference to 'dvmBoxPrimitive(JValue, ClassObject*)'
jni/JavaHook/DalvikMethodHook.cpp:233: error: undefined reference to 'dvmReleaseTrackedAlloc'
jni/JavaHook/DalvikMethodHook.cpp:240: error: undefined reference to 'dvmFindPrimitiveClass(char)'
jni/JavaHook/DalvikMethodHook.cpp:240: error: undefined reference to 'dvmBoxPrimitive(JValue, ClassObject*)'
jni/JavaHook/DalvikMethodHook.cpp:241: error: undefined reference to 'dvmReleaseTrackedAlloc'
jni/JavaHook/DalvikMethodHook.cpp:256: error: undefined reference to 'dexProtoGetParameterCount(DexProto const*)'
jni/JavaHook/DalvikMethodHook.cpp:257: error: undefined reference to 'dvmFindSystemClass(char const*)'
jni/JavaHook/DalvikMethodHook.cpp:260: error: undefined reference to 'dvmAllocArrayByClass'
jni/JavaHook/DalvikMethodHook.cpp:288: error: undefined reference to 'dvmFindPrimitiveClass(char)'
jni/JavaHook/DalvikMethodHook.cpp:293: error: undefined reference to 'dvmFindSystemClass(char const*)'
jni/JavaHook/DalvikMethodHook.cpp:332: error: undefined reference to 'dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)'
jni/JavaHook/DalvikMethodHook.cpp:334: error: undefined reference to 'dvmReleaseTrackedAlloc'
jni/JavaHook/DalvikMethodHook.cpp:371: error: undefined reference to 'dvmGetBoxedReturnType(Method const*)'
2017-1-1 18:19
0
雪    币: 156
活跃值: (20)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
34
@sunxuechao libdvm.so
2017-1-13 16:46
0
游客
登录 | 注册 方可回帖
返回
//