<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.3dbrew.org/w/index.php?action=history&amp;feed=atom&amp;title=CTPK</id>
	<title>CTPK - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.3dbrew.org/w/index.php?action=history&amp;feed=atom&amp;title=CTPK"/>
	<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=CTPK&amp;action=history"/>
	<updated>2026-04-15T02:45:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=CTPK&amp;diff=20480&amp;oldid=prev</id>
		<title>RicBent: CTPK file format</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=CTPK&amp;diff=20480&amp;oldid=prev"/>
		<updated>2017-11-24T23:10:30Z</updated>

		<summary type="html">&lt;p&gt;CTPK file format&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:File formats]]&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;CTPK - CTR Texture PacKage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
CTPK is a container file for one or multiple textures that are in various formats readable by the 3ds system.&lt;br /&gt;
Offsets are relative to the beginning of the header section unless specified.&lt;br /&gt;
&lt;br /&gt;
== CTPK Header ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Magic &amp;quot;CTPK&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| Version?&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| Number of Texture Entries&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture Data section offset&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture Data section size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| Hash section offset&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| Conversion Info section offset&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x8&lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Info Entry ==&lt;br /&gt;
The Header block is followed by a texture info entry for each texture in the container.&lt;br /&gt;
This block is usually followed by the bitmap size arrays and then the file paths.&lt;br /&gt;
0x20 byte aligned.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| File path Offset&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture Data Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture Data Offset (Relative to texture data block offset)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Texture Format&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x2&lt;br /&gt;
| Width&lt;br /&gt;
|-&lt;br /&gt;
| 0x12&lt;br /&gt;
| 0x2&lt;br /&gt;
| Height&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x1&lt;br /&gt;
| Mip Level&lt;br /&gt;
|-&lt;br /&gt;
| 0x15&lt;br /&gt;
| 0x1&lt;br /&gt;
| Type (0: Cube Map, 1: 1D, 2: 2D)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16&lt;br /&gt;
| 0x2&lt;br /&gt;
| Cube Map Related&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| Bitmap Size Array Offset (Relative to to this block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| Unix Timestamp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Hash Block Entry ==&lt;br /&gt;
The texture info block is followed by a hash entry for each texture entry.&lt;br /&gt;
0x8 byte aligned.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Crc32 of the file path&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Index&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Conversion Info Block Entry ==&lt;br /&gt;
The hash block is followed by a conversion info entry for each texture entry.&lt;br /&gt;
0x4 byte aligned.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Length&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Texture Format&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Compressed&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| ETC1 Related (Quality?)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Data Block ==&lt;br /&gt;
This block and all it&amp;#039;s texture entries are 0x80 byte aligned.&lt;br /&gt;
&lt;br /&gt;
== Texture Formats ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| RGBA8888&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| RGB888&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| RGBA5551&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| RGB565&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| RGBA4444&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| ETC1&lt;br /&gt;
|-&lt;br /&gt;
| 0xD&lt;br /&gt;
| ETC1 + Alpha&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>RicBent</name></author>
	</entry>
</feed>