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.
wasm-json-toolkit
Advanced tools
A small toolkit for converting wasm binaries into json and back.
npm install wasm-json-toolkit
const fs = require('fs')
const wasm2json = require('wasm-json-toolkit').wasm2json
const wasm = fs.readFileSync('./test.wasm')
const json = wasm2json(wasm)
console.log(JSON.stringify(json, null, 2))
Install -g
global for cli usage.
wasm2json [FILE]
given a file containing a wasm module produces a json representation
json2wasm [FILE]
given a file containing a json representation produces a wasm module
converts a wasm binary into a json representation
Parameters
Buffer
Returns Object
converts a json representation to a wasm binary
Parameters
Object
Returns Buffer
wast
(module
(func $addTwo (param i32 i32) (result i32)
(i32.add
(get_local 0)
(get_local 1)))
(export "addTwo" (func $addTwo)))
wasm
0x010661646454776f00000a09010700200020016a0b
json
[
{
"name": "preramble",
"magic": [0,97,115,109],
"version": [13,0,0,0]
},
{
"name": "type",
"entries": [
{
"form": "func",
"params": ["i32","i32"],
"return_type": "i32"
}
]
},
{
"name": "function",
"entries": [0]
},
{
"name": "export",
"entries": [
{
"field_str": "addTwo",
"kind": "Function",
"index": 0
}
]
},
{
"name": "code",
"entries": [
{
"locals": [],
"code": [
{
"name": "get_local",
"immediaties": "0"
},
{
"name": "get_local",
"immediaties": "1"
},
{
"return_type": "i32",
"name": "add"
},
{
"name": "end"
}
]
}
]
}
]
FAQs
this convertes wasm binaries to json and json to wasm binaries
The npm package wasm-json-toolkit receives a total of 4 weekly downloads. As such, wasm-json-toolkit popularity was classified as not popular.
We found that wasm-json-toolkit 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.