[原创]基于frida的脱壳工具
frida-unpack
基于Frida的脫殼工具
0x0 frida環境搭建
frida環境搭建,參考frida官網:frida。
0x2 原理說明
利用frida hook libart.so中的OpenMemory方法,拿到內存中dex的地址,計算出dex文件的大小,從內存中將dex導出。
ps:查看OpenMemory的導出名稱,可以將手機中的libart.so通過adb pull命令導出到電腦,然后利用:
nm libart.so |grep OpenMemory命令來查看到出名。
0x3 腳本用法
- 在手機上啟動frida server端
- 執行脫殼腳本
1
./inject.sh 要脫殼的應用的包名 OpenMemory.js
- 脫殼后的dex保存在/data/data/應用包名/目錄下
0x4 腳本測試環境
此腳本在以下環境測試通過
- android os: 7.1.2 32bit (64位可能要改OpenMemory的簽名)
- legu: libshella-2.8.so
- 360: libjiagu.so
0x5 參考鏈接
- frida
0x06 python腳本支持
python frida_unpack.py 應用包名
0x07 相關技巧
-
利用c++filt命令還原C++ name managling之后的函數名
1
2
3
4
c++filt _ZN3art7DexFile10OpenMemoryEPKhjRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEjPNS_6MemMapEPKNS_10OatDexFileEPS9_
?
輸出:
art::DexFile::OpenMemory(unsigned char const*, unsigned?int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned?int, art::MemMap*, art::OatDexFile const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*)
源碼見github鏈接:https://github.com/dstmath/frida-unpack
https://bbs.pediy.com/thread-229604.htm
總結
以上是生活随笔為你收集整理的[原创]基于frida的脱壳工具的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Dalvik解释器源码到VMP分析
- 下一篇: 初识Frida--Android逆向之J