https://github.com/czbix/disasm-web
Online Assembler and Disassembler, support offline usage.
https://github.com/czbix/disasm-web
capstone emscripten keystone wasm
Last synced: 12 days ago
JSON representation
Online Assembler and Disassembler, support offline usage.
- Host: GitHub
- URL: https://github.com/czbix/disasm-web
- Owner: CzBiX
- Created: 2022-07-23T08:06:25.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-19T13:32:52.000Z (over 1 year ago)
- Last Synced: 2025-04-16T02:11:39.923Z (12 days ago)
- Topics: capstone, emscripten, keystone, wasm
- Language: TypeScript
- Homepage: https://disasm.czbix.com
- Size: 2.29 MB
- Stars: 44
- Watchers: 2
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# disasm-web
[](https://www.npmjs.com/package/capstone-wasm)
[](https://www.npmjs.com/package/keystone-wasm)Online Assembler and Disassembler.
This project ported [capstone](https://github.com/capstone-engine/capstone) and [keystone](https://github.com/keystone-engine/keystone) into the browser via [emscripten](https://emscripten.org/).
Playground: https://disasm.czbix.com/ (support offline usage)
## NPM packages
There are two packages available: [`capstone-wasm`](https://www.npmjs.com/package/capstone-wasm) and [`keystone-wasm`](https://www.npmjs.com/package/keystone-wasm).### Usage
```js
import {
Const, Capstone, loadCapstone,
} from 'capstone-wasm'await loadCapstone()
const capstone = new Capstone(Const.CS_ARCH_X86, Const.CS_MODE_32)
// the code can be bytes array or Uint8Array
const code = [0x55, 0x8b, 0xec, 0x83, 0xc4, 0x0c, 0xc3]
const insns = capstone.disasm(code, {
address: 0x1000,
})insns.forEach(insn => {
console.log(insn.mnemonic, insn.opStr)
})
``````js
import {
Const, Keystone, loadKeystone,
} from 'keystone-wasm'await loadKeystone()
const capstone = new Keystone(Const.KS_ARCH_X86, Const.KS_MODE_32)
// can separate code by `\n` or `;`
const code = `push ebp
mov ebp, esp
add esp, 0xc
ret`
// bytes is a Uint8Array
const bytes = keystone.asm(code, {
address: 0x1000,
})
```## Cons
Not support detail feature(`CS_OPT_DETAIL`) yet.