AIN

AIN is a compressed archive format, produced by a DOS shareware program of the same name. It was developed by InfoService Ltd., later Transas Marine Ltd.

Format details
The v2.2 documentation says "AIN version 2.2 archive format is incompatible with that of AIN version 2.0." But, no versions before 2.1 have been found.

None of the compression methods used in AIN seem to be publicly known.

An AIN file consists of an archive header, then a segment for the file data, then an index at the end of the file. The index is evidently compressed.

Archive header
''[Incomplete information, based on reverse engineering. Written for the fileformats.archiveteam.org wiki.]''

The first 24 bytes of the file are the archive header. Byte order is little-endian.

AINEXE
AIN also includes an executable compression utility named AINEXE. It compresses DOS EXE files.

Self-extracting archives
Some versions support self-extracting archives, in DOS EXE format.

Version 2.23: The distribution includes an AINSFX.EXE file, which seems to be undocumented, but can be prepended to an AIN archive to create a self-extracting archive.

Version 2.32: The included AINEXT.EXE extraction utility doubles as the self-extractor module. You can prepend it to an AIN archive to create a self-extracting archive. Or you can use AIN's  option to create a self-extracting archive instead of an .AIN archive (this requires that AINEXT.EXE be present). Note that AINEXT.EXE may report its version number to be 2.31.

Identification
Robust identification of AIN format is nontrivial. The software itself uses the header checksum and index checksum.

An AIN file with default settings starts with (hex bytes), has at offset 2, and  at offset 20.

Some of the bits at the end of the file might also help to identify AIN, but they are not byte-aligned.

AINEXE-compressed EXE files most likely have ASCII "" at offset 32.

Software

 * AIN
 * AIN 2.1[1993-07-14]: Ultimate collection 95 → UTIL_/AIN.EXE
 * AIN 2.2[1993-10-13, Russian]: FTP mirror - fidonet.org.ua - 2015-02-12 → fidonet.org.ua/pub/arcers/ain.arj
 * AIN 2.23: DP TOOL CLUB CD ASCQ → CD_ASCQ_28_030496.iso → DOS/TOOLS/AIN223.ZIP
 * AIN 2.32
 * Various versions at old-dos.ru - Includes v2.22, and a v2.1 demo.
 * AIN 2.32
 * Various versions at old-dos.ru - Includes v2.22, and a v2.1 demo.


 * AINEXT - Official extract-only utility, sometimes distributed separately.
 * Various versions at old-dos.ru

Sample files

 * https://telparia.com/fileFormatSamples/archive/ain/