[原创]基于frida的脱壳工具

本文介绍了一款基于Frida的脱壳工具,利用hooklibart.so中的OpenMemory方法,实现从内存中导出dex文件。适用于Android7.1.2及特定库版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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 参考链接

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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值