Extract resources from SWF files.
For now this project aims at extracting image data from SWF files. More things would be implemented in future.
$ npm install swf-extract
const {readFromBufferP, extractImages} = require('swf-extract')
// `rawData` could come from file, network, etc.
// as long as it end up being a Buffer.
const rawData = fs.readFileSync(<path-to-your-file>)
(async () => {
const swf = await readFromBufferP(rawData)
// the result of calling `extractImages` resolves to an Array of Promises
const ts = await Promise.all(extractImages(swf.tags))
console.log(ts)
})()
This project cannot be possible without work from the following 3 packages:
The original author is Rafael Leal Dias, who works out most of the parsing logics.
Then it's modified & improved by Gizeta to include many supports and bug fixes,
who is also the author of swf-image-extractor
,
which provides the original implementation of image extraction from SWF files.
MIT