Inspect dynamic dependencies of Mach-O binaries recursively

Overview

dylibtree

dylibtree is a tool for inspecting the dynamic dependencies of a Mach-O binary recursively. It can be useful to understand what library loads another library that you may not expect. If it helps you can think of dylibtree as a recursive otool -L, or as a Mach-O version of lddtree.

Usage

To list all recursive dynamic dependencies, just pass a binary:

$ dylibtree /usr/bin/xcrun
/usr/bin/xcrun:
  /usr/lib/libxcselect.dylib:
    /usr/lib/libSystem.B.dylib:
      /usr/lib/system/libcache.dylib:
        /usr/lib/system/libsystem_malloc.dylib:
          /usr/lib/system/libcompiler_rt.dylib:
            /usr/lib/system/libunwind.dylib:
              /usr/lib/system/libsystem_malloc.dylib
...

You can limit the depth (and in turn the output) with --depth N:

$ dylibtree /usr/bin/xcrun --depth 2
/usr/bin/xcrun:
  /usr/lib/libxcselect.dylib:
    /usr/lib/libSystem.B.dylib:
  /usr/lib/libSystem.B.dylib

You can also exclude various prefixes depending on what you're investigating with --ignore-prefix:

$ dylibtree /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/MacOS/Instruments --ignore-prefix /usr/lib --ignore-prefix /System/Library
/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/MacOS/Instruments:
  @rpath/DVTInstrumentsUtilities.framework/Versions/A/DVTInstrumentsUtilities:
  @rpath/DVTInstrumentsFoundation.framework/Versions/A/DVTInstrumentsFoundation:
    @rpath/CoreSymbolicationDT.framework/Versions/A/CoreSymbolicationDT:
...

Installation

brew install keith/formulae/dylibtree

Implementation notes

  • dylibtree uses the dyld shared cache, or other platform's runtime roots to discover dylibs. If you want to run dylibtree on a binary for a non macOS platform you must have that platform installed in Xcode, and must have built to a device with that platform to populate the symbols.
  • dylibtree looks up the current locations for the runtime root for a platform, that can change over time, or you might download one manually that you want to use instead. If so you can pass --runtime-root or --shared-cache-path to override the default discovery. If the location has changed please submit an issue or PR so we can update it for everyone.
  • dyld shared cache extraction uses Xcode's internal library, which means your currently selected Xcode version must support any shared caches being extracted. If you're on a beta version you'll likely need to have a beta Xcode selected (or set with DEVELOPER_DIR).
You might also like...
Like a cell, but make lifetimes dynamic instead of ownership

LendingCell is a mutable container that allows you to get an owned reference to the same object. When the owned reference is dropped, ownership return

Apple dynamic HEIF wallpapers on GNU/Linux.
Apple dynamic HEIF wallpapers on GNU/Linux.

timewall Apple dynamic HEIF wallpapers on GNU/Linux. Features: Support for original HEIF/HEIC dynamic wallpaper files used in MacOS. Support for all s

Dynamic dependency injection library for rust.

DDI (dynamic dependency injection) This library provides a generic dependency injection container that can be easily integrated into any application a

AI-powered game engine for dynamic, personalized experiences in evolving worlds. Ethical, accessible, inclusive.

ARCADIA: Advanced and Responsive Computational Architecture for Dynamic Interactive Ai: A Whitepaper By Reuven Cohen (rUv) Introduction Imagine a futu

A versatile and dynamic music bot designed to elevate the musical experience within Discord servers.

Masayoshi Masayoshi is a discord music bot written in Rust for making a great experience within Discord servers with support to Youtube, SoundCloud, S

Dynamic, Type-Erased Key-Value Maps in Rust

Dynamic Objects in Rust Do you love Rust but are tired of being constrained by static typing when you need a map to hold values of different types? Do

Meta framework. Support for dynamic plug-ins and AOP

Kokoro Dynamic publish-subscribe pattern framework. Support for dynamic plug-ins and AOP Not yet stable, do not use in production !! 下面的内容有些老旧了,但是 exa

Pure-Rust rewrite of the Linux fontconfig library (no system dependencies) - using ttf-parser and allsorts

rust-fontconfig Pure-Rust rewrite of the Linux fontconfig library (no system dependencies) - using allsorts as a font parser in order to parse .woff,

A CLI tool that allow you to create a temporary new rust project using cargo with already installed dependencies
A CLI tool that allow you to create a temporary new rust project using cargo with already installed dependencies

cargo-temp A CLI tool that allow you to create a new rust project in a temporary directory with already installed dependencies. Install Requires Rust

Releases(0.1.0)
Owner
Keith Smiley
Principal Engineer at Lyft, maintainer of bazel's iOS support, creator of the Mobile Native Foundation, LLVM & Swift contributor
Keith Smiley
Sniffer - a tool to quickly inspect csv and flat-file files for basic information

sniffer sniffer is a tool to quickly inspect csv and flat-file files for basic information. Need to see how many rows are in a csv file? Want to see t

Daniel B 10 Apr 4, 2023
Filter, Sort & Delete Duplicate Files Recursively

Deduplicator Find, Sort, Filter & Delete duplicate files Usage Usage: deduplicator [OPTIONS] [scan_dir_path] Arguments: [scan_dir_path] Run Dedupl

Sreedev Kodichath 108 Jan 27, 2023
PyOxidizer is a utility for producing binaries that embed Python

PyOxidizer is a utility for producing binaries that embed Python. The over-arching goal of PyOxidizer is to make complex packaging and distribution problems simple so application maintainers can focus on building applications instead of toiling with build systems and packaging tools.

Gregory Szorc 4.5k Jan 4, 2023
🧰 Download pre-built binaries of all your favourite tools with a single command

tool-sync tool-sync is a CLI tool that solves one problem: ?? Download pre-built binaries of all your favourite tools with a single command. tool-sync

Dmitrii Kovanikov 50 Jan 1, 2023
compile TypeScript or JavaScript to binaries

the powr project Development is paused until 2023. ?? powr aims to be a javascript/typescript engine to power serverless functions over the web. the j

powr.js 18 Dec 29, 2022
A rust library that allows you to host the CLR and execute dotnet binaries.

ClrOxide ClrOxide is a rust library that allows you to host the CLR and dynamically execute dotnet binaries. I wanted to call it Kepler for no particu

YK 94 Apr 12, 2023
Web-based tool that allows browsing and comparing symbol and type information of Microsoft Windows binaries across different versions of the OS.

WinDiff About WinDiff is an open-source web-based tool that allows browsing and comparing symbol and type information of Microsoft Windows binaries ac

Erwan Grelet 208 Jun 15, 2023
Scan the symbols of all ELF binaries in all Arch Linux packages for usage of malloc_usable_size

Scan the symbols of all ELF binaries in all Arch Linux packages for usage of malloc_usable_size (-D_FORTIFY_SOURCE=3 compatibility)

null 3 Sep 9, 2023
Dead simple, memoized cargo subcommand to hoist cargo-built binaries into the current working directory, written in Rust.

cargo-hoist Dead simple cargo subcommand to hoist cargo-built binaries into scope. stable Install | User Docs | Crate Docs | Reference | Contributing

refcell.eth 6 Nov 9, 2023
An embeddable dynamic programming language for Rust.

rune Visit the site ?? - Read the book ?? An embeddable dynamic programming language for Rust. Contributing If you want to help out, there should be a

The Rune Programming Language 1.1k Dec 27, 2022