Skip to content

Instantly share code, notes, and snippets.

@beren12
beren12 / Decrypted iTunes Library.grammar
Created January 24, 2018 16:39 — forked from mrexodia/Decrypted iTunes Library.grammar
Decrypted iTunes Library File Format
<?xml version="1.0" encoding="UTF-8"?>
<ufwb version="1.9">
<grammar name="Decrypted iTunes Library" start="id:148" author="Mr. eXoDia" email="mr.exodia.tpodt@gmail.com" fileextension="itl" uti="com.apple.itunes.db">
<description>Grammar for decrypted iTunes Library files.</description>
<structure name="Defaults" id="149" repeatmin="0" repeatmax="-1" encoding="ISO_8859-1:1987" endian="little" signed="no"/>
<structure name="iTunes Library" id="148" repeatmin="0" repeatmax="-1" extends="id:149" order="variable">
<structref name="hdfm" id="152" repeatmin="0" repeatmax="-1" structure="id:151"/>
<structref name="msdh" id="154" repeatmin="0" repeatmax="-1" structure="id:153"/>
</structure>
<structure name="hdfm" id="151" length="this.headerLength" repeatmin="0" repeatmax="-1" extends="id:149" endian="big">
@beren12
beren12 / Encrypted iTunes Library.grammar
Created January 24, 2018 16:27 — forked from mrexodia/Encrypted iTunes Library.grammar
Encrypted iTunes Library File Format
<?xml version="1.0" encoding="UTF-8"?>
<ufwb version="1.9">
<grammar name="Encrypted iTunes Library" start="id:4" author="Mr. eXoDia" email="mr.exodia.tpodt@gmail.com" fileextension="itl" uti="com.apple.itunes.db">
<description>Grammar for encrypted iTunes Library files.</description>
<structure name="Defaults" id="5" encoding="ISO_8859-1:1987" endian="little" signed="no"/>
<structure name="iTunes Library" id="4" extends="id:5">
<structref name="hdfm" id="8" structure="id:7"/>
<binary name="encryptedData" id="9" length="remaining">
<description>This chunk of data is encrypted using AES/ECB/NoPadding with the key &quot;BHUILuilfghuila3&quot;. After decryption, you have to inflate the data using ZLIB.