Merge branch 'n1073645-debExtractor'
This commit is contained in:
commit
a770d09687
@ -1724,6 +1724,25 @@ export const FILE_SIGNATURES = {
|
|||||||
},
|
},
|
||||||
extractor: null
|
extractor: null
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Jar Archive",
|
||||||
|
extension: "jar",
|
||||||
|
mime: "application/java-archive",
|
||||||
|
description: "",
|
||||||
|
signature: {
|
||||||
|
0: 0x50,
|
||||||
|
1: 0x4B,
|
||||||
|
2: 0x03,
|
||||||
|
3: 0x04,
|
||||||
|
4: 0x14,
|
||||||
|
5: 0x00,
|
||||||
|
6: 0x08,
|
||||||
|
7: 0x00,
|
||||||
|
8: 0x08,
|
||||||
|
9: 0x00
|
||||||
|
},
|
||||||
|
extractor: extractZIP
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "lzop compressed",
|
name: "lzop compressed",
|
||||||
extension: "lzop,lzo",
|
extension: "lzop,lzo",
|
||||||
@ -1742,7 +1761,7 @@ export const FILE_SIGNATURES = {
|
|||||||
extractor: extractLZOP
|
extractor: extractLZOP
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Linux deb",
|
name: "Linux deb package",
|
||||||
extension: "deb",
|
extension: "deb",
|
||||||
mime: "application/vnd.debian.binary-package",
|
mime: "application/vnd.debian.binary-package",
|
||||||
description: "",
|
description: "",
|
||||||
@ -1755,7 +1774,7 @@ export const FILE_SIGNATURES = {
|
|||||||
5: 0x68,
|
5: 0x68,
|
||||||
6: 0x3e
|
6: 0x3e
|
||||||
},
|
},
|
||||||
extractor: null
|
extractor: extractDEB
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Apple Disk Image",
|
name: "Apple Disk Image",
|
||||||
@ -3448,6 +3467,37 @@ export function extractXZ(bytes, offset) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DEB extractor.
|
||||||
|
*
|
||||||
|
* @param {Uint8Array} bytes
|
||||||
|
* @param {Number} offset
|
||||||
|
*/
|
||||||
|
export function extractDEB(bytes, offset) {
|
||||||
|
const stream = new Stream(bytes.slice(offset));
|
||||||
|
|
||||||
|
// Move past !<arch>
|
||||||
|
stream.moveForwardsBy(8);
|
||||||
|
while (stream.hasMore()) {
|
||||||
|
|
||||||
|
// Move to size field.
|
||||||
|
stream.moveForwardsBy(48);
|
||||||
|
let fsize= "";
|
||||||
|
|
||||||
|
// Convert size to a usable number.
|
||||||
|
for (const elem of stream.getBytes(10)) {
|
||||||
|
fsize += String.fromCharCode(elem);
|
||||||
|
}
|
||||||
|
fsize = parseInt(fsize.trim(), 10);
|
||||||
|
|
||||||
|
// Move past `\n
|
||||||
|
stream.moveForwardsBy(2);
|
||||||
|
stream.moveForwardsBy(fsize);
|
||||||
|
}
|
||||||
|
return stream.carve();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ELF extractor.
|
* ELF extractor.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user