Blue-Sync is a Python script designed to manage Bluetooth device information on a Linux system.
It reads the LTK (Long Term Key) values from a Windows registry file and updates the corresponding Bluetooth device information in the /var/lib/bluetooth directory.
The script ensures that the device directories are correctly named and the info files contain the correct LTK values.
- Parses the Windows registry file to extract LTK values.
- Matches Bluetooth devices based on their MAC addresses.
- Updates the
infofiles with the correct LTK values. - Ensures that device directories are correctly named.
- Python 3.6 or higher
regipylibrary for parsing Windows registry filessudoaccess to read and write files in/var/lib/bluetooth
-
Clone the repository:
git clone https://github.com/yourusername/blue-sync.git cd blue-sync -
Install the required dependencies:
pip install -r requirements.txt
-
Mount the NTFS partition containing the Windows registry file.
-
Run the script:
python blue-sync.py
sudo mount /dev/sdb1 /mnt/windows
python blue-sync.py
The script does not require any configuration files. It automatically detects the necessary registry file and Bluetooth device directories.
blue-sync.py: The main script file.requirements.txt: List of required Python packages.README.md: This file.
| Function Name | Description |
|---|---|
format_mac_address(mac) |
Formats the MAC address to a colon-separated string. |
parse_registry_key_to_dict(key, result) |
Parses the registry key to extract LTK values and stores them in a dictionary. |
parse_registry(reg_path) |
Parses the Windows registry file to extract LTK values. |
get_device_directory() |
Lists the Bluetooth device directories in /var/lib/bluetooth. |
read_file_with_sudo(file_path) |
Reads a file using sudo. |
write_file_with_sudo(file_path, content) |
Writes content to a file using sudo. |
process_device(device_path, ltk_map) |
Processes each Bluetooth device, updates the info file, and renames the device directory if necessary. |
list_ntfs_mount_points() |
Lists all mounted NTFS partitions. |
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
- Fork the repository.
- Create a new branch: git checkout -b feature/your-feature.
- Make your changes and commit them: git commit -m 'Add some feature'.
- Push to the branch: git push origin feature/your-feature.
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
If you have any questions or need further assistance, feel free to contact the maintainer:
- Email: [email protected]
- GitHub: @sink