
Security News
PolinRider: North Korea-Linked Supply Chain Campaign Expands Across Open Source Ecosystems
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.
demolishedcompressor
Advanced tools
demolishedcompressor pack's a javascript file into a PNG image with an HTML payload. When opened in a browser, the HTML extracts and executes the javascript.
demolishedCompressor pack's a .js/json/text file into a PNG image with an optional HTML payload.
The default behavior is when a packed file opened in a browser the HTML is extracted and the javascript executes. This option (default) is designed to pack/compress 4k, 8k and 64k demos build using Javascript into one "executable".
By using the external/custom unpacker you can pack 1-n resources and take advantage of demolishedcompressor and its functionality.
npm install demolishedcompressor
Pngify(src: string, dest: string, preHTML?: string, customScript?: string): Promise<any>
static Mjolnir(src: string, dest: string, map: any): Promise<any>;
static Pngify(src: string, dest: string, preHTML?: string, customScript?: string): Promise<any>;
}
Do not pass customScript
Your custom unpacker javascript must consist of a function named z() , this is called by default.
Here follows an example
z = function() {
c = String.fromCharCode;
q = document.querySelector.bind(document);
i = q("img");
x = q("#c").getContext("2d");
x.drawImage(q("img"),0,0);
d = x.getImageData(0, 0, i.width, i.height).data;
b = [];
s = 1E6;
p = b.push.bind(b);
l = function(a) {
var w = (a / d.length) * 100;
q("#p").style.width = w + "%";
for (i = a; i < a + s && i < d.length; i += 4) p(c(d[i])), p(c(d[i + 1])), p(c(d[i + 2]));
a < d.length ? setTimeout(function() {
l(a + s)
}, 100) : (s = b.join("").replace(/\\0/g, " "), (0, eval)(s),q("#p").style.display = "h")
};
l(0)
};
see example/compress-custom.ts for a complete example
let instance = U.getInstance();
instance.loadAndUpack("packedfile.png", (result) => {
// deal with the unpacked result
// i.e JSON.parse, eval etc.
});
import { Compressor } from 'demolishedcompressor';
const html = '<p>replace this with your html</p>'
// packs foo.js into output.png.html
Compressor.Pngify("foo.js","output.png.html",html,true);
Compile and run the script
import { Compressor } from 'demolishedcompressor';
// packs /tiny/rawsong.json into tiny.png
let html = ``;
Compressor.Pngify("/tiny-efflux/rawsong.json","/tiny-efflux/tiny.png",html,false)
FAQs
demolishedcompressor pack's a javascript file into a PNG image with an HTML payload. When opened in a browser, the HTML extracts and executes the javascript.
The npm package demolishedcompressor receives a total of 23 weekly downloads. As such, demolishedcompressor popularity was classified as not popular.
We found that demolishedcompressor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.