Difference between revisions of "Gzip"

From Forensics Wiki
Jump to: navigation, search
(Extra flags)
(File format)
Line 48: Line 48:
  
 
==== Compression method ====
 
==== Compression method ====
* 0-7 - Reserved
+
 
* 8 - "deflate" or zlib compressed data
+
{| class="wikitable"
 +
! align="left"| Value
 +
! Identifier
 +
! Description
 +
|-
 +
| 0 - 7
 +
|
 +
| Reserved
 +
|-
 +
| 8
 +
| "deflate"
 +
| zlib compressed data
 +
|}
 +
 
 +
==== Flags ====
 +
 
 +
{| class="wikitable"
 +
! align="left"| Value
 +
! Identifier
 +
! Description
 +
|-
 +
| 0x01
 +
| FTEXT
 +
|
 +
|-
 +
| 0x02
 +
| FHCRC
 +
|
 +
|-
 +
| 0x04
 +
| FEXTRA
 +
|
 +
|-
 +
| 0x08
 +
| FNAME
 +
|
 +
|-
 +
| 0x10
 +
| FCOMMENT
 +
|
 +
|-
 +
| 0x20
 +
|
 +
| Reserved
 +
|-
 +
| 0x40
 +
|
 +
| Reserved
 +
|-
 +
| 0x80
 +
|
 +
| Reserved
 +
|}
  
 
==== Extra flags ====
 
==== Extra flags ====

Revision as of 01:37, 28 November 2013

Information icon.png

Please help to improve this article by expanding it.
Further information might be found on the discussion page.

Contents

File format

The gzip file (.gz) format consists of:

  • a file header
  • optional extra headers, such as the original file name,
  • a body, containing a DEFLATE-compressed payload
  • an 8-byte footer, containing a CRC-32 checksum and the length of the original uncompressed data.

File header

The file header is 10 bytes in size and contains:

Offset Size Value Description
0 2 0x1f 0x8b Signature (or identification byte 1 and 2)
2 1 Compression Method
3 1 Flags
4 4 Last modification time
Contains a POSIX timestamp.
8 1 Extra flags
9 1 Operating system
Value that indicates on which operating system the gzip file was created.

Compression method

Value Identifier Description
0 - 7 Reserved
8 "deflate" zlib compressed data

Flags

Value Identifier Description
0x01 FTEXT
0x02 FHCRC
0x04 FEXTRA
0x08 FNAME
0x10 FCOMMENT
0x20 Reserved
0x40 Reserved
0x80 Reserved

Extra flags

If compression method is 8 the following extra flags can be defined:

  • 0x02 - compressor used maximum compression, slowest algorithm
  • 0x04 - compressor used fastest algorithm

External Links