ARI (compressed archive)

From Just Solve the File Format Problem
Jump to: navigation, search
File Format
Name ARI (compressed archive)
Ontology
Extension(s) .ari
Released ≤1993

ARI is a compressed archive utility for DOS, and associated file format, developed by RAO Inc. It was distributed as freeware, and there was a registered version with more features.

Contents

Format details

File structure

This information (written for the fileformats.archiveteam.org wiki) pertains to ARI and ERI, and is based on reverse engineering. It may be incorrect, and is likely incomplete. The software has many features whose effect on the format has not been tested.

An ARI or ERI file is a sequence of "member file" segments, each with the following structure:

Size in bytes Name Description and remarks
path_len filename_path Variable size, often absent. The logic for finding the size is unclear.
8 filename_base Filename, base part, padded with spaces or NUL bytes
3 filename_ext Filename extension, padded
1 File attributes and other flags. 0x80 bit may be set when filename_path is present.
2 timestamp_time DOS time/date
2 timestamp_date
4 Original file size
4 member_size Total size of this member (header + cdata)
4 "CRC-32" (derived from the uncompressed file data)
member_size−(path_len+28) cdata Compressed file data

CRC algorithm

Each member file has a "CRC-32" field (as named by the software's "l" command, though it is only a CRC in the loosest sense of the term). The algorithm and file format are the same for ARI and ERI, but their "l" commands display it differently. Assuming the byte order in the file is 0-1-2-3, ERI displays 3-2-1-0, while ARI displays 1-0-3-2.

Think of it as four separate 1-byte checksums: ck[0...3]. As each input byte is processed, two of the "ck" bytes are updated: one using an "ADD" function, and one using an "XOR" function.

The "ADD" function: ck[n] := (ck[n] + source_byte) mod 256

The "XOR" function: ck[n] := ck[n] XOR ((source_byte + 1) mod 256)

The first byte of the file updates ck[0] with ADD, and ck[1] with XOR. The second byte updates ck[1] (ADD) and ck[2] (XOR). Then 2-3 for the third byte, then 3-0, then back to 0-1, repeating with a period of 4 bytes.

Related formats

Software

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox