├── anti_debug_old ├── new_maps ├── new_tcp ├── new_wchan ├── new_cmdline ├── new_status ├── inject ├── libdumpUPX.so ├── libHookUtil.so ├── libanti_debug.so ├── up_install.bat ├── install.bat ├── install-nosu.bat └── install-su.bat ├── README.md ├── ThomasKing ├── correctDump.bat ├── rebuildSection.bat ├── restoreSection.bat ├── Readme.txt ├── correctDump.exe ├── rebuild_section.exe ├── restore_section.exe └── elf section的一些思考.pdf ├── inject ├── modprop ├── libdumpUPX.so ├── 906_linker ├── linker └── linker_70.idb ├── install.bat ├── install_su.bat ├── py_fixdump.py └── py_frida_dump_libDiag.py /anti_debug_old/new_maps: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /anti_debug_old/new_tcp: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /anti_debug_old/new_wchan: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /anti_debug_old/new_cmdline: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /anti_debug_old/new_status: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UnpackUPX 2 | unpack UPX on android. 3 | -------------------------------------------------------------------------------- /ThomasKing/correctDump.bat: -------------------------------------------------------------------------------- 1 | correctDump.exe %~n1.so %~n1_new.so -------------------------------------------------------------------------------- /inject: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCint3/UnpackUPX/HEAD/inject -------------------------------------------------------------------------------- /modprop: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCint3/UnpackUPX/HEAD/modprop -------------------------------------------------------------------------------- /ThomasKing/rebuildSection.bat: -------------------------------------------------------------------------------- 1 | rebuild_section.exe %~n1.so %~n1_full.so -------------------------------------------------------------------------------- /libdumpUPX.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCint3/UnpackUPX/HEAD/libdumpUPX.so -------------------------------------------------------------------------------- /906_linker/linker: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCint3/UnpackUPX/HEAD/906_linker/linker -------------------------------------------------------------------------------- /ThomasKing/restoreSection.bat: -------------------------------------------------------------------------------- 1 | restore_section.exe dump_new.so apkso.so dump_new_full.so -------------------------------------------------------------------------------- /ThomasKing/Readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCint3/UnpackUPX/HEAD/ThomasKing/Readme.txt -------------------------------------------------------------------------------- /anti_debug_old/inject: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCint3/UnpackUPX/HEAD/anti_debug_old/inject -------------------------------------------------------------------------------- /906_linker/linker_70.idb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCint3/UnpackUPX/HEAD/906_linker/linker_70.idb -------------------------------------------------------------------------------- /ThomasKing/correctDump.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCint3/UnpackUPX/HEAD/ThomasKing/correctDump.exe -------------------------------------------------------------------------------- /anti_debug_old/libdumpUPX.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCint3/UnpackUPX/HEAD/anti_debug_old/libdumpUPX.so -------------------------------------------------------------------------------- /ThomasKing/rebuild_section.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCint3/UnpackUPX/HEAD/ThomasKing/rebuild_section.exe -------------------------------------------------------------------------------- /ThomasKing/restore_section.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCint3/UnpackUPX/HEAD/ThomasKing/restore_section.exe -------------------------------------------------------------------------------- /anti_debug_old/libHookUtil.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCint3/UnpackUPX/HEAD/anti_debug_old/libHookUtil.so -------------------------------------------------------------------------------- /ThomasKing/elf section的一些思考.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCint3/UnpackUPX/HEAD/ThomasKing/elf section的一些思考.pdf -------------------------------------------------------------------------------- /anti_debug_old/libanti_debug.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCint3/UnpackUPX/HEAD/anti_debug_old/libanti_debug.so -------------------------------------------------------------------------------- /install.bat: -------------------------------------------------------------------------------- 1 | @echo on 2 | adb push inject /data/local/tmp 3 | adb push libdumpUPX.so /data/local/tmp 4 | adb shell chmod 777 /data/local/tmp/inject 5 | adb shell mkdir /data/local/tmp/unpack 6 | adb shell rm -rf /data/local/tmp/unpack/* 7 | adb push %1 /data/local/tmp/unpack 8 | adb shell "/data/local/tmp/inject com.Autel.maxi /data/local/tmp/libdumpUPX.so %~nx1" 9 | adb shell "chmod 777 /data/local/tmp/unpack/dump.so" 10 | adb pull /data/local/tmp/unpack/dump.so 11 | copy dump.so diag.so 12 | del dump.so 13 | 14 | pause 15 | 16 | -------------------------------------------------------------------------------- /anti_debug_old/up_install.bat: -------------------------------------------------------------------------------- 1 | @echo on 2 | adb push inject /data/local/tmp 3 | adb push libdumpUPX.so /data/local/tmp 4 | adb shell su -c "chmod 777 /data/local/tmp/inject" 5 | adb shell su -c "mkdir /data/local/tmp/unpack" 6 | adb shell su -c "rm -rf /data/local/tmp/unpack/*" 7 | adb push %1 /data/local/tmp/unpack 8 | rem com.cnlaunch.x431.diag 9 | rem com.Autel.maxi 10 | 11 | adb shell su -c "data/local/tmp/inject com.Autel.maxi /data/local/tmp/libdumpUPX.so %~nx1" 12 | adb shell su -c "chmod 777 /data/local/tmp/unpack/dump.so" 13 | adb pull /data/local/tmp/unpack/dump.so 14 | 15 | ren %~nx1 %~nx1.old 16 | ren dump.so %~n1.so 17 | 18 | pause -------------------------------------------------------------------------------- /anti_debug_old/install.bat: -------------------------------------------------------------------------------- 1 | echo @off 2 | adb shell mkdir /data/local/tmp/anti_debug 3 | adb shell rm -rf /data/local/tmp/anti_debug/* 4 | adb push inject /data/local/tmp/anti_debug/inject 5 | adb push libHookUtil.so /data/local/tmp/anti_debug/libHookUtil.so 6 | adb push libnewFunc.so /data/local/tmp/anti_debug/libanti_debug.so 7 | adb push new_cmdline /data/local/tmp/anti_debug/new_cmdline 8 | adb push new_maps /data/local/tmp/anti_debug/new_maps 9 | adb push new_status /data/local/tmp/anti_debug/new_status 10 | adb push new_tcp /data/local/tmp/anti_debug/new_tcp 11 | adb push new_wchan /data/local/tmp/anti_debug/new_wchan 12 | adb shell chmod 777 /data/local/tmp/anti_debug/inject 13 | adb shell ./data/local/tmp/anti_debug/inject zygote /data/local/tmp/anti_debug/libanti_debug.so 1 14 | -------------------------------------------------------------------------------- /anti_debug_old/install-nosu.bat: -------------------------------------------------------------------------------- 1 | echo @off 2 | adb shell "mkdir /data/local/tmp/anti_debug" 3 | adb shell "chmod 777 /data/local/tmp/anti_debug" 4 | adb shell "rm -rf /data/local/tmp/anti_debug/*" 5 | adb push inject /data/local/tmp/anti_debug/inject 6 | adb push libHookUtil.so /data/local/tmp/anti_debug/libHookUtil.so 7 | adb push libanti_debug.so /data/local/tmp/anti_debug/libanti_debug.so 8 | adb push new_cmdline /data/local/tmp/anti_debug/new_cmdline 9 | adb push new_maps /data/local/tmp/anti_debug/new_maps 10 | adb push new_status /data/local/tmp/anti_debug/new_status 11 | adb push new_tcp /data/local/tmp/anti_debug/new_tcp 12 | adb push new_wchan /data/local/tmp/anti_debug/new_wchan 13 | adb shell "chmod 777 /data/local/tmp/anti_debug/inject" 14 | adb shell "./data/local/tmp/anti_debug/inject zygote /data/local/tmp/anti_debug/libanti_debug.so 1" 15 | pause -------------------------------------------------------------------------------- /install_su.bat: -------------------------------------------------------------------------------- 1 | @echo on 2 | adb push inject /data/local/tmp 3 | adb push libdumpUPX.so /data/local/tmp 4 | adb shell su -c chmod 777 /data/local/tmp/libdumpUPX.so 5 | adb shell su -c chmod 777 /data/local/tmp/inject 6 | 7 | adb shell su -c chown root:root /data/local/tmp/inject 8 | adb shell su -c chown root:root /data/local/tmp/libdumpUPX.so 9 | 10 | adb shell su -c rm -rf /data/local/tmp/unpack 11 | adb shell su -c mkdir /data/local/tmp/unpack 12 | adb shell su -c chmod 777 /data/local/tmp/unpack 13 | adb push %1 /data/local/tmp/unpack 14 | REM adb shell su -c "/data/local/tmp/inject com.illuminate.texaspoker /data/local/tmp/libdumpUPX.so %~nx1" 15 | adb shell su -c "/data/local/tmp/inject com.Autel.maxi /data/local/tmp/libdumpUPX.so %~nx1" 16 | adb shell su -c "chmod 777 /data/local/tmp/unpack/dump.so" 17 | adb pull /data/local/tmp/unpack/dump.so 18 | copy dump.so diag.so 19 | del dump.so 20 | 21 | pause 22 | 23 | -------------------------------------------------------------------------------- /anti_debug_old/install-su.bat: -------------------------------------------------------------------------------- 1 | echo @off 2 | set sumode=su -c 3 | adb shell %sumode% "mkdir /data/local/tmp/anti_debug" 4 | adb shell %sumode% "chmod 777 /data/local/tmp/anti_debug" 5 | adb shell %sumode% "rm -rf /data/local/tmp/anti_debug/*" 6 | 7 | adb push inject /data/local/tmp/anti_debug/inject 8 | adb push libHookUtil.so /data/local/tmp/anti_debug/libHookUtil.so 9 | adb push libanti_debug.so /data/local/tmp/anti_debug/libanti_debug.so 10 | adb push new_cmdline /data/local/tmp/anti_debug/new_cmdline 11 | adb push new_maps /data/local/tmp/anti_debug/new_maps 12 | adb push new_status /data/local/tmp/anti_debug/new_status 13 | adb push new_tcp /data/local/tmp/anti_debug/new_tcp 14 | adb push new_wchan /data/local/tmp/anti_debug/new_wchan 15 | 16 | adb shell %sumode% "chmod 777 /data/local/tmp/anti_debug/inject" 17 | adb shell %sumode% "/data/local/tmp/anti_debug/inject zygote /data/local/tmp/anti_debug/libanti_debug.so 1" 18 | pause -------------------------------------------------------------------------------- /py_fixdump.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import struct 3 | import os 4 | 5 | class Elf32_Ehdr: 6 | fmt_str = "<16sHHIIIIIHHHHHH" 7 | sizeof = struct.calcsize(fmt_str) 8 | 9 | def __init__(self): 10 | self.e_ident = "" 11 | self.e_type = 0 12 | self.e_machine = 0 13 | self.e_version = 0 14 | self.e_entry = 0 15 | self.e_phoff = 0 16 | self.e_shoff = 0 17 | self.e_flags = 0 18 | self.e_ehsize = 0 19 | self.e_phentsize = 0 20 | self.e_phnum = 0 21 | self.e_shentsize = 0 22 | self.e_shnum = 0 23 | self.e_shstrndx = 0 24 | 25 | def setFields(self, data): 26 | data = struct.unpack(self.fmt_str, data) 27 | self.e_ident = data[0] 28 | self.e_type = data[1] 29 | self.e_machine = data[2] 30 | self.e_version = data[3] 31 | self.e_entry = data[4] 32 | self.e_phoff = data[5] 33 | self.e_shoff = data[6] 34 | self.e_flags = data[7] 35 | self.e_ehsize = data[8] 36 | self.e_phentsize = data[9] 37 | self.e_phnum = data[10] 38 | self.e_shentsize = data[11] 39 | self.e_shnum = data[12] 40 | self.e_shstrndx = data[13] 41 | 42 | def getFields(self): 43 | return struct.pack(self.fmt_str, \ 44 | self.e_ident, \ 45 | self.e_type, \ 46 | self.e_machine, \ 47 | self.e_version, \ 48 | self.e_entry, \ 49 | self.e_phoff, \ 50 | self.e_shoff, \ 51 | self.e_flags, \ 52 | self.e_ehsize, \ 53 | self.e_phentsize, \ 54 | self.e_phnum, \ 55 | self.e_shentsize, \ 56 | self.e_shnum, \ 57 | self.e_shstrndx) 58 | 59 | def fix(self, data = None, offset = 0): 60 | self.e_shoff = 0 61 | self.e_shnum = 0 62 | self.e_shstrndx = 0 63 | self.e_shentsize = 0 64 | if data != None: 65 | self_data = self.getFields() 66 | return data[0 : offset] + self_data + data[offset + self.sizeof : len(data)] 67 | return data 68 | 69 | 70 | class Elf32_Phdr: 71 | fmt_str = "