Skip to content

pdb: write History rows in rekordbox's inline-string layout (#53) - #54

Merged
vynulldev merged 1 commit into
mainfrom
fix-history-row-layout
Oct 7, 2026
Merged

vynulldev merged 1 commit into
mainfrom
fix-history-row-layout

Conversation

@vynulldev

Copy link
Copy Markdown
Owner

What & why

Fixes #53. Shoutout to @Unkown607 for the report and patch!

Vynull-generated export.pdb files failed to parse in third-party tools (rekordcrate and others) with "bad magic" on the History table. makeHistoryRow wrote table 0x13 with a u16 offset table at 0x08 (an ofs_strings[3] + pad layout), but no real rekordbox export looks like that. A parser reading 0x08 as the table's u32 magic sees 0x001B0010 and rejects the row.

@Unkown607 (#53) did all the work here: a byte-for-byte comparison of three independent real exports (rb 6.x, 2024-02) against a vynull v0.4.0 export, cross-checked against rekordcrate's History struct, pinning the real layout and supplying a patch that re-parses cleanly.

The row now matches real exports: a u32 zero magic at 0x08, then the date, version ("1000") and label DeviceSQLStrings inline with a u16 0x1E19 magic between date and version, index_shift 0 (single row = slot 0), and a 0x00 pad after the empty label.

num_tracks stays where it was, at 0x04 as a u32. That is the one field in this row a deck is known to react to (0 makes it treat the USB as "no real export" and suppress advanced features), so the behaviour that depends on it is unchanged. This change only brings the string area into line with what real rekordbox writes. No vynull reader parses table 0x13, so nothing on our side depends on the old layout. TestMakeHistoryRowLayout pins the new layout (asserts the u32 zero magic at 0x08 and the 0x1E19 separator after the date) so it can't silently regress.

Hardware testing

  • Tested on: loaded a generated USB on a CDJ-2000NXS2

Checklist

  • go build ./..., go vet ./..., and go test ./... pass
  • gofmt -l . is clean
  • New source files carry an SPDX header (GPL-3.0-or-later)
  • Tested on real hardware (deck + firmware noted above), or this change doesn't affect deck behaviour
  • I agree my contribution is licensed under the project's GPLv3

makeHistoryRow wrote the History table (0x13) with a u16 offset table at
0x08, a layout that does not occur in real rekordbox exports. Third-party
parsers (rekordcrate) read that offset as the u32 magic and reject the
table with "bad magic", so vynull-generated export.pdb files failed to
parse in other software.

Write the inline-string form real exports use instead: a u32 zero magic at
0x08, then the date/version/label DeviceSQLStrings inline with a 0x1E19
magic between date and version, index_shift 0, and a 0x00 pad after the
empty label. Verified byte-for-byte against three real exports and
re-parsed with rekordcrate by the reporter.

num_tracks stays at 0x04 (the field the deck is known to react to), so this
change only brings the string area in line with what real rekordbox writes.
No vynull reader parses table 0x13, so the change is self-contained. Adds a
layout regression test.

Reported with a full byte-level analysis and a validated patch in #53.
@vynulldev
vynulldev marked this pull request as ready for review October 6, 2026 16:52
@vynulldev
vynulldev merged commit 2bcd104 into main Oct 7, 2026
1 check passed
@vynulldev
vynulldev deleted the fix-history-row-layout branch October 7, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

History table (0x13) row format doesn't match real rekordbox exports

1 participant