A definition-driven binary editor and hex viewer for Project CARS Gearbox (GDF) files, designed for safe, in-place modification of known gearbox parameters such as primary/final gears and bevel gears.
This tool scans a GDF (or CDFBIN) file for known byte markers, decodes the associated payloads, and presents them in a structured UI alongside a synchronized hex view. All edits preserve the original file layout and size.
⚠️ This tool modifies binary game files. Always keep backups.
- Gearbox fields are defined via byte markers and payload layouts
- Each occurrence is discovered dynamically (no fixed offsets)
- Fields are grouped by logical section (e.g.
GEARBOX) - Supports repeated fields (multiple gears)
- Edit decoded values (bytes, ints, floats) via form controls
- In-place only edits — payload size must not change
- Immediate validation (range checks, size checks)
- Per-field revert to original value
- Automatically computes and displays gear ratios
- Primary/Final and Bevel gears shown as:
(Driver, Driven) ratio=Driven/Driver
- Classic hex + ASCII dump
- Selecting a field highlights:
- marker bytes
- payload bytes
- Click any known byte in hex view to jump back to its field
- Hex overwrite editor (same-length only)
- Revert hex regions to original file contents
On open and save-as, the tool validates key Project CARS GDF header registers:
0x08→ total file length0x14→ gear block length (file_len - 0x1C)
If mismatches are found:
- Issues are reported clearly
- A conservative auto-repair can be applied
The editor can open:
.gdf.cdfbin.cdf
(File dialog also allows opening any binary file.)
- Python 3.10+ recommended
- Standard library only:
tkinter,ttkstruct,dataclasses,typing- On Windows, DPI awareness is enabled automatically (if supported)
python gdf_editor.pyThen use File → Open… to load a gearbox file.
Each field is defined by:
- a marker byte sequence
- a payload layout (e.g.
("byte", "byte"))
Example (simplified):
CdfFieldDef(
"PrimaryOrFinalGear",
"GEARBOX",
b"\x24\x9D\x58\xF9\x64\x02",
("byte", "byte"),
)The parser:
- Finds all occurrences of the marker
- Decodes the payload immediately following it
- Tracks offsets for safe overwrite
All edits must:
- overwrite exactly the same number of bytes
- remain within the original file bounds
This ensures:
- no offset shifts
- no corruption of following structures
- compatibility with the game’s loader
- Tree view of discovered fields
- Grouped by section
- Filter box for quick searching
- Field metadata (offsets, raw bytes, layout)
- Editable scalar values
- Apply / Revert controls
- Contextual notes about gearbox structure
- Hex viewer (paged)
- Jump to offset
- Highlighted marker and payload regions
- Hex overwrite & revert controls
- No support for inserting or removing data
- Only fields defined in
GDF_DEFSare decoded - Marker corruption will prevent re-parsing of that field
- This is not a full GDF schema interpreter — it is a targeted gearbox editor
To add support for more gearbox fields:
- Identify the marker bytes in the GDF
- Determine the payload layout
- Add a new
CdfFieldDefentry toGDF_DEFS - Re-run the editor
Example layouts:
"byte"→ 1 byte unsigned"int32"→ 4 byte signed"uint32"→ 4 byte unsigned"float"→ IEEE-754 float (little-endian)
- Always keep a copy of the original file
- Make small changes and test in-game
- Use header auto-repair only if you understand the implications
