dyld_shared_cache processing / Single-Image loading for BinaryNinja

Overview

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.

You might also like...
《Single Image Reflection Removal Beyond Linearity》(CVPR 2019)

Single-Image-Reflection-Removal-Beyond-Linearity Paper Single Image Reflection Removal Beyond Linearity. Qiang Wen, Yinjie Tan, Jing Qin, Wenxi Liu, G

Official PyTorch code of Holistic 3D Scene Understanding from a Single Image with Implicit Representation (CVPR 2021)
Official PyTorch code of Holistic 3D Scene Understanding from a Single Image with Implicit Representation (CVPR 2021)

Implicit3DUnderstanding (Im3D) [Project Page] Holistic 3D Scene Understanding from a Single Image with Implicit Representation Cheng Zhang, Zhaopeng C

Learning to Reconstruct 3D Manhattan Wireframes from a Single Image
Learning to Reconstruct 3D Manhattan Wireframes from a Single Image

Learning to Reconstruct 3D Manhattan Wireframes From a Single Image This repository contains the PyTorch implementation of the paper: Yichao Zhou, Hao

Aerial Single-View Depth Completion with Image-Guided Uncertainty Estimation (RA-L/ICRA 2020)
Aerial Single-View Depth Completion with Image-Guided Uncertainty Estimation (RA-L/ICRA 2020)

Aerial Depth Completion This work is described in the letter "Aerial Single-View Depth Completion with Image-Guided Uncertainty Estimation", by Lucas

This is the official repository for evaluation on the NoW Benchmark Dataset. The goal of the NoW benchmark is to introduce a standard evaluation metric to measure the accuracy and robustness of 3D face reconstruction methods from a single image under variations in viewing angle, lighting, and common occlusions. Learning to Reconstruct 3D Non-Cuboid Room Layout from a Single RGB Image
Learning to Reconstruct 3D Non-Cuboid Room Layout from a Single RGB Image

NonCuboidRoom Paper Learning to Reconstruct 3D Non-Cuboid Room Layout from a Single RGB Image Cheng Yang*, Jia Zheng*, Xili Dai, Rui Tang, Yi Ma, Xiao

Selective Wavelet Attention Learning for Single Image Deraining

SWAL Code for Paper "Selective Wavelet Attention Learning for Single Image Deraining" Prerequisites Python 3 PyTorch Models We provide the models trai

PyTorch code for our ECCV 2020 paper "Single Image Super-Resolution via a Holistic Attention Network"

HAN PyTorch code for our ECCV 2020 paper "Single Image Super-Resolution via a Holistic Attention Network" This repository is for HAN introduced in the

Code for generating a single image pretraining dataset
Code for generating a single image pretraining dataset

Single Image Pretraining of Visual Representations As shown in the paper A critical analysis of self-supervision, or what we can learn from a single i

Comments
  • TypeError: cannot unpack non-iterable NoneType object

    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
    
    
    opened by torarnv 1
  • prep for plugin manager

    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!

    opened by psifertex 1
  • fix relative imports for built-in BN Py 3.8.9 on MacOS

    fix relative imports for built-in BN Py 3.8.9 on MacOS

    I'm not sure whether it's the exact python version or the fact that I'm using the BN shipped Python versus homebrew / ports but I'm unable to use the plugin as-is on MacOS without this change. I don't know how much this versioned DyldExtractor has differed, happy to test/submit upstream in the parent repo if you prefer.

    opened by psifertex 0
Releases(1.0.0)
Owner
cynder
macOS/iOS development @ reverse engineering chick. // maintainer of the iPhone Dev Wiki (https://iphonedev.wiki)
cynder
Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk

Annoy Annoy (Approximate Nearest Neighbors Oh Yeah) is a C++ library with Python bindings to search for points in space that are close to a given quer

Spotify 10.6k Jan 4, 2023
Simple tools for logging and visualizing, loading and training

TNT TNT is a library providing powerful dataloading, logging and visualization utilities for Python. It is closely integrated with PyTorch and is desi

null 1.5k Jan 2, 2023
Calling Julia from Python - an experiment on data loading

Calling Julia from Python - an experiment on data loading See the slides. TLDR After reading Patrick's blog post, we decided to try to replace C++ wit

Abel Siqueira 8 Jun 7, 2022
Python code for loading the Aschaffenburg Pose Dataset.

Aschaffenburg Pose Dataset (APD) This repository contains Python code for loading and filtering the Aschaffenburg Pose Dataset. The dataset itself and

null 1 Nov 26, 2021
Pytorch implementation of MLP-Mixer with loading pre-trained models.

MLP-Mixer-Pytorch PyTorch implementation of MLP-Mixer: An all-MLP Architecture for Vision with the function of loading official ImageNet pre-trained p

Qiushi Yang 2 Sep 29, 2022
Official implementation of "SinIR: Efficient General Image Manipulation with Single Image Reconstruction" (ICML 2021)

SinIR (Official Implementation) Requirements To install requirements: pip install -r requirements.txt We used Python 3.7.4 and f-strings which are in

null 47 Oct 11, 2022
Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set (CVPRW 2019). A PyTorch implementation.

Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set —— PyTorch implementation This is an unofficial offici

Sicheng Xu 833 Dec 28, 2022
Image Processing, Image Smoothing, Edge Detection and Transforms

opevcvdl-hw1 This project uses openCV and Qt to achieve the requirements. Version Python 3.7 opencv-contrib-python 3.4.2.17 Matplotlib 3.1.1 pyqt5 5.1

Kenny Cheng 3 Aug 17, 2022
《Deep Single Portrait Image Relighting》(ICCV 2019)

Ratio Image Based Rendering for Deep Single-Image Portrait Relighting [Project Page] This is part of the Deep Portrait Relighting project. If you find

null 62 Dec 21, 2022
CoReNet is a technique for joint multi-object 3D reconstruction from a single RGB image.

CoReNet CoReNet is a technique for joint multi-object 3D reconstruction from a single RGB image. It produces coherent reconstructions, where all objec

Google Research 80 Dec 25, 2022