@kreijstal/capstone-wasm
v6.0.0-alpha.11.build.1
Published
Capstone 6.0.0-Alpha11 disassembler for the browser, all 23 architectures
Readme
@kreijstal/capstone-wasm
Capstone 6.0.0-Alpha11 disassembler for the browser, all 23 architectures
Upstream: https://github.com/capstone-engine/capstone
Use
Pinned to this version, from a CDN:
https://cdn.jsdelivr.net/npm/@kreijstal/[email protected]/<file>
https://unpkg.com/@kreijstal/[email protected]/<file>Reproducing this build
Everything here is built from source; nothing prebuilt is repackaged. The script that produced these files is included as build/build.sh.
Toolchain
- emscripten:
emcc 6.0.9-git (4e4223852a0835923411059a3929907d7df1232e)from the Arch Linux packageemscripten 6.0.9-1(installed at /usr/lib/emscripten; LLVMclang version 24.0.0git, Binaryenwasm-opt version 132 (version_132-49-gd03c25ea43)) - Node.js v22.23.2, CMake 4.4.3, Arch Linux
- No emsdk: the script puts /usr/lib/emscripten first on PATH and unsets EMSDK/EM_CONFIG, so every object (including emscripten's own libc/libc++) comes from that one emcc
Sources
| Source | Pin |
|---|---|
| capstone-engine/capstone | tag 6.0.0-Alpha11 (commit b2bf6327b5c7dc43829130b7ccdb02ef9a65a990) |
| build/wrapper/cswasm.c | a small C API over Capstone, linked in |
Rebuilding from a fresh clone gave byte-identical files.
Steps
On Arch Linux with the emscripten package installed (pacman -S emscripten):
mkdir capstone-wasm && cd capstone-wasm && cp /path/to/this/package/build/* .
./build.shThe script fetches the pinned sources itself and refuses to run with any emcc other than /usr/lib/emscripten/emcc; the output lands in dist/. Compare it against the checksums below.
The comment at the top of the build script, verbatim:
Build Capstone (github.com/capstone-engine/capstone, tag 6.0.0-Alpha11) to
WebAssembly, from source, with the SYSTEM emscripten (/usr/lib/emscripten,
Arch package emscripten 6.0.9), into ./dist/ for goldenlayouteditor's
/capstone/ route (the ELF viewer's disassembler, public/elf-viewer/).
No emsdk / other emscripten and no prebuilt capstone.js is ever used:
/usr/lib/emscripten is first on PATH and every EMSDK/EM_CONFIG variable is
unset, so emcc uses its own /usr/lib/emscripten/.emscripten.
Capstone is built as a static library with upstream's CMakeLists (all of its
architectures: x86/x86-64, ARM/Thumb, AArch64, RISC-V, MIPS, PowerPC, SPARC,
Xtensa, SystemZ, M68K, M680X, MOS65XX, TriCore, SH, LoongArch, HPPA, Alpha,
ARC, BPF, XCore, TMS320C64x, EVM, WASM; this version has no AVR), then linked
with wrapper/cswasm.c, a small C API (packed instruction records, enum values
by name) into an ES module:
dist/capstone.mjs the emscripten glue, `export default createCapstone`
dist/capstone.wasm (+ capstone.wasm.gz, served gzip-encoded)
dist/BUILDINFO versions, commit, compiler, architectures
Usage: ./build.sh fetch (if needed) and build
SKIP_FETCH=1 ./build.sh reuse the checked-out sourceChecksums of the published files
5401ff9378e3c4238b01bdc0a2cc3977ef269a377f22c2bffb86106404693637 BUILDINFO
02052e485d84bd26b297e5622b32d2759d6bb614564adbf7a5ee35641f5d445d capstone.mjs
dc1d3ac8735bd80e156e1ff0d5a25afdc92baf30a9bab817fe3fdc4163c9879e capstone.wasmLicenses
BSD-3-Clause AND Apache-2.0 WITH LLVM-exception. The license texts of everything compiled in are in LICENSES/.
