<trclass="memdesc:ab646921aa4c83e38af36f38b8b3d068a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Parse the encryption map from PS3 disc sector 0 (big-endian on disc). <br/></td></tr>
<trclass="memdesc:aebc9066937e11649d0a81351ddd83582"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Serialize plaintext regions to little-endian binary for storage as a media tag. <br/></td></tr>
<trclass="memdesc:a49a5e6c2b524988714513c446e2d200d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Deserialize plaintext regions from little-endian binary (media tag format). <br/></td></tr>
<trclass="memdesc:a058b5191df4b4a83a6bc55052fad503f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Check whether a sector is encrypted (i.e., not in any plaintext region). <br/></td></tr>
<p>Deserialize plaintext regions from little-endian binary (media tag format). </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">data</td><td>Serialized data buffer. </td></tr>
<tr><tdclass="paramname">length</td><td>Length of data buffer. </td></tr>
<tr><tdclass="paramname">regions</td><td>Output: allocated array of plaintext regions. Caller must free(). </td></tr>
<tr><tdclass="paramname">count</td><td>Output: number of regions. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>0 on success, negative error code on failure. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="ps3__encryption__map_8c_source.html#l00117">117</a> of file <aclass="el"href="ps3__encryption__map_8c_source.html">ps3_encryption_map.c</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="ps3__encryption__map_8c_source.html#l00117">ps3_deserialize_encryption_map()</a>, and <aclass="el"href="ps3__crypto_8c_source.html#l00070">ps3_lazy_init()</a>.</p>
<p>Check whether a sector is encrypted (i.e., not in any plaintext region). </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">plaintext_regions</td><td>Array of plaintext regions. </td></tr>
<tr><tdclass="paramname">region_count</td><td>Number of regions. </td></tr>
<tr><tdclass="paramname">sector_address</td><td>Sector number to check. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>true if the sector is encrypted (not in any plaintext region). </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="ps3__encryption__map_8c_source.html#l00151">151</a> of file <aclass="el"href="ps3__encryption__map_8c_source.html">ps3_encryption_map.c</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="read_8c_source.html#l00352">aaruf_read_sector()</a>, <aclass="el"href="write_8c_source.html#l00152">aaruf_write_sector()</a>, and <aclass="el"href="ps3__encryption__map_8c_source.html#l00151">ps3_is_sector_encrypted()</a>.</p>
<p>Parse the encryption map from PS3 disc sector 0 (big-endian on disc). </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">sector0</td><td>Pointer to the 2048-byte sector 0 data. </td></tr>
<tr><tdclass="paramname">length</td><td>Length of sector0 data (must be >= 264). </td></tr>
<tr><tdclass="paramname">regions</td><td>Output: allocated array of plaintext regions. Caller must free(). </td></tr>
<tr><tdclass="paramname">count</td><td>Output: number of regions. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>0 on success, negative error code on failure. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="ps3__encryption__map_8c_source.html#l00048">48</a> of file <aclass="el"href="ps3__encryption__map_8c_source.html">ps3_encryption_map.c</a>.</p>
<p>Serialize plaintext regions to little-endian binary for storage as a media tag. </p>
<p>Format: [4B region_count LE] + region_count × [4B start LE, 4B end LE]</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">regions</td><td>Array of plaintext regions. </td></tr>
<tr><tdclass="paramname">count</td><td>Number of regions. </td></tr>
<tr><tdclass="paramname">out_data</td><td>Output: allocated buffer. Caller must free(). </td></tr>
<tr><tdclass="paramname">out_length</td><td>Output: size of the buffer in bytes. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>0 on success, negative error code on failure. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="ps3__encryption__map_8c_source.html#l00094">94</a> of file <aclass="el"href="ps3__encryption__map_8c_source.html">ps3_encryption_map.c</a>.</p>
<pclass="reference">References <aclass="el"href="ps3__encryption__map_8h_source.html#l00039">PS3_MAX_PLAINTEXT_REGIONS</a>, <aclass="el"href="ps3__encryption__map_8c_source.html#l00094">ps3_serialize_encryption_map()</a>, and <aclass="el"href="ngcw__junk_8c_source.html#l00043">write_le32()</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="ps3__encryption__map_8c_source.html#l00094">ps3_serialize_encryption_map()</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="ps3__encryption__map_8c_source.html#l00028">28</a> of file <aclass="el"href="ps3__encryption__map_8c_source.html">ps3_encryption_map.c</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="ps3__encryption__map_8c_source.html#l00048">ps3_parse_encryption_map()</a>, and <aclass="el"href="ps3__encryption__map_8c_source.html#l00028">read_be32()</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="ps3__encryption__map_8c_source.html#l00034">34</a> of file <aclass="el"href="ps3__encryption__map_8c_source.html">ps3_encryption_map.c</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="ps3__encryption__map_8c_source.html#l00040">40</a> of file <aclass="el"href="ps3__encryption__map_8c_source.html">ps3_encryption_map.c</a>.</p>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.18.0 </li>