Repository navigation
pdb: write History rows in rekordbox's inline-string layout (#53) - #54
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Fixes #53. Shoutout to @Unkown607 for the report and patch!
Vynull-generated
export.pdbfiles failed to parse in third-party tools (rekordcrate and others) with "bad magic" on the History table.makeHistoryRowwrote table 0x13 with a u16 offset table at 0x08 (anofs_strings[3]+ pad layout), but no real rekordbox export looks like that. A parser reading 0x08 as the table's u32 magic sees0x001B0010and 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
0x1E19magic between date and version,index_shift0 (single row = slot 0), and a0x00pad after the empty label.num_tracksstays 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.TestMakeHistoryRowLayoutpins the new layout (asserts the u32 zero magic at 0x08 and the0x1E19separator after the date) so it can't silently regress.Hardware testing
Checklist
go build ./...,go vet ./..., andgo test ./...passgofmt -l .is cleanGPL-3.0-or-later)