How sammwyy/bleeding works
Project type and purpose
• This is a cross-platform, command-line Python tool (BLEeding) for jamming and enumerating Bluetooth and BLE devices.
• No web frontend or database—just a modular CLI application that invokes Bluetooth operations via OS-specific libraries (e.g., gattlib on Linux, BlueZ on macOS, Windows Bluetooth API).
File structure
• Top-level script: bleeding/__main__.py for CLI entry point.
• Core logic: bleeding/bleeding.py (the engine) and bleeding/logger.py.
• Pluggable modules in bleeding/modules/: discover.py, enum.py, deauth.py.
• Utility libraries in bleeding/utils/: async helpers, Bluetooth wrapper, CLI parsing, MAC generation, OS abstractions.
• requirements.txt lists external dependencies.
README insights
• Commands (scan, enum, deauth) map directly to modules.
• Options and flags parsed in CLI utils, passed into module handlers.
• External dependencies (gattlib, BlueZ, etc.) handled at runtime.
Main components
a. CLI Layer
• Entry: __main__.py
• CLI utils for parsing commands & options
b. Core Engine
• bleeding.py – dispatches commands to modules
• logger.py – centralized logging
c. Module Plugins
• discover, enum, deauth – each implements a run() or similar interface
d. Utility Libraries
• Async utils: event loop, thread management
• BT utils: abstracts low-level Bluetooth and BLE operations
• OS utils: platform detection, dependency checks
• MAC utils: random MAC generation
e. External Interfaces
• OS Bluetooth stacks: BlueZ (Linux/macOS), Windows BT API
• gattlib Python binding
• Threads or async event loop
Relationships and interactions
• CLI Layer → Core Engine: passes parsed command + options
• Core Engine → Module Plugin: invokes the appropriate module’s entry point
• Module Plugin → Utility Libraries: calls BT utils, MAC utils, async utils, OS utils as needed
• Utility Libraries → External Interfaces: call into OS Bluetooth stacks or gattlib
• Core Engine & Modules → Logger: emit structured logs
Architectural patterns and design principles
• Plugin pattern: modules are interchangeable; follow a common interface (e.g., run(target, options))
• Layered architecture: Presentation (CLI), Application (engine), Domain (modules), Infrastructure (utils + external stacks)
• Separation of concerns: distinct layers and folders for core logic, modules, utils
Final checklist
• Annotations for threads/async processing where applicable
This structure will give a complete, accurate architectural overview of BLEeding’s modular CLI design and its interactions with underlying Bluetooth stacks.