<commit_before># node-capstone

`node-capstone` provides Node.js bindings for the
[Capstone](https://github.com/aquynh/capstone) disassembler library, allowing
binary data in `Buffer` objects to be disassembled using any of Capstone's
supported architectures.

### Dependencies

* [node.js v0.10.x](https://nodejs.org/)
    * [npm](https://www.npmjs.org/)
* [capstone](http://www.capstone-engine.org/download.html)

Additionally, the Capstone library version needs to match the binding's version
or it will throw an exception.

### Install

`npm install capstone`

### Basic usage

```javascript
var capstone = require("capstone");

var code = new Buffer([
    0x55, 0x48, 0x8b, 0x05, 0xb8, 0x13, 0x00, 0x00
]);

var cs = new capstone.Cs(capstone.ARCH_X86, capstone.MODE_64);

cs.detail = true;
cs.disasm(code, 0x1000).forEach(function (insn) {
    console.log(
        "0x%s:\t%s\t%s\t%s",
        insn.address.toString(16), insn.mnemonic, insn.op_str,
        JSON.stringify(insn.detail)
    );
});

cs.close();
```

For other examples, see the tests in the `spec` directory.

Full documentation is available at https://parasyte.github.io/node-capstone-docs

### License

The source code is hereby released under the MIT License. The full text of the
license appears below.

Copyright (c) 2014 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in<commit_msg>[#1] Update README with clear information regarding the `libcapstone` dependency.<commit_after># node-capstone

`node-capstone` provides Node.js bindings for the
[Capstone](https://github.com/aquynh/capstone) disassembler library, allowing
binary data in `Buffer` objects to be disassembled using any of Capstone's
supported architectures.

### Dependencies

* [node.js v0.10.x](https://nodejs.org/)
    * [npm](https://www.npmjs.org/)
* [Capstone](http://www.capstone-engine.org/)


### Install

`npm install capstone`

#### libcapstone

The Capstone library is not included, and must be installed separately. The
recommended method to install on OSX is using homebrew:

`brew install capstone`

On Windows and Linux, install a pre-compiled binary from the
[Capstone download](http://www.capstone-engine.org/download.html) page, or
build from source.

Ensure `libcapstone` is available in your PATH. Additionally, the `libcapstone`
version needs to match the binding's version.

### Basic usage

```javascript
var capstone = require("capstone");
var code = new Buffer([ 0x55, 0x48, 0x8b, 0x05, 0xb8, 0x13, 0x00, 0x00 ]);

var cs = new capstone.Cs(capstone.ARCH_X86, capstone.MODE_64);

cs.detail = true;
cs.disasm(code, 0x1000).forEach(function (insn) {
    console.log(
        "0x%s:\t%s\t%s\t%s",
        insn.address.toString(16), insn.mnemonic, insn.op_str,
        JSON.stringify(insn.detail)
    );
});

cs.close();
```

For other examples, see the tests in the `spec` directory.

Full documentation is available at https://parasyte.github.io/node-capstone-docs

### License

The source code is hereby released under the MIT License. The full text of the
license appears below.

Copyright (c) 2014 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
{'fraction_non_alphanumeric': 0.11991626794258373, 'fraction_numerical': 0.024820574162679427, 'mean_word_length': 4.360576923076923, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6972696', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1054, 'n_words': 352}