mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-02 14:11:02 +01:00
Added WAV extractor.
This commit is contained in:
parent
f3864b00fe
commit
a4772941a7
@ -736,7 +736,7 @@ export const FILE_SIGNATURES = {
|
||||
10: 0x56,
|
||||
11: 0x45
|
||||
},
|
||||
extractor: null
|
||||
extractor: extractWAV
|
||||
},
|
||||
{
|
||||
name: "OGG audio",
|
||||
@ -2642,6 +2642,22 @@ export function extractBMP(bytes, offset) {
|
||||
return stream.carve();
|
||||
}
|
||||
|
||||
/**
|
||||
* WAV extractor.
|
||||
*
|
||||
* @param {Uint8Array} bytes
|
||||
* @param {Number} offset
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function extractWAV(bytes, offset) {
|
||||
const stream = new Stream(bytes.slice(offset));
|
||||
stream.moveTo(4);
|
||||
|
||||
// Move to file size.
|
||||
stream.moveTo(stream.readInt(4, "le")-4);
|
||||
return stream.carve();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* FLV extractor.
|
||||
|
Loading…
Reference in New Issue
Block a user