How arxsys/dff works
Project type and purpose
• Project type: Open-source, modular digital forensics platform
• Purpose: Provide a core C/C++ API for low-level disk and file-system access, extendable via Python-based modules, with both CLI and Qt-based GUI frontends, to automate forensic analysis and generate reports.
File structure
• Top-level: build scripts and configuration (CMakeLists.txt, cmake_modules/, dff-build.sh)
• Core code: dff/ – contains CMakeLists (to build the C/C++ API), SWIG interfaces (__init__.py.in), and subpackages:
• api/ – Python wrappers over the core API
• modules/ – Python-based forensic plugins (file-system parsers, metadata extractors, viewers)
• ui/ – Qt GUI components (widgets, windows)
• unsupported/ – experimental or legacy modules
• Frontends: dff.py (CLI), dff-gui.py (GUI launcher)
• Tests: testsuite/ with unit tests and data sets
• Documentation: doc/, README.md, Doxyfile
README insights
• Modular architecture: core + modules
• Scriptability: Python API and command-line interface
• Genericity: OS-agnostic core using libbfio, libewf, libpff, libvshadow
• Key features implemented as modules (filesystem mounts, metadata extraction, timeline, Volatility integration)
Main components and relationships
a. Components
1. Core Forensics Engine (C/C++ API)
2. SWIG-generated Python Bindings
3. Plugin Modules (Python)
4. Frontends: CLI (dff.py) and GUI (dff-gui.py + Qt)
5. External Forensic Libraries (libbfio, libewf, libpff, libvshadow)
6. Optional Extensions (Volatility, PyRegfi, pefile)
7. Test Harness (testsuite/)
b. Interactions
• Frontends invoke Python Bindings → call Core API
• Plugin Modules register with the API, receive data handles, process forensic images
• Core API calls into external C libraries for image and filesystem I/O
• Modules may call optional Python libraries (Volatility, pefile)
• Output modules generate HTML reports, extracted files, timelines
• Tests directly invoke the Python API to verify module behavior
c. Architectural patterns
• Layered architecture:
Layer 1: External Forensic I/O Libraries
Layer 2: Core API (C/C++)
Layer 3: Python Bindings (SWIG)
Layer 4: Plugin Modules
Layer 5: Frontends (CLI/GUI)
• Plugin pattern: modules conform to a common API and can be dynamically loaded
• MV* in the GUI: Qt widgets (View), module controllers (Controller), data model provided by the Core API
d. Key technologies
• Build: CMake, SWIG, Python-Qt4
• Core dependencies: libbfio, libewf, libpff, libvshadow
• Scripting: Python 2.7 with PyQt4
• GUI: Qt4 via PyQt4
• Testing: unittest framework, custom test data