The GX Library format is a later revision of the PCX Library that makes it a little more efficient to read. The PCXLIB.EXE application has been replaced by GXLIB.EXE, distributed with the GX Development Series toolkit.
Usually the default library extensions are .PCL or .LIB, but this is not required (as actual example: .GXL or .VXL used too). Library files can be easily identified by the copyright text at the beginning (see below).
Library files may contain not only .PCX images, but any type of file.
Library files consists of two parts - the header and file directory. Note that PCX/GX tools and the libraries code used in software verify only the id (Library ID) value in the header for both formats. Nothing else is checked in library header and can be literally anything.
GX Library format
Each file begins with the following header.
|UINT16LE||id||Library ID. Must be 0xCA01 (bytes 0x01 0xCA)|
|char||copyright||Copyright notice (example: "Copyright (c) Genus Microprogramming, Inc. 1988-90").|
|UINT16LE||version||gxLib version. Always 100 (0x0064)|
|char||label||Library volume label|
|UINT16LE||entries||Total image entries|
|BYTE||reserved||Reserved for GX kernel, unused/ignored, set to 0|
After the header is entries records of an image header and image data:
|char||name||Image file name (8.3, name padding with spaces before dot from extension, ends with 0)|
|INT32LE||offs||File offset (absolute)|
|UINT16LE||date||DOS packed file date|
|UINT16LE||time||DOS packed file time|
After this records follows file data for each file in library. The files in the directory are NOT in the same order as the files in the archive (i.e. file 1 in the directory may actually be file 5 in the archive, etc).
The date and time are in standard DOS FAT16 format:
Add 1980 to the year value to get the calendar year (i.e. a year value of 1 translates to 1981). Multiply the seconds by 2 (i.e. a value of 29 translates to 58 seconds). A month or day value of 0 is not permitted. Dates before 1 Jan 1980 are not possible. The times are stored in the local time zone of the computer that wrote the timestamps, however the timezone itself is not stored.
The following tools are able to work with files in this format.
|Name||Platform||Extract files?||Decompress on extract?||Create new?||Modify?||Compress on insert?||Access hidden data?||Edit metadata?||Notes|
|PCX/GX Library unpacker||Windows||Yes||N/A||No||No||N/A||No||No||PCX/GX Library support (with C source code)|
|Librarian||Windows||Yes||N/A||No||No||N/A||No||No||Rudimentary support only|
This file format was reverse engineered by CTPAX-X_Team. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)