CAB Archive: Difference between revisions

From XentaxWiki
Jump to navigation Jump to search
imported>Ikskoks
No edit summary
imported>Ikskoks
 
(10 intermediate revisions by the same user not shown)
Line 5: Line 5:
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian <br>
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian <br>
* ''' Signature ''':    MSCF <br>  
* ''' Signature ''':    MSCF <br>  
* ''' Alternative Names ''': Microsoft Cabinet CAB <br>
* ''' Alternative Names ''': Microsoft Cabinet File / Cabinet <br>




Line 113: Line 113:
=== Compatible Programs ===  
=== Compatible Programs ===  


* 7-zip
* Game Extractor
* Game Extractor
* makecab.exe / cabarc.exe (in C:\WINDOWS\system32)
* makecab.exe / cabarc.exe (in C:\WINDOWS\system32)
* Winrar
=== See Also ===
* [https://docs.microsoft.com/en-us/previous-versions//bb267310(v=vs.85)?redirectedfrom=MSDN CAB file format (microsoft.com)]
* [https://en.wikipedia.org/wiki/Cabinet_(file_format) CAB description (wikipedia)]
<br/><br>
<br/><br>



Latest revision as of 11:39, 13 February 2022

Back to index | Edit this page

CAB

  • Format Type : Archive
  • Endian Order : Little Endian
  • Signature : MSCF
  • Alternative Names : Microsoft Cabinet File / Cabinet


Format Specifications

CFHEADER
  uint32 {4}       - Signature (MSCF)
  uint32 {4}       - Reserved (null)
  uint32 {4}       - Archive Length
  uint32 {4}       - Reserved (null)
  uint32 {4}       - Offset to the first CFFILE
  uint32 {4}       - Reserved (null)
  byte {1}         - Minor Version (3)
  byte {1}         - Major Version (1)
  uint16 {2}       - Number of Folders
  uint16 {2}       - Number of Files
  uint16 {2}       - Flags
  uint16 {2}       - Cabinet Set ID Number
  uint16 {2}       - Sequential Number of this Cabinet file in a Set
  if (flags & 4){
    uint16 {2}       - Header Reserve Size
    byte {1}         - Folder Reserve Size
    byte {1}         - File Reserve Size
    if (HeaderReserveSize != 0){
      byte {X}         - Reserve Data (length = HeaderReserveSize)
      }

    }

  if (flags & 1){
    byte {0-255}     - Previous CAB Filename
    byte {1}         - null Filename Terminator
    byte {0-255}     - Previous Disk Name
    byte {1}         - null Disk Name Terminator
    }

  if (flags & 2){
    byte {0-255}     - Next CAB Filename
    byte {1}         - null Filename Terminator
    byte {0-255}     - Next Disk Name
    byte {1}         - null Disk Name Terminator
    }

for each Folder
  CFFOLDER
    uint32 {4}       - Offset to the first CFDATA in this Folder
    uint16 {2}       - Number of CFDATA blocks in this Folder
    uint16 {2}       - Compression Format for each CFDATA in this Folder (1 = MSZIP)
    if (flags & 4){
      byte {X}         - Reserve Data (length = FolderReserveSize)
      }

for each File
  CFFILE
    uint32 {4}       - Uncompressed File Length
    uint32 {4}       - Offset in the Uncompressed CFDATA for the Folder this file belongs to (relative to the start of the Uncompressed CFDATA for this Folder)
    uint16 {2}       - Folder ID (starts at 0)
    uint16 {2}       - File Date
    uint16 {2}       - File Time
    uint16 {2}       - File Attributes
    if (FileAttributes & 64){
      byte {X}         - Filename (Unicode)
      byte {2?}        - null Filename Terminator
      }

    else {
      byte {X}         - Filename (ASCII)
      byte {1}         - null Filename Terminator
      }

for each File
  CFDATA
    uint32 {4}       - Checksum
    uint16 {2}       - Compressed Data Length
    uint16 {2}       - Uncompressed Data Length
    if (flags & 4){
      byte {X}         - Reserve Data (length = FileReserveSize)
      }

    byte {X}         - Compressed Data

MSZIP COMPRESSION
  for each compressed block (uncompressed size of the block is at most 32k)
    uint16 {2}       - Zip Header (67, 75)
    byte {X}         - Compressed Data (Deflate)



Notes and Comments

  • CAB is an archive file format for Microsoft Windows

Games

List of games using this file format:

  • TODO

QuickBMS Script

Not written yet.

Compatible Programs

  • 7-zip
  • Game Extractor
  • makecab.exe / cabarc.exe (in C:\WINDOWS\system32)
  • Winrar

See Also