Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
as-heap-analyzer
Advanced tools
assemblyscript heap dump analysis tooling
npm i -D as-heap-analyzer
--transform as-heap-analyzer/transform/addHeapAnalyzerInfo.mjs
or add following line in asconfig.json
"transform": ["as-heap-analyzer/transform/addHeapAnalyzerInfo.mjs"]
analysis
functionimport { memory } from "../build/debug.js";
import { readFileSync } from "fs";
import { analysis } from "as-heap-analyzer/dist/index.js";
import assert from "assert";
const wasm = readFileSync("build/debug.wasm");
const memoryUsage = analysis(memory, wasm);
memoryUsage.forEach((v, k) => console.log(`${k} use ${v} bytes`));
analysis
functionimport { memory } from "./build/release.js";
import { analysis } from "as-heap-analyzer/dist/index.js";
const wasm = (await (await fetch(new URL("build/release.wasm", import.meta.url))).body.getReader().read()).value;
const memoryUsage = analysis(new Uint8Array(memory.buffer), wasm);
memoryUsage.forEach((v, k) => {
document.body.innerText += `${k} use ${v} bytes\n`;
});
import { dumpUsedMemoryDetail } from "as-heap-analyzer/assembly/index";
trace(dumpUsedMemoryDetail());
npx as-heap-analyzer frame <transformed_wasm_module_path>
copy and paste self-diagnosis result from log to cli
the result should be:
total memory usage is 48300
class ~lib/arraybuffer/ArrayBuffer use 544 bytes
class assembly/index/A use 6400 bytes
class ~lib/array/Array<assembly/index/A> use 48 bytes
class assembly/index/B use 32 bytes
FAQs
assemblyscript heap dump analysis tooling
The npm package as-heap-analyzer receives a total of 3 weekly downloads. As such, as-heap-analyzer popularity was classified as not popular.
We found that as-heap-analyzer 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.