IPAK Files: Difference between revisions

From COD Engine Research
Created page with "Category:PAK Files Category:BO2 IPAK's, implemented in black ops 2, are basically an archive of compressed image data. == Structure == Thanks to kokole for the struct..."
 
No edit summary
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:PAK Files]]
[[Category:PAK Files]]
[[Category:BO2]]
[[Category:BO2]]
IPAK's, implemented in black ops 2, are basically an archive of compressed image data.
IPAK's, implemented in [[:Category:BO2|Black Ops 2]], are basically an archive of compressed image data.


== Structure ==
== Structure ==
Thanks to kokole for the structure.
<syntaxhighlight lang="cpp">
struct ipak_header_t
struct IPakHeader
{
{
u32 identifier; // "IPAK"
  unsigned int magic;
u32 version; //0x50000
  unsigned int version;
u32 fileSize;
  unsigned int size;
u32 sectionCount; //from what I've seen it's always 2 (1 = info 2 = data)
  unsigned int sectionCount;
}; // 16 bytes
};
   
   
struct section_t
struct IPakSection
{
{
u32 sectionIndex; //enum 0x1 = info, 0x2 = data
  unsigned int type; //enum 0x1 = info, 0x2 = data
u32 sectionStart;
  unsigned int offset;
u32 sectionLength;
  unsigned int size;
u32 numOfEntries; // each entry is a compressed iwi file in section 2 and entry info in section 1
  unsigned int itemCount;
}; // 16 bytes
};
   
   
struct entry_info_t
struct IPakIndexEntry
{
{
u32 hash; // checksum, type?
  unsigned __int64 key;
u32 id;
  unsigned int offset;
u32 entryStart; // location of compressed iwi file
  unsigned int size;
u32 entryLength;
};
}; // 16 bytes
   
   
struct entry_t
struct IPakDataChunkHeader
{
{
entry_header_t header;
  unsigned int countAndOffset; // 24 bits = offset, 8 bits = count
block_info_t blocks[31]; //they can be null, actual number of blocks is header->blockCount;
  unsigned int commands[31]; //(depending on endian) blockSize = (info & 0xFFFF); , compressedFlag = info >> 24;
};
};
</syntaxhighlight>
struct entry_header_t
== Decompression Methods ==
{
 
int blockCount; // actual blockcount = *(byte*)&blockCount[0];
The compression method is just the basic LZO1X compression.
}; // 4 bytes
struct block_info_t
{ //enum 0x0 = plaintext, 0x1 = encrypted
u32 info; //(depending on endian) blockSize = (info & 0xFFFF); , compressedFlag = info >> 24;
}; // 4 bytes


== Decompression Methods ==
PC:
PC:
  http://pastebin.com/vd9t2U2B
  http://pastebin.com/vd9t2U2B

Latest revision as of 01:20, 4 July 2015

IPAK's, implemented in Black Ops 2, are basically an archive of compressed image data.

Structure

struct IPakHeader
{
  unsigned int magic;
  unsigned int version;
  unsigned int size;
  unsigned int sectionCount;
};
 
struct IPakSection
{
  unsigned int type; //enum 0x1 = info, 0x2 = data
  unsigned int offset;
  unsigned int size;
  unsigned int itemCount;
};
 
struct IPakIndexEntry
{
  unsigned __int64 key;
  unsigned int offset;
  unsigned int size;
};
 
struct IPakDataChunkHeader
{
  unsigned int countAndOffset; // 24 bits = offset, 8 bits = count
  unsigned int commands[31]; //(depending on endian) blockSize = (info & 0xFFFF); , compressedFlag = info >> 24;
};

Decompression Methods

The compression method is just the basic LZO1X compression.

PC:

http://pastebin.com/vd9t2U2B

PS3:

1.00 t6mp_ps3f.self - 0x6AEA78

XBOX:

tu9 default_mp.xex - 0x828E5090
tu13 default_mp.xex - 0x828E6308