From 7767872408d1078029224acd1c883abf57e05276 Mon Sep 17 00:00:00 2001 From: Thomas Hebb Date: Mon, 15 Jan 2024 11:26:25 -0500 Subject: [PATCH] Add Qualcomm QDB (Qshrink Database) format This is a very simple wrapper around compressed XML used by Qualcomm to store modem debug info. I gather that these files are used by Qualcomm's official QXDM diagnostic software, but I derived the format without reference to any documentation or tooling; it's just that simple. --- firmware/qualcomm_qdb.ksy | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 firmware/qualcomm_qdb.ksy diff --git a/firmware/qualcomm_qdb.ksy b/firmware/qualcomm_qdb.ksy new file mode 100644 index 000000000..a9b958e1e --- /dev/null +++ b/firmware/qualcomm_qdb.ksy @@ -0,0 +1,30 @@ +meta: + id: qualcomm_qdb + title: Qualcomm Qshrink hash database file + application: Qualcomm QXDM + file-extension: qdb + license: CC0-1.0 + +doc: | + This format is nothing more than zlib-compressed text appended to a trivially + simple binary header. The text, which is almost but not quite XML, maps + diagnostic codes emitted by Qualcomm modem firmware to textual log messages. + A file of this type typically resides on the "modem" partition of a Qualcomm + device with a name like "qdsp6m.qdb". + +doc-ref: + - https://github.com/mzakocs/qualcomm_baseband_scripts/blob/main/qshrink4_qdb_ghidra_script.py + +seq: + - id: magic + contents: [0x7f, "QDB"] + - id: guid + size: 0x10 + doc: Matches the content's top-level element + +instances: + content: + pos: 0x40 + size-eos: true + process: zlib + doc: zlib-compressed text containing mapping entries and metadata