Last active
August 29, 2015 14:01
-
-
Save parasyte/1fe794b018b7d8b50ef0 to your computer and use it in GitHub Desktop.
x86_64 example using Capstone bindings for node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment