Giter Site home page Giter Site logo

bn-dyldsharedcache's Introduction

Dyld Shared Cache Parser

Author: cynder (kat)

Dyld Shared Cache Support for BinaryNinja

BinaryNinja Screenshot

BinaryNinja Screenshot

Without any of the fuss of requiring manually loading several unrelated images, or the awful off-image addresses, and with better output than IDA, Hopper, or any other disassembler on the market.

Installation + Usage

  1. Open the plugin manager
  2. Search for "Dyld" and install this plugin

Usage:

  1. Open Dyld Shared Cache file with BN
  2. Select the Image you would like to disassemble
  3. Congrats, you are now Reverse Engineering the Mach-O

Description:

This project acts as an interface for two seperate projects; DyldExtractor, and ktool. Mainly DyldExtractor.

DyldExtractor is a project written primarily by 'arandomdev' designed for CLI standalone dyld_shared_cache extraction. It is the best tool for the job, and reverses the majority of "optimizations" that make DSC reverse engineering ugly and painful. Utilizing this plugin, Binja's processing should outperform IDAs, and wont require IDA's need for repeatedly right clicking and manually loading tons of modules.

This version of DyldExtractor has a lot of modifications (read: a lot of commented out lines) from the original designed to make it function better in the binja environment.

ktool is a multifaceted project I wrote for, primarily, MachO + ObjC Parsing.

It is mainly used for super basic parsing of the output, as we need to properly write the segments to the VM (and scrap all the dsc data that was originally in this file) so the Mach-O View knows how to parse it.

License

This plugin, along with ktool and dyldextractor are released under an MIT license. Both of these plugins are vendored within this project to make installation slightly simpler.

bn-dyldsharedcache's People

Contributors

jonpalmisc avatar psifertex avatar

Stargazers

Miguel Piedrafita avatar Glenn 'devalias' Grant avatar Fakhri Zulkifli avatar Rick van Biljouw avatar JACK ZHAO avatar Loïc Buckwell avatar 5l1v3r1 avatar Dawid Pastuszak avatar みぞれ゚ avatar Zach Riggle avatar Indragie Karunaratne avatar HCiSO avatar bb010g avatar  avatar eg avatar Jeffrey Zhuang avatar alan avatar  avatar pr0xy avatar  avatar Peter A. avatar  avatar Jeremy Legendre avatar biazo avatar WZM1230 avatar TD Sbs avatar 长歌短笛 avatar maxu avatar  avatar Kyle Howells avatar Kevin Bradley avatar Gionne Cannister avatar  avatar  avatar Joey avatar K3vin avatar Derek avatar Dom avatar Ryota Sakai avatar Lays avatar swing avatar o0xmuhe avatar Esonhugh Skyworship avatar 炽火 avatar 突突兔 avatar  avatar  avatar ⠀ avatar Dick Lacy avatar Phil avatar Chaitanya avatar  avatar Wymany Wu avatar gradetwo avatar Orochi avatar acceler avatar Resery avatar XYlearn avatar Youfu Zhang avatar  avatar Csaba Fitzl avatar  avatar  avatar  avatar Tomahawkd avatar Liam(Cryptic) avatar Simone Ferrini avatar CaiRuJi avatar Michael Roland avatar Gr3yD0g avatar Xingwei Lin avatar K4nj avatar Luke Symons avatar Proteas avatar Daniel avatar Glenn Smith avatar actae0n avatar Alexandre Dulaunoy avatar Jevin Sweval avatar Jiyee Sheng avatar BendyCatus avatar  avatar

Watchers

Jevin Sweval avatar 0x24bin avatar cynder avatar

bn-dyldsharedcache's Issues

New Cache Formats Support

DyldExtractor already has these built-in, I just didn't bother to implement them yet as it'll require some more input validation.

prep for plugin manager

Looks like only two changes are required to get this added to the BN plugin manager. The first is to add a requirements.txt -- while ktool and DyldExtractor are versioned, capstone is still a requirement of DyldExtractor so it would be nice to expose that.

Or, better yet, replace the disassembler with BN's own disassembly to remove the dependency entirely. That also means there's no need to hack around the lack of PAC instructions as BN can disassemble those just fine.

The other step is to make a release, then we can add the plugin directly to the plugin manager which would be really handy!

TypeError: cannot unpack non-iterable NoneType object

Tried this just now, and got this, trying to extract the macOS 13.1 x86_64h cache:

Successfully installed: Dyld Shared Cache Processor
Loaded python3 plugin 'cxnder_bndyldsharedcache'
Traceback (most recent call last):
  File "/Applications/Binary Ninja.app/Contents/MacOS/plugins/../../Resources/python/binaryninja/binaryview.py", line 2818, in _init
    return self.init()
  File "/Users/torarne/Library/Application Support/Binary Ninja/repositories/community/plugins/cxnder_bndyldsharedcache/dsc.py", line 101, in init
    stub_fixer.fixStubs(extraction_ctx)
  File "/Users/torarne/Library/Application Support/Binary Ninja/repositories/community/plugins/cxnder_bndyldsharedcache/DyldExtractor/converter/stub_fixer.py", line 1681, in fixStubs
    _StubFixer(extractionCtx).run()
  File "/Users/torarne/Library/Application Support/Binary Ninja/repositories/community/plugins/cxnder_bndyldsharedcache/DyldExtractor/converter/stub_fixer.py", line 1011, in run
    self._symbolizer = _Symbolizer(self._extractionCtx)
  File "/Users/torarne/Library/Application Support/Binary Ninja/repositories/community/plugins/cxnder_bndyldsharedcache/DyldExtractor/converter/stub_fixer.py", line 59, in __init__
    self._enumerateExports()
  File "/Users/torarne/Library/Application Support/Binary Ninja/repositories/community/plugins/cxnder_bndyldsharedcache/DyldExtractor/converter/stub_fixer.py", line 101, in _enumerateExports
    if depInfo := self._getDepInfo(dylib, self._machoCtx):
  File "/Users/torarne/Library/Application Support/Binary Ninja/repositories/community/plugins/cxnder_bndyldsharedcache/DyldExtractor/converter/stub_fixer.py", line 179, in _getDepInfo
    imageOff, dyldCtx = self._dyldCtx.convertAddr(imageAddr)
TypeError: cannot unpack non-iterable NoneType object
BinaryView of type 'DyldSharedCache' failed to initialize!
No available/valid debug info parsers for `Raw` view
Found more than 'analysis.limits.stringSearch' (0x100000) strings aborting search for range: 0 - 0x33be0000
Analysis update took 12.239 seconds

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.