_______________________________________________________________________________________________
FORMATO PACK por Barracuda - 15 Jun 2009
_______________________________________________________________________________________________
Todos los datos son Little Endian.
Todos los datos excepto el índice, se encuentran en bloques con un tamaño fijo de 32 bytes.
El índice se encuentra en bloques con un tamaño fijo de 64 bytes.
Un archivo pack (por llamarle de algún modo), consta de tres secciones, cabecera,índice y
datos. La cabecera tiene un tamaño fijo de 32 bytes. El índice está compuesto por estructuras
de 8 bytes, y tiene un tamaño mínimo de 64 bytes (8 estructuras). O sea, si el número de
estructuras es 1, el índice tendrá espacio para 8, teniendo 7 estructuras vacías, si el número
de estructuras fuese 9, el índice tendría espacio para 16, teniendo 7 vacías.
Cabecera - 32 bytes (un bloque)
offset tamaño descripción
------ ------- -----------
0-3 4 bytes - identificador en ascii 'pack'
4-7 4 bytes - número máximo de archivos que podría contener en el pack (multiplicado por 8 = tamaño del índice)
8-11 4 bytes - tamaño de la sección de datos
12-15 4 bytes - ¿relleno? siempre está a 0X00
16-31 16 bytes - siempre a 0x00, relleno para cumplir el límite de 32 bytes.
Índice - Tamaño variable, mínimo 64 bytes (un bloque, capacidad para 8 archivos)
offset tamaño descripción
------ ------- -----------
32-35 4 bytes - offset del archivo desde el offset del índice
36-39 4 bytes - tamaño del archivo
.............. - Esta estructura se repite hasta completar el tamaño del índice.
Datos - Los datos comienzan en el offset indicado por la primera entrada en el índice
y están almacenados en bloques de 32 bytes. Si el tamaño de un archivo no es
múltiplo de 32, el último bloque de ese archivo se rellenará con 0x00 hasta
completar los 32 bytes.
_______________________________________________________________________________________________
A translation made by myself just so you guys try to avoid Engrish:
_______________________________________________________________________________________________
PACK FORMAT by Barracuda - June 15, 2009
_______________________________________________________________________________________________
All the data is in Little Endian encoding.
Every data except the index, is located in blocks with a fixed size of 32 bytes.
Index is found in blocks with a fixed size of 64 bytes.
A pack file (just to put a name to it), has three sections, header, index and data. Header has a fixed 32 bytes size. Index is made by 8 bytes structures, and has a minimum size of 64 bytes (8 structures). Which means, if the number of structures is 1, the index will have space for 8, having 7 empty structures, and if the number of structures is 9, the index would have room for 16, 7 of them empty.
Header - 32 bytes (one block)
offset size description
------ ------- -----------
0-3 4 bytes - ascii identifier 'pack'
4-7 4 bytes - maximum number a pack file can contain (multiply per 8 = size of the index)
8-11 4 bytes - size for the data section
12-15 4 bytes - ¿padding? always at 0X00
16-31 16 bytes - always at 0x00, padding in order to achieve the 32 bytes limit.
Index - Variable size, 64 bytes minimum (one block, capacity for 8 files)
offset size description
------ ------- -----------
32-35 4 bytes - file offset starting from the index offset
36-39 4 bytes - file size
.............. - This structure repeats until the index size is filled.
Data - Data start at the indicated offset at the first entry on the index and they are
stored in 32 bytes blocks. If the file size is not a multiple of 32, the last block of
that file will be filled with 0x00 until 32 bytes are completed.
_______________________________________________________________________________________________
'Ave fun.

