├── .DS_Store
├── AndroidManifest.xml
├── jni
├── Android.mk
├── Application.mk
├── Log.cpp
├── Log.h
├── Main.cpp
├── Main.h
├── Utils.cpp
└── Utils.h
├── proguard-project.txt
└── project.properties
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FateHack/dumpSo/b8ac1f988d9aa7e9bfc5517392cd16d0f7f815ee/.DS_Store
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
9 |
10 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/jni/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 |
4 |
5 | include $(CLEAR_VARS)
6 | LOCAL_MODULE := fate
7 | LOCAL_C_INCLUDES := \
8 | $(LOCAL_PATH)/ \
9 | $(LOCAL_PATH)/libzip/
10 |
11 | LOCAL_CFLAGS := -DANDROID_NDK -Wno-psabi \
12 | -DDISABLE_IMPORTGL
13 |
14 |
15 | LOCAL_SRC_FILES +=\
16 | Utils.cpp\
17 | Main.cpp\
18 |
19 |
20 |
21 | LOCAL_LDLIBS := -ldl -llog -lz
22 |
23 | LOCAL_ARM_MODE := arm
24 |
25 | include $(BUILD_SHARED_LIBRARY)
--------------------------------------------------------------------------------
/jni/Application.mk:
--------------------------------------------------------------------------------
1 | #APP_ABI := armeabi
2 | #APP_ABI := x86
3 | #APP_ABI := mips
4 | #APP_ABI := mips armeabi armeabi-v7a x86
5 | #APP_ABI := armeabi x86
6 | APP_ABI := armeabi-v7a
7 |
8 | # use static stl port
9 | APP_STL := stlport_static
10 | APP_CPPFLAGS += -fno-exceptions
11 | APP_CPPFLAGS += -g0
12 | APP_CPPFLAGS += -fno-rtti
13 |
14 |
--------------------------------------------------------------------------------
/jni/Log.cpp:
--------------------------------------------------------------------------------
1 | #include "Log.h"
2 |
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 |
14 | #include
15 | #include
16 | #include
17 |
18 |
19 | #ifdef __cplusplus
20 | extern "C" {
21 | #endif
22 |
23 |
24 | #ifdef __cplusplus
25 | }
26 | #endif
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/jni/Log.h:
--------------------------------------------------------------------------------
1 | #ifndef _SECSHELL_LOG_
2 | #define _SECSHELL_LOG_
3 |
4 | #include
5 | #include
6 |
7 |
8 | #ifdef __cplusplus
9 | extern "C" {
10 | #endif
11 |
12 | #define LOG_TAG "Fuck"
13 |
14 | #define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__)
15 | #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
16 | #define LOGF(...) __android_log_print(ANDROID_LOG_FATAL,LOG_TAG,__VA_ARGS__)
17 |
18 | #if (1)
19 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
20 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
21 | #else
22 | #define LOGD(...)
23 | #define LOGI(...)
24 | #endif
25 |
26 |
27 |
28 | #ifdef __cplusplus
29 | }
30 | #endif
31 |
32 | #endif
33 |
34 |
35 |
--------------------------------------------------------------------------------
/jni/Main.cpp:
--------------------------------------------------------------------------------
1 | #include "Log.h"
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include "Utils.h"
19 |
20 | using namespace std;
21 |
22 | //typedef int(*mprotect_t)(void* __addr, size_t __size, int __prot);
23 |
24 | int dump(const char* soName) {
25 | ProcMap map = getLibraryMap(soName);
26 | if (!map.isValid())//maps中没有找到相应的内存映射
27 | {
28 | return -1;
29 | }
30 | int n = map.length / getpagesize() + 1;
31 | int ret = mprotect(map.startAddr, n * getpagesize(), PROT_READ | PROT_WRITE | PROT_EXEC);//内存可读可写
32 | char* memory = (char*)malloc(map.length);
33 | memcpy(memory, map.startAddr, map.length);
34 | char savePath[1024] = { 0 };
35 | sprintf(savePath, "/sdcard/%s-%s", map.startAddr, soName);
36 | FILE* file = fopen(savePath, "w+");
37 | fwrite(memory, 1, map.length, file);
38 | fclose(file);
39 | free(memory);
40 | return 0;
41 | }
42 |
43 | void* my_thread(void* pVoid) {
44 | LOGD("Hook:====hook_game_proxy begin====");
45 | while (1) {
46 | sleep(3);
47 | int ret = dump("libil2cpp.so");
48 | int ret2 = dump("global-metadata.dat");
49 | if (ret == 0 && ret2 == 0) {
50 | pthread_exit((void*)"the first return!");
51 | }
52 | }
53 | LOGD("Hook:=====hook_game_proxy finish=====");
54 | }
55 |
56 | __attribute__((constructor)) void entry()
57 | {
58 | LOGI("=======================Enter lib entry=====================");
59 | int err;
60 | pthread_t ntid;
61 | pthread_create(&ntid, NULL, my_thread, NULL);
62 | if (err != 0) {
63 | printf("create thread failed:%s\n", strerror(err));
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/jni/Main.h:
--------------------------------------------------------------------------------
1 | #ifndef _HOOK_H_
2 | #define _HOOK_H_
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include