3 Capstone integration for SBCL
5 Capstone [1] is a lightweight multi-platform, multi-architecture disassembly framework.
6 Capstone is based off the LLVM project, and can target a variety of architectures, including but not limiting to
8 Capstone is implemented in C [2], and has several bindings into other languages.
9 A binding into Common Lisp was not previously available.
14 We exported constants and routines from Capstone main header file [3] using the sb-alien SBCL package.
19 SB-CAPSTONE requires having the Capstone library installed, as a shared object.
20 See the Capstone file COMPLILE.TXT for instructions, and then install file "libcapstone.so" where the
21 load-shared-object function can find it.
22 You can set up the LD_LIBRARY_PATH environment variable if necessary.
27 An example on using the bindings can be found on the tests. We rely on sb-alien heavily for passing system addresses to Capstone (where pointers were used in the C analog)
29 Example: using Capstone's cs_open to create a handle
31 (require :sb-capstone)
34 (multiple-value-bind (return-code handle) (sb-capstone:cs-open-for-target '(:x86-64 :little-endian))
39 [1] http://www.capstone-engine.org
40 [2] https://github.com/aquynh/capstone
41 [3] https://github.com/aquynh/capstone/blob/master/include/capstone.h