<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.wexosmk.xyz/index.php?action=history&amp;feed=atom&amp;title=CTPK_%28File_Format%29</id>
	<title>CTPK (File Format) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.wexosmk.xyz/index.php?action=history&amp;feed=atom&amp;title=CTPK_%28File_Format%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=CTPK_(File_Format)&amp;action=history"/>
	<updated>2026-05-06T18:48:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=CTPK_(File_Format)&amp;diff=180&amp;oldid=prev</id>
		<title>Wexos: Imported from avsys wiki</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=CTPK_(File_Format)&amp;diff=180&amp;oldid=prev"/>
		<updated>2024-05-01T17:26:38Z</updated>

		<summary type="html">&lt;p&gt;Imported from avsys wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;CTPK&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;itra &amp;#039;&amp;#039;&amp;#039;T&amp;#039;&amp;#039;&amp;#039;exture &amp;#039;&amp;#039;&amp;#039;P&amp;#039;&amp;#039;&amp;#039;ac&amp;#039;&amp;#039;&amp;#039;K&amp;#039;&amp;#039;&amp;#039;age) is an archive format used in [[Nintendo 3DS]] games, used to store texture data.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
The file byte order is always little endian.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
Every CTPK file begins with a 0x20 byte header structure.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Char[4] || &amp;#039;&amp;#039;&amp;#039;File magic&amp;#039;&amp;#039;&amp;#039;. Always &amp;#039;&amp;#039;CTPK&amp;#039;&amp;#039; in ASCII.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt16 || &amp;#039;&amp;#039;&amp;#039;[[#Version List|Version number]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x06 || UInt16 || &amp;#039;&amp;#039;&amp;#039;Number of [[#Texture Entry|Texture Entries]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt32 || &amp;#039;&amp;#039;&amp;#039;[[#Texture Data|Texture Data]] offset&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || UInt32 || &amp;#039;&amp;#039;&amp;#039;Size of [[#Texture Data|Texture Data]]&amp;#039;&amp;#039;&amp;#039; in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || UInt32 || &amp;#039;&amp;#039;&amp;#039;[[#Hash Table|Hash Table]] offset&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || UInt32 || &amp;#039;&amp;#039;&amp;#039;[[#Texture Format Information Table|Texture Format Information Table]] offset&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || Byte[8] || &amp;#039;&amp;#039;&amp;#039;Padding&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Entry ==&lt;br /&gt;
Followed by the header, there is an entry for each texture. They have the following tructure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt32 || &amp;#039;&amp;#039;&amp;#039;File name offset&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt32 || &amp;#039;&amp;#039;&amp;#039;Size of the texture&amp;#039;&amp;#039;&amp;#039; in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt32 || &amp;#039;&amp;#039;&amp;#039;Offset in [[#Texture Data|Texture Data]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || UInt32 || &amp;#039;&amp;#039;&amp;#039;[[3DS Image Formats|Image format]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || UInt16 || &amp;#039;&amp;#039;&amp;#039;Width&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || UInt16 || &amp;#039;&amp;#039;&amp;#039;Height&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || Byte || &amp;#039;&amp;#039;&amp;#039;Mip level&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 || Byte || &amp;#039;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
* 0x0 = Cube map&lt;br /&gt;
* 0x1 = 1D&lt;br /&gt;
* 0x2 = 2D&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || UInt16 || &amp;#039;&amp;#039;&amp;#039;Cube map flags&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || UInt32 || &amp;#039;&amp;#039;&amp;#039;Bitmap size offset&amp;#039;&amp;#039;&amp;#039;, relative to the start of the entry.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || UInt32 || &amp;#039;&amp;#039;&amp;#039;Unix timestamp&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Followed by all entries comes all bitmap sizes (UInt32s) and texture file names (null-terminated strings).&lt;br /&gt;
 &lt;br /&gt;
== Hash Table ==&lt;br /&gt;
This section contains checksums for each texture entry. Each entry of the table is 8 bytes long and has the following structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt32 || &amp;#039;&amp;#039;&amp;#039;CRC32&amp;#039;&amp;#039;&amp;#039; of the texture file name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Int32 || &amp;#039;&amp;#039;&amp;#039;Texture index&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Format Information Table ==&lt;br /&gt;
This section contains format and compression information for each texture entry. Each entry of the table is 4 bytes long and has the following structure:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Byte || &amp;#039;&amp;#039;&amp;#039;[[3DS Image Formats|Image format]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || Byte[3] || &amp;#039;&amp;#039;&amp;#039;Unknown flags&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Texture Data ==&lt;br /&gt;
This section contains texture data, aligned by 0x80.&lt;br /&gt;
&lt;br /&gt;
= Version List =&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Version !! Found in&lt;br /&gt;
|-&lt;br /&gt;
| 0.1&lt;br /&gt;
|&lt;br /&gt;
* [[StreetPass Mii Plaza]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle CTPK files:&lt;br /&gt;
* (none)&lt;br /&gt;
&lt;br /&gt;
[[Category:3DS File Formats]]&lt;/div&gt;</summary>
		<author><name>Wexos</name></author>
	</entry>
</feed>