Version 18 (modified by ibboard, 11 years ago) (diff)

--

Army Builder .ab File Format

The following is a description of the .ab file format, as determined by IBBoard with the help of a few .ab files and the GHex hex editor. Examples of various data extracted according to the following data can be found in the attached WarFoundry data dump.

The file is split in to two main parts; the content and then the file table. The file table itself is then split in to two further parts; the header and the file list.

All numeric values in the following description are big-endian numbers. All strings are in ASCII/Latin-1. All "quoted strings" are literals. All 'other quoted strings' are references to tags or attributes in the .def file. All paired numbers (e.g. 09 or 30) are hex strings.

Top level file format

The file is broken down as follows

  • 32-bit offset for the start of the file table from the end of the value (so position = offset + 4, e.g. a value of 1000 means the file table starts at 1004)
  • Compressed file content (from position 4 to offset + 3)
  • File table (position offset + 4 to end)

The contained files

The detail of the compressed files is currently unknown. According to the developers it is a customised, commercial version of LZW (the compression used by PKZip). This means it is not compatible with existing libraries and that other means must be found to decompress the data.

One of our developers, darpified, has undertaken investigations to reverse-engineer the .ab file format compression.

The file table

The file table is split in to a header (which also defines details about the file itself) followed by the file table with the list of files, their sizes, offsets within the file and other details. The first 2 bytes of the file table at offset + 4 is the offset of the actual file table entries as a 16-bit number.

The file table header

The file table header consists of the following:

  • File table header string (always "LWDExport" for AB3 format and "ArmyBuilder" for AB2 format) followed by a line feed (0A) and a colon (3A)
  • File format specific information
Army Builder 2 information

Army Builder version 2 contains the following information after the initial string:

  • Fixed string "["
  • Version number as an ASCII string (major.minor)
  • Fixed string "]~~"
  • File comment
Army Builder 3 information

Army Builder version 3 files contain more information on the file in the header. Each item in the following list is separated by a tab (09):

  • Name of the target app? ("Army Builder"/"Card Vault"/"Hero Lab"
  • The value of the 'game' attribute on the <game> tag in the .def file
  • The 'folder' attribute of the <structure> tag
  • The 'major' attribute of the <release> tag (as a string)
  • The 'minor' attribute of the <release> tag (as a string)
  • The major part of the 'required' attribute of the <release> tag (as a string)
  • The minor part of the 'required' attribute of the <release> tag (as a string)
  • An unknown number that appears to always be "0" (Hex: 30)
  • Exporter app name ("ABExport"/"CVExport"/"HLExport")
  • The additional comment added when creating the file

The file table content

The file table starts at offset + 4 + 2 + file table header length. Each file entry consist of:

  • A 16-bit number for the file name length
  • The file path string (normally just the file name for Army Builder, but can be a file path with Windows directory separators)
  • Eight bytes that always seem to be 01 00 02 00 04 01 00 00 - meaning/use unknown
  • A 32-bit file size of the uncompressed file
  • A 32-bit file size of the compressed data
  • Four unknown bytes with varying values - could be a CRC-32
  • A 32-bit offset of the compressed data from the start of the file (so the first file should always be 00 00 00 04)
  • Eight unknown bytes
    • .aug files seem to have 00 00 49 A5 00 2D 00 08 or 00 00 49 A5 00 2E 00 08
    • .bmp files seem to have 00 00 49 A5 00 2B 00 08 or 00 00 49 A5 00 2D 00 08
    • .def files seem to have 00 00 49 D4 D9 2B 00 08
    • .ext files seem to have 00 00 49 A5 00 2E 00 08
    • .dat files seem to have:
      • 00 00 49 A5 00 2D 00 08 for plain files
      • 00 00 49 BD 92 7C 00 08 or 00 00 49 B3 69 92 00 08 for "AP" files
      • 00 00 49 C7 F1 32 00 08 or 00 00 49 BD 97 D1 00 08 for "Unit" files
      • 00 00 49 A5 00 2D 00 08 or 00 00 49 BD 92 7C 00 08 for "UniDat" files

The file table ends with a final 00 00, presumably to represent the fact that the next file name length is 0 - i.e. there are no more files).

Related file formats

The above description also appears to apply to other data files from Lone Wolf Development. As such the preceding information should also be relevant to Card Vault v1 data files (.cv) and Hero Lab v3 data files (.hl). The information may also apply to earlier versions of these applications.

Attachments (1)

Download all attachments as: .zip