


# -*- coding: utf-8 -*-from __future__ import annotationsimport argparseimport zlibfrom pathlib import Pathdef main() -> None:ap = argparse.ArgumentParser(description="Decompress DJI Assistant zlib DAT export")ap.add_argument("-d", required=True, type=Path, help="input DAT path")ap.add_argument("-o", required=True, type=Path, help="output decompressed path")args = ap.parse_args()raw = args.d.read_bytes()plain = zlib.decompress(raw)args.o.parent.mkdir(parents=True, exist_ok=True)args.o.write_bytes(plain)print(f"in={args.d} ({len(raw)}) out={args.o} ({len(plain)})")if __name__ == "__main__":main()

a6 | 20 00 00 00 | fa 71 | 2f 66 6c 79 63 74 72 6c 2f 6c 61 74 65 73 74 ...
│ │ │ └── 路径 "/flyctrl/latest"
│ │ └── 未知 2 字节
│ └── 长度 = 0x20 = 32
└── 魔数
session = AES-CMAC(master, 0x01||"LOG"||0x00||LOGH[0x18:0x5C]||0x80)plain = AES-128-CBC(session, IV=0)(cipher)
scram_key_plain = AES-ECB(UFIE).decrypt(scram_key_enc)payload_plain = AES-CTR(scram_key_plain, IV=16×0x00).decrypt(payload)
xV4 | ||
偏移 | 内容 | 熵 | 状态 |
短文件头 | 可读 | ||
LDR1加载器区 | 7.0 | ||
IMAGE ENC KEY WM160 | |||
153333 | IM*H + PRAKTBIE + rtos | ||
13216886 | IM*H + PRAKTKIE + linux | ||
17469843 | SquashFS 4.0 gzip,143 inodes | ||
18940567 | SquashFS 4.0 xz,676 inodes |