mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-02 14:11:02 +01:00
xz compression
This commit is contained in:
parent
a8f029309d
commit
77a9481cf9
@ -1485,7 +1485,7 @@ export const FILE_SIGNATURES = {
|
||||
4: 0x5a,
|
||||
5: 0x0
|
||||
},
|
||||
extractor: null
|
||||
extractor: extractXZ
|
||||
},
|
||||
{
|
||||
name: "Tarball",
|
||||
@ -2808,6 +2808,21 @@ export function extractZlib(bytes, offset) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* XZ extractor
|
||||
*
|
||||
* @param {Uint8Array} bytes
|
||||
* @param {Number} offset
|
||||
* @returns {string}
|
||||
*/
|
||||
export function extractXZ(bytes, offset) {
|
||||
const stream = new Stream(bytes.slice(offset));
|
||||
stream.continueUntil([0x00, 0x00, 0x00, 0x00, 0x04, 0x59, 0x5a]);
|
||||
stream.moveForwardsBy(7);
|
||||
return stream.carve();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ELF extractor.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user