PackDir

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(File format for RISC OS packdir archives.)
 
(Software: XAD)
 
(16 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
{{FormatInfo
 
{{FormatInfo
 +
|formattype=electronic
 
|subcat=Archiving
 
|subcat=Archiving
 
}}
 
}}
 +
'''PackDir''' is an archiving tool for RISC OS, and its associated file format. It can compress file using an [[LZW]] algorithm, or store uncompressed files.
  
'''Packdir''' is an archiving tool for RISC OS. It can compress file using an LZW algorithm, or store uncompressed files.
+
The LZW algorithm is the variant used in the [[Zoo]] archiver, except that the "max bits" parameter is configurable.
  
The LZW algorithm is the variant that is used in the [[ZOO]] archiver.
+
Its [[RISC OS filetype]] is 68E.
 
+
== Software ==
+
The software runs on RISC OS only.
+
 
+
* [http://web.inter.nl.net/users/J.Kortink/home/software/packdir/index.htm Packdir download page]
+
  
 
== File format ==
 
== File format ==
I have reverse engineered the file format.
+
''This section contains reverse-engineered information about the format.''
  
 
32bit ints are in LSB format.  Strings are NULL-terminated ASCII.
 
32bit ints are in LSB format.  Strings are NULL-terminated ASCII.
  
File/directory dates and times are stored in a RISC OS format.  They can be converted to a Unix date stamp using the following function:
+
File/directory dates and times are stored in a RISC OS format: The low 8 bits of the "load" address, combined with the "exec" address, form a 40-bit integer representing the number of 0.01-second intervals since the beginning of the year 1900.
    32bit_int high = (load & 0xff) - 0x33;
+
    32bit int low;
+
    low = exec - 0x6e996a00;
+
    file_time = high * 42949673 + low / 100;
+
    file_time *= 1000;
+
  
 
File format:
 
File format:
Line 35: Line 27:
 
     32bit_int: LZW maxbits - 12
 
     32bit_int: LZW maxbits - 12
  
obejct_entry:
+
object_entry:
 
     string: object_name (including trailing NULL)
 
     string: object_name (including trailing NULL)
 
     32bit_int: load (RISC OS load address)
 
     32bit_int: load (RISC OS load address)
Line 41: Line 33:
 
     32bit_int: original_file_length if this object is a file, number_of_child_entries otherwise
 
     32bit_int: original_file_length if this object is a file, number_of_child_entries otherwise
 
     32bit_int: attributes (RISC OS read/write permissions)
 
     32bit_int: attributes (RISC OS read/write permissions)
     32bit_int: entry_type: 1 == directory, 2 == file.  NB: This field is missing for the first entry in the file - the first entry is always a directory
+
     32bit_int: entry_type: 1 == directory, 0 == file.  NB: This field is missing for the first entry in the file -
 +
              the first entry is always a directory
  
 
If the entry is a file, then these fields follow:
 
If the entry is a file, then these fields follow:
     32bit_int: Compressed_file_length
+
     32bit_int: Compressed_file_length or special code - If this field is -1 the file is not compressed,
    32bit_int: Compression_type: -1 == Not compressed, otherwise compressed with LZW.
+
              otherwise compressed with LZW.
     N byetes: archived file data.  N == compressed_file_length if compression_type == -1, otherwise original_file_length
+
     N bytes: archived file data.  N == compressed_file_length if file is compressed, otherwise original_file_length
 +
 
 +
== Identification ==
 +
Files begin with "{{magic|PACK}}", followed by {{magic|0x00}}. Note that this is not enough to distinguish them from [[Quake_PAK]] pack format. However, it cannot be a [[Git]] pack format, because Git expects a 4 byte version number in big endian, which means byte {{magic|0x02}} or {{magic|0x03}} would be there.
 +
 
 +
== Software ==
 +
* [http://www.zeridajh.org/software/packdir/index.htm PackDir download page] (RISC OS software)
 +
* [https://www.riscosopen.org/wiki/documentation/show/Software%20information:%20SparkFS%20(self-extracting) SparkFS]
 +
* [https://github.com/mjwoodcock/riscosarc riscosarc]
 +
* {{Deark}}
 +
* {{XAD}}
  
 
== Example files ==
 
== Example files ==
* [http://web.inter.nl.net/users/J.Kortink/home/software/earthmap/earth120.bin earth120.bin]
+
* [http://www.zeridajh.org/software/earthmap/downloads/earthmap_120.bin earthmap_120.bin]
* [ftp://arcade.demon.co.uk/data/077500/079550/079556 MyXCard95A]
+
* {{ArcadeBBSLink|079556|MyXCard95A}}
 +
* {{DexvertSamples|archive/packDir}}
  
 
[[Category:RISC OS]]
 
[[Category:RISC OS]]

Latest revision as of 10:48, 12 April 2024

File Format
Name PackDir
Ontology

PackDir is an archiving tool for RISC OS, and its associated file format. It can compress file using an LZW algorithm, or store uncompressed files.

The LZW algorithm is the variant used in the Zoo archiver, except that the "max bits" parameter is configurable.

Its RISC OS filetype is 68E.

Contents

[edit] File format

This section contains reverse-engineered information about the format.

32bit ints are in LSB format. Strings are NULL-terminated ASCII.

File/directory dates and times are stored in a RISC OS format: The low 8 bits of the "load" address, combined with the "exec" address, form a 40-bit integer representing the number of 0.01-second intervals since the beginning of the year 1900.

File format:

   Header
   object_entry_1
   object_entry_2
   ...
   object_entry_N

Header:

   String: "PACK\0"
   32bit_int: LZW maxbits - 12

object_entry:

   string: object_name (including trailing NULL)
   32bit_int: load (RISC OS load address)
   32bit_int: exec (RISC OS exec address)
   32bit_int: original_file_length if this object is a file, number_of_child_entries otherwise
   32bit_int: attributes (RISC OS read/write permissions)
   32bit_int: entry_type: 1 == directory, 0 == file.  NB: This field is missing for the first entry in the file -
              the first entry is always a directory

If the entry is a file, then these fields follow:

   32bit_int: Compressed_file_length or special code - If this field is -1 the file is not compressed,
              otherwise compressed with LZW.
   N bytes: archived file data.  N == compressed_file_length if file is compressed, otherwise original_file_length

[edit] Identification

Files begin with "PACK", followed by 0x00. Note that this is not enough to distinguish them from Quake_PAK pack format. However, it cannot be a Git pack format, because Git expects a 4 byte version number in big endian, which means byte 0x02 or 0x03 would be there.

[edit] Software

[edit] Example files

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox