Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,568 additions
and
1,142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
// DIE's signature file | ||
|
||
init("archive","bzip"); | ||
|
||
function detect(bShowType,bShowVersion,bShowOptions) | ||
{ | ||
if(Binary.getSize()>=9) | ||
{ | ||
if(Binary.compare("'BZ0'")) | ||
{ | ||
sVersion="1"; | ||
bDetected=1; | ||
} | ||
else if(Binary.compare("'BZh'")) | ||
{ | ||
sVersion="2"; | ||
bDetected=1; | ||
} | ||
if(bDetected) | ||
{ | ||
sOptions="block-size:"+Binary.getString(3,1)+"00 kb"; | ||
} | ||
} | ||
|
||
return result(bShowType,bShowVersion,bShowOptions); | ||
} | ||
// DIE's signature file | ||
// doc-ref: https://github.com/dsnet/compress/blob/master/doc/bzip2-format.pdf | ||
init("archive",""); | ||
|
||
function detect(bShowType,bShowVersion,bShowOptions) | ||
{ | ||
if(Binary.getSize()>=9) | ||
{ | ||
if(Binary.compare("'BZ0'")) | ||
{ | ||
sName = "BZip1 compressed data (.BZ)" | ||
bDetected=true; | ||
} | ||
|
||
else if(Binary.compare("'BZh'") && Binary.compare("314159265359",0x4)) | ||
{ | ||
sName = "BZip2 compressed data (.BZ2)" | ||
bDetected=true; | ||
} | ||
if(bDetected && Binary.isVerbose()) | ||
{ | ||
sOptions="block-size:"+Binary.getString(3,1)+"00 kb"; | ||
} | ||
} | ||
|
||
return result(bShowType,bShowVersion,bShowOptions); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,35 @@ | ||
// DIE's signature file | ||
|
||
init("archive","Gzip"); | ||
|
||
function detect(bShowType,bShowVersion,bShowOptions) | ||
{ | ||
if(Binary.getSize()>=9) | ||
{ | ||
if(Binary.compare("1F8B08")) | ||
{ | ||
switch(Binary.readByte(8)) | ||
{ | ||
case 2: sOptions="best"; break; | ||
case 4: sOptions="fast"; break; | ||
} | ||
bDetected=1; | ||
} | ||
} | ||
|
||
return result(bShowType,bShowVersion,bShowOptions); | ||
} | ||
// DIE's signature file | ||
// Author: LinXP | ||
// Status: WIP | ||
|
||
init("archive","GZip data"); | ||
|
||
function detect(bShowType,bShowVersion,bShowOptions) | ||
{ | ||
if(Binary.getSize()>=9) | ||
{ | ||
|
||
if(Binary.compare("1F8B")) | ||
{ | ||
bDetected=true; | ||
switch(Binary.read_uint8(0x02)) | ||
{ | ||
case 0: sOption("stored"); break; | ||
case 1: sOption("compressed"); break; | ||
case 2: sOption("packed"); break; | ||
case 3: sOption("lzhed"); break; | ||
case 8: sOption("deflate"); break; | ||
default: bDetected=false; | ||
} | ||
if (bDetected) { | ||
switch(Binary.read_uint8(0x08)) | ||
{ | ||
case 2: sOption("best"); break; | ||
case 4: sOption("fast"); break; | ||
} | ||
} | ||
} | ||
} | ||
|
||
return result(bShowType,bShowVersion,bShowOptions); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,38 @@ | ||
// DIE's signature file | ||
// Author: LinXP | ||
|
||
init("archive","LZ4"); | ||
|
||
function detect(bShowType,bShowVersion,bShowOptions) | ||
{ | ||
if(Binary.getSize()>=9) | ||
{ | ||
if(Binary.compare("04224d18")) | ||
{ | ||
sVersion=""; | ||
bDetected=1; | ||
} | ||
else if(Binary.compare("02214c18")) | ||
{ | ||
sVersion="old"; | ||
bDetected=1; | ||
} | ||
if(bDetected) | ||
{ | ||
sOptions="block-size:"+Binary.readDword(7)+" byte"; | ||
} | ||
} | ||
|
||
return result(bShowType,bShowVersion,bShowOptions); | ||
} | ||
// DIE's signature file | ||
// Author: LinXP | ||
// doc-ref: https://github.com/inikep/lizard/blob/lizard/doc/lizard_Frame_format.md | ||
init("archive",""); | ||
|
||
function detect(bShowType,bShowVersion,bShowOptions) | ||
{ | ||
if(Binary.getSize()>=9) | ||
{ | ||
bDetected=true; | ||
switch(Binary.read_uint32(0x00,_BE)) | ||
{ | ||
case 0x02214C18: sName="LZ4 compressed data, legacy (.LZ4)" ; break; | ||
case 0x04224D18: sName="LZ4 compressed data (.LZ4)" ; break; | ||
case 0x05224D18: sName="LZ5 compressed data (.LZ5)" ; break; | ||
case 0x06224D18: sName="Lizard compressed data (.LIZ)" ; break; | ||
default: bDetected=false; | ||
} | ||
|
||
if(bDetected) | ||
{ | ||
var bFlags=Binary.read_uint8(0x04); | ||
if (bFlags & 64) { sVersion="v1"; } | ||
if (bFlags & 128) { sVersion="v2"; } | ||
if (bFlags & 64 && bFlags & 128) { sVersion="v3"; } | ||
if (Binary.isVerbose()) | ||
{ | ||
if (bFlags & 1 ) { sOption("PresetDictionary"); } | ||
if (bFlags & 4 ) { sOption("ContentChecksum"); } | ||
if (bFlags & 8 ) { sOption("ContentSize"); } | ||
if (bFlags & 16) { sOption("BlockChecksum"); } | ||
if (bFlags & 32) { sOption("BlockIndependence"); } | ||
} | ||
} | ||
} | ||
|
||
return result(bShowType,bShowVersion,bShowOptions); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.