Skip to content

peplxx/bldd

Repository files navigation

BLDD - Backward LDD

BLDD (Backward LDD) is a command-line utility that finds executable files depending on specified shared libraries. Unlike the traditional ldd command which shows dependencies of a single binary, BLDD scans directories to discover which executables link against given libraries.

Features

  • Scan directories for executables using specific shared libraries
  • Support for multiple architectures: x86, x86_64, ARM, AArch64
  • Cross-platform support for ELF (Linux) and Mach-O (macOS) binaries
  • Filter by library name (partial matching)
  • Filter by architecture and binary format
  • Configurable output formats
  • Verbose and recursive scanning options
  • Configuration file support

Installation

Build from source

Requirements

  • C++17 compiler (GCC 7+, Clang 5+)
  • CMake 3.16+
  • Git

Steps

# Clone the repository
git clone https://github.com/peplxx/bldd.git
cd bldd

# Configure and build
cmake -B build
cmake --build build

# Install (optional)
cd build
sudo make install

Usage

bldd [OPTIONS]

Basic Examples

# Find all executables using libc in /usr/bin
bldd -d /usr/bin -l libc

# Find executables using libssl or libcrypto, output to file
bldd -d /usr/bin -l libssl -l libcrypto -o report.txt

# Scan multiple directories for x86_64 binaries only
bldd -d /usr/bin -d /usr/local/bin --arch x86_64

# Scan with verbose output
bldd -d /usr/bin -v

# Scan without recursion
bldd -d /opt --no-recursive

Options

Option Description
-d, --directory Directory to scan for executables (multiple allowed)
-l, --library Library name to search for (multiple allowed, partial match)
-a, --arch Filter by architecture: x86, x86_64, armv7, aarch64
-o, --output Output file for the report (default: stdout)
-f, --format Output format: txt
--bformat Filter by binary format: elf, macho, all
-c, --config Path to configuration file
-v, --verbose Enable verbose output
--no-recursive Do not scan directories recursively
--examples Show usage examples

Configuration File

BLDD supports configuration files for persistent settings.

Testing

BLDD includes unit and end-to-end tests:

Running tests
# Build with tests
cmake -B -DBUILD_TESTING=ON build
cmake --build build

# Run unit tests
./build/bin/tests

# Run end-to-end tests
cmake -B -DBUILD_TESTING=ON -DBUILD_E2E=ON build
cmake --build build

./build/bin/tests

# Run cross-platform end-to-end script
./scripts/run-e2e.sh

Playground

A Docker-based playground environment is available for testing:

Using the playground
# Start the playground
docker-compose -f playground/docker-compose.yaml up -d
docker-compose -f playground/docker-compose.yaml exec playground bash

License

This project is licensed under the MIT License - see the LICENSE file for details.

Bug Reports

Report bugs at: https://github.com/peplxx/bldd/issues

About

Backward ldd utility that scans directories to find executable files linked against specified shared libraries.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors