Giter VIP home page Giter VIP logo

frida-unpack's Introduction

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命令来查看到出名。 其中android 10为/apex/com.android.runtime/lib/libdexfile.so方法为OpenCommon

0x3 脚本用法

  • 在手机上启动frida server端
  • 执行脱壳脚本
    执行./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之后的函数名

    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> >*)
    

frida-unpack's People

Contributors

dstmath avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.