
Research
Security News
Malicious npm Packages Target BSC and Ethereum to Drain Crypto Wallets
Socket uncovered four malicious npm packages that exfiltrate up to 85% of a victimβs Ethereum or BSC wallet using obfuscated JavaScript.
A JavaScript library to use ICO. Works on both Node.js and the browser.
npm install icojs
import { isICO, parseICO } from 'icojs';
import { isICO, parseICO } from 'icojs/browser';
or
<script type="text/javascript" src="node_modules/icojs/dist/ico.js"></script>
To fully use this library, browsers must support JavaScript typed arrays, Canvas API and Promise. Chrome, Edge 12, Firefox and Safari 9 support these functions.
import { readFile, writeFile } from 'node:fs/promises';
import { parseICO } from 'icojs';
const buffer = await readFile('favicon.ico');
const images = await parseICO(buffer, 'image/png');
// save as png files
images.forEach(image => {
const file = `${image.width}x${image.height}-${image.bpp}bit.png`;
const data = Buffer.from(image.buffer);
writeFile(file, data);
});
<input type="file" id="input-file" />
<script>
document.getElementById('input-file').addEventListener('change', evt => {
// use FileReader for converting File object to ArrayBuffer object
var reader = new FileReader();
reader.onload = async e => {
const images = await ICO.parseICO(e.target.result);
// logs images
console.dir(images);
};
reader.readAsArrayBuffer(evt.target.files[0]);
}, false);
</script>
https://egy186.github.io/icojs/#demo
boolean
βPromise.<Array.<ParsedImage>>
βboolean
βCheck the ArrayBuffer is valid ICO.
Kind: global method of ICO
Returns: boolean
- True if arg is ICO.
Param | Type | Description |
---|---|---|
source | ArrayBuffer | Buffer | ICO file data. |
Promise.<Array.<ParsedImage>>
βParse ICO and return some images.
Kind: global method of ICO
Returns: Promise.<Array.<ParsedImage>>
- Resolves to an array of ParsedImage.
Param | Type | Default | Description |
---|---|---|---|
buffer | ArrayBuffer | Buffer | ICO file data. | |
[mime] | string | "image/png" | MIME type for output. |
object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
width | number | Image width. |
height | number | Image height. |
bpp | number | Image color depth as bits per pixel. |
buffer | ArrayBuffer | Image buffer. |
MIT license
FAQs
parse ico file
The npm package icojs receives a total of 2,506 weekly downloads. As such, icojs popularity was classified as popular.
We found that icojs demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
Socket uncovered four malicious npm packages that exfiltrate up to 85% of a victimβs Ethereum or BSC wallet using obfuscated JavaScript.
Security News
TC39 advances 9 JavaScript proposals, including Array.fromAsync, Error.isError, and Explicit Resource Management, which are now headed into the ECMAScript spec.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.