
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
disassembler
Advanced tools
A library for disassembling various types of machine code. It is a thin
wrapper over the Capstone disassembly framework, which has been compiled
to WebAssembly and is automatically loaded when initialize is called.
import { initialize, Architecture, Mode } from 'disassembler';
async function disassembleStuff() {
// initialize the library (loads the capstone WebAssembly binary).
// This takes about half a second the first time. Thereafter, it
// just returns the capstone object. You can call it once and then
// keep the capstone object around.
const capstone = await initialize();
// create an instance that can disassemble Arm Thumb code.
const instance = capstone.createInstance(Architecture.ARM, Mode.Thumb);
// disassemble the code
const someCode = Buffer.from("4ff00001bde80088d1e800f018bfadbff3ff0b0c86f3008980f3008c4ffa99f6d0ffa201", "hex");
const instructions = instance.disassemble(someCode);
// print out the results
for (let insn of instructions) {
console.log(`${insn.mnemonic} ${insn.operands}`);
}
}
disassembleStuff().catch(console.error);
The code above spits out:
mov.w r1, #0
pop.w {fp, pc}
tbb [r1, r0]
it ne
iteet ge
vdupne.8 d16, d11[1]
msr cpsr_fc, r6
msr apsr_nzcvqg, r0
sxtb.w r6, sb, ror #8
vaddw.u16 q8, q8, d18
The Capstone wasm file is quite large (5Mb). In order
to save space, it is not included when packed with
webpack or other tools but rather will be downloaded
by calling fetch. The wasm file is stored on a CDN,
is compressed to about 500kb, and may be cached indefinitely.
If this library is included from a regular node project, the wasm data is stored as hex in a javascript file generated when this library is published.
This works by specifying a different main file for browser in
the package.json file. I'm not sure how one
can go about overriding this behaviour. The reason it's completely
separate is to prevent webpack from including 1Mb of hex stuff
unnecessarily.
This module does basic disassembly right now. It does not yet support all the various architectures. These things are on the to do list:
Files in this repo are copyright (c) 2021 Cillié Malan. See LICENSE for info.
This library relies on the Capstone disassembly framework. The sources for the capstone project, including modifications for this module, and any binary files produced therefrom, distributed with this library, are Copyright (c) 2013, COSEINC.
FAQs
A library for disassembling various types of machine code.
We found that disassembler 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.