Crates.io | bdb_parser |
lib.rs | bdb_parser |
version | 0.1.1 |
source | src |
created_at | 2024-06-28 00:59:03.149482 |
updated_at | 2024-07-02 19:53:20.443351 |
description | A parser for the BDB file format |
homepage | |
repository | https://github.com/jscatena88/bdb_parser |
max_upload_size | |
id | 1286344 |
size | 28,821 |
BDB Parser is a Rust-based library and binary crate designed to parse .BDB
files, which contain a database of race tracks around the world. The library provides functionality to read the binary format of the .BDB
file and store it into the internal defined data model. The internal data model implements serde serialization and deserialization. The binary crate offers a command-line tool for parsing .BDB
files and displaying the output as a JSON string.
This parser was written as a complete black box reverse engineering exercise. It is not endorsed by the original author of the file format. The file was found on the VBOX Motorsports website, and seems to be used to store race track data for some of their hardware products. I found the file compressed into the TRACKS.ZIP
file available on this page: https://www.vboxmotorsport.co.uk/index.php/us/customer-ct-track-database . Specifically, I used the "VBOX Touch" download.
The majority of the reverse engineering work was done using the excellent ImHex Tool, in the course of that work I created a pattern file that is now available in the repo at reverse_engineering/TrackDataBase.pat
. This pattern file is very incomplete, less complete then the parsing done in this rust codebase. However it may have some interest as a working document, showing where I was when I transitioned to implementing the format in Rust.
.BDB
files containing race track data.This file format was manually reverse engineered, there are some unknown fields in the file that cannot be parsed correctly. For detailed information on the file structure, refer to the BDB File Format Documentation.
Clone the repository:
git clone https://github.com/jscatena88/bdb_parser.git
cd bdb_parser
Build the project:
cargo build
To run the parser, use the following command:
cargo run <path_to_bdb_file>
Example:
cargo run -- TRACKS.BDB
The output will be a JSON representation of the .BDB
file content, printed to the console.
src/bin/main.rs
: Entry point of the application. Handles argument parsing and file reading.src/lib.rs
: Library entry point. Exports the main parsing functions and data structures.src/models.rs
: Contains data structures representing the parsed data.src/parsers.rs
: Contains functions to parse different sections of the .BDB
file.Contributions are welcome! Please fork the repository and submit a pull request, or if you have any insight on the unknown fields in the file format, please open an issue.
This project is licensed under the MIT License. See the LICENSE
file for details.