{"id":38635953,"url":"https://github.com/cilliemalan/disassembler","last_synced_at":"2026-01-17T09:03:48.001Z","repository":{"id":57212383,"uuid":"411961772","full_name":"cilliemalan/disassembler","owner":"cilliemalan","description":"A library for disassembling various types of machine code. It is a thin  wrapper over the Capstone disassembly framework.","archived":false,"fork":false,"pushed_at":"2021-10-01T09:51:06.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T04:46:10.536Z","etag":null,"topics":["binary-analysis","capstone","disassembler","javascript","nodejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cilliemalan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-30T07:14:57.000Z","updated_at":"2023-04-28T03:04:27.000Z","dependencies_parsed_at":"2022-09-09T05:20:42.099Z","dependency_job_id":null,"html_url":"https://github.com/cilliemalan/disassembler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cilliemalan/disassembler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cilliemalan%2Fdisassembler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cilliemalan%2Fdisassembler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cilliemalan%2Fdisassembler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cilliemalan%2Fdisassembler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cilliemalan","download_url":"https://codeload.github.com/cilliemalan/disassembler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cilliemalan%2Fdisassembler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28504620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary-analysis","capstone","disassembler","javascript","nodejs"],"created_at":"2026-01-17T09:03:47.860Z","updated_at":"2026-01-17T09:03:47.953Z","avatar_url":"https://github.com/cilliemalan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Disassembler\nA library for disassembling various types of machine code. It is a thin \nwrapper over the Capstone disassembly framework, which has been compiled\nto WebAssembly and is automatically loaded when `initialize` is called.\n\n# Usage\n```js\nimport { initialize, Architecture, Mode } from 'disassembler';\n\nasync function disassembleStuff() {\n\n    // initialize the library (loads the capstone WebAssembly binary).\n    // This takes about half a second the first time. Thereafter, it\n    // just returns the capstone object. You can call it once and then\n    // keep the capstone object around.\n    const capstone = await initialize();\n\n    // create an instance that can disassemble Arm Thumb code.\n    const instance = capstone.createInstance(Architecture.ARM, Mode.Thumb);\n\n    // disassemble the code\n    const someCode = Buffer.from(\"4ff00001bde80088d1e800f018bfadbff3ff0b0c86f3008980f3008c4ffa99f6d0ffa201\", \"hex\");\n    const instructions = instance.disassemble(someCode);\n\n    // print out the results\n    for (let insn of instructions) {\n        console.log(`${insn.mnemonic} ${insn.operands}`);\n    }\n}\n\ndisassembleStuff().catch(console.error);\n```\n\nThe code above spits out:\n```asm\nmov.w r1, #0\npop.w {fp, pc}\ntbb [r1, r0]\nit ne\niteet ge\nvdupne.8 d16, d11[1]\nmsr cpsr_fc, r6\nmsr apsr_nzcvqg, r0\nsxtb.w r6, sb, ror #8\nvaddw.u16 q8, q8, d18\n```\n\n## Note about web\nThe Capstone wasm file is quite large (5Mb). In order\nto save space, it is not included when packed with\nwebpack or other tools but rather will be downloaded\nby calling `fetch`. The wasm file is stored on a CDN,\nis compressed to about 500kb, and may be cached indefinitely.\n\nIf this library is included from a regular node project,\nthe wasm data is stored as hex in a javascript file generated\nwhen this library is published.\n\nThis works by specifying a different main file for `browser` in\nthe [package.json](package.json#L6) file. I'm not sure how one\ncan go about overriding this behaviour. The reason it's completely\nseparate is to prevent webpack from including 1Mb of hex stuff\nunnecessarily.\n\n# Work in Progress\nThis module does basic disassembly right now. It does not\nyet support all the various architectures. These things\nare on the to do list:\n- [x] Basic functionality.\n- [ ] Nice error strings.\n- [ ] Non-architecture specific details.\n- [ ] Architecture specific details and enums.\n- [ ] Some documentation, at least JSDoc.\n- [ ] The various helper functions (e.g. getting instruction names).\n- [x] Figure out some kind of way to garbage collect instances.\n\n# License\nFiles in this repo are copyright (c) 2021 Cillié Malan. See [LICENSE](LICENSE) for info.\n\nThis library relies on the [Capstone disassembly framework](http://www.capstone-engine.org/).\nThe sources for the capstone project,\nincluding [modifications for this module](https://github.com/cilliemalan/capstone/tree/wasmhost),\nand any binary files produced therefrom, distributed with this library,\nare [Copyright (c) 2013, COSEINC](https://github.com/cilliemalan/capstone/blob/wasmhost/LICENSE.TXT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcilliemalan%2Fdisassembler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcilliemalan%2Fdisassembler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcilliemalan%2Fdisassembler/lists"}