A small definition-driven editor + hex viewer/editor for Project CARS CDFbin files.
- Scans a binary
.cdf/.cdfbinfile for known marker bytes - Decodes the following payload scalar types:
byte,float,int32,uint32 - Lets you edit values in-place only (the payload size must not change)
- Includes a hex viewer with click-to-select and in-place overwrite tooling
- Performs a CDF header byte-count register sanity check on open/save-as and can apply a conservative repair
⚠️ This tool modifies binary files. Always keep backups.
- Fields are defined in
CDF_DEFSasCdfFieldDefentries:section,name,marker,layout,notes
- The app scans for all occurrences of each marker, decodes its payload, and lists them in a Treeview grouped by section.
- A filter box allows quick narrowing by section/name/occurrence.
- When you select a field, the right panel shows:
- marker bytes & offsets
- payload offset
- raw payload bytes
- decoded value tuple
- You can edit via typed scalar inputs.
- Edits are applied in-place (exact same byte count as original payload).
- Bottom pane shows a classic hex dump.
- Selecting a field jumps to its marker and highlights:
- marker bytes
- payload bytes
- Clicking a byte in the hex view selects the corresponding field in the tree (where known).
- You can overwrite the selected payload bytes by pasting space-separated hex.
- Revert options exist for both scalar edits and hex overwrites.
On open and before “Save As…”, the tool checks common CDF header “byte count registers”:
R0@0x0008should match file lengthR1@0x0014should match(R3 - 0x0028)(ifR3 >= 0x0028)R2@0x0020should be end-lengthR3@0x0024should be end-start- Consistency:
R3 + R2 == file_len
If inconsistent, the app will show problems and may offer an automatic conservative repair.
- Python 3.10+ (recommended)
- Standard library only (
tkinterships with most Python installs on Windows)
Windows DPI awareness is enabled when available via
ctypes.
python cdf_editor.py