61 Commits

Author SHA1 Message Date
Catena cyber
883b2042bf Integrate capstone with oss-fuzz (#1150)
Compile the fuzz target with the rest of the tests
2018-06-01 20:47:19 +08:00
Connor Davis
b377747e8e CMakeLists.txt: Add cstool build option (#1118) 2018-04-26 10:16:52 +08:00
Nguyen Anh Quynh
9c7a094b58 add Ethereum VM architecture 2018-03-31 17:29:22 +08:00
Alberto Garcia Illera
3c8e828b14 prefix cs_ to global variables to avoid link problems (#1108)
* prefix cs_ to global variables to avoid link problems

* force Capstone to be build using MT

* fix identation
2018-03-29 22:17:37 +08:00
Andrew D'Addesio
ab86618a2c Fix pkg-config output when using cmake (#1098) 2018-03-18 08:55:51 +08:00
Wolfgang Schwotzer
e8d1f1d4d2 M680X: Target ready for pull request (#1034)
* Added new M680X target. Supports M6800/1/2/3/9, HD6301

* M680X: Reformat for coding guide lines. Set alphabetical order in HACK.TXT

* M680X: Prepare for python binding. Move cs_m680x, m680x_insn to m680x_info. Chec
> k cpu type, no default.

* M680X: Add python bindings. Added python tests.

* M680X: Added cpu types to usage message.

* cstool: Avoid segfault for invalid <arch+mode>.

* Make test_m680x.c/test_m680x.py output comparable (diff params: -bu). Keep xprint.py untouched.

* M680X: Update CMake/make for m680x support. Update .gitignore.

* M680X: Reduce compiler warnings.

* M680X: Reduce compiler warnings.

* M680X: Reduce compiler warnings.

* M680X: Make test_m680x.c/test_m680x.py output comparable (diff params: -bu).

* M680X: Add ocaml bindings and tests.

* M680X: Add java bindings and tests.

* M680X: Added tests for all indexed addressing modes. C/Python/Ocaml

* M680X: Naming, use page1 for PAGE1 instructions (without prefix).

* M680X: Naming, use page1 for PAGE1 instructions (without prefix).

* M680X: Used M680X_FIRST_OP_IN_MNEM in tests C/python/java/ocaml.

* M680X: Added access property to cs_m680x_op.

* M680X: Added operand size.

* M680X: Remove compiler warnings.

* M680X: Added READ/WRITE access property per operator.

* M680X: Make reg_inherent_hdlr independent of CPU type.

* M680X: Add HD6309 support + bug fixes

* M680X: Remove errors and warning.

* M680X: Add Bcc/LBcc to group BRAREL (relative branch).

* M680X: Add group JUMP to BVS/BVC/LBVS/LBVC. Remove BRAREL from BRN/LBRN.

* M680X: Remove LBRN from group BRAREL.

* M680X: Refactored cpu_type initialization for better readability.

* M680X: Add two operands for insn having two reg. in mnemonic. e.g. ABX.

* M680X: Remove typo in cstool.c

* M680X: Some format improvements in changed_regs.

* M680X: Remove insn id string list from tests (C/python/java/ocaml).

* M680X: SEXW, set access of reg. D to WRITE.

* M680X: Sort changed_regs in increasing m680x_insn order.

* M680X: Add M68HC11 support + Reduced from two to one INDEXED operand.

* M680X: cstool, also write '(in mnemonic)' for second reg. operand.

* M680X: Add BRN/LBRN to group JUMP and BRAREL.

* M680X: For Bcc/LBcc/BRSET/BRCLR set reg. CC to read access.

* M680X: Correctly print negative immediate values with option CS_OPT_UNSIGNED.

* M680X: Rename some instruction handlers.

* M680X: Add M68HC05 support.

* M680X: Dont print prefix '<' for direct addr. mode.

* M680X: Add M68HC08 support + resorted tables + bug fixes.

* M680X: Add Freescale HCS08 support.

* M680X: Changed group names, avoid spaces.

* M680X: Refactoring, rename addessing mode handlers.

* M680X: indexed addr. mode, changed pre/post inc-/decrement representation.

* M680X: Rename some M6809/HD6309 specific functions.

* M680X: Add CPU12 (68HC12/HCS12) support.

* M680X: Correctly display illegal instruction as FCB .

* M680X: bugfix: BRA/BRN/BSR/LBRA/LBRN/LBSR does not read CC reg.

* M680X: bugfix: Correctly check for sufficient code size for M6809 indexed addressing.

* M680X: Better support for changing insn id within handler for addessing mode.

* M680X: Remove warnings.

* M680X: In set_changed_regs_read_write_counts use own access_mode.

* M680X: Split cpu specific tables into separate *.inc files.

* M680X: Remove warnings.

* M680X: Removed address_mode. Addressing mode is available in operand.type

* M680X: Bugfix: BSET/BCLR/BRSET/BRCLR correct read/modify CC reg.

* M680X: Remove register TMP1. It is first visible in CPU12X.

* M680X: Performance improvement + bug fixes.

* M680X: Performance improvement, make cpu_tables const static.

* M680X: Simplify operand decoding by using two handlers.

* M680X: Replace M680X_OP_INDEX by M680X_OP_CONSTANT + bugfix in java/python/ocaml bindings.

* M680X: Format with astyle.

* M680X: Update documentation.

* M680X: Corrected author for m680x specific files.

* M680X: Make max. number of architectures single source.
2017-10-21 21:44:36 +08:00
Nguyen Anh Quynh
fc16f5a7f0 cmake: do not set libsuffix=64 on MacOS. fix issue #963 2017-07-19 22:46:38 +08:00
Fernie
88c1bd8cf1 detect 64bit library location. compatibility for 64bit systems. (#963)
credit goes to Theo. (Theodore Papadopoulo Theodore.Papadopoulo at inria.fr https://cmake.org/pipermail/cmake/2013-July/055374.html)
2017-07-18 08:27:29 +08:00
Nguyen Anh Quynh
ea6bca1524 cmake: build static MSVCRT by default 2017-05-09 00:35:05 -07:00
Gabor Buella
b86e4b98dc cmake - fix SOVERSION property used for libcapstone.so (#914)
It was set as a global property before, but cmake appears to ignore that,
even after the following fix:
-set_property(GLOBAL PROPERTY SOVERSION SOVERSION ${VERSION_MAJOR})
+set_property(GLOBAL PROPERTY SOVERSION ${VERSION_MAJOR})

So this patch removes the global property, and SOVERSION is now specified as
a target specific property. The result of the cmake install target seems better:

Before:

$ ls -la lib
4375834 May  1 16:05 libcapstone.a
3510040 May  1 16:05 libcapstone.so

After:

$ ls -la lib
4375834 May  1 16:05 libcapstone.a
     16 May  1 16:08 libcapstone.so -> libcapstone.so.4
     20 May  1 16:08 libcapstone.so.4 -> libcapstone.so.4.0.0
3510040 May  1 16:08 libcapstone.so.4.0.0

The SOVERSION property triggers symlink creation in cmake, see:
https://cmake.org/cmake/help/v3.0/prop_tgt/SOVERSION.html
2017-05-02 09:24:45 +08:00
Gabor Buella
98a0d39fd3 cmake: install pkg config file 2017-04-30 11:50:03 +02:00
Fotis Loukos
ae6f2d1411 Added support for the TMS320C64x architecture. 2017-04-14 17:00:40 +03:00
Nguyen Anh Quynh
2cdc76b8cd cmake: Add a check of MSVC variable before setting flags that link the library. ported from PR #814 2016-11-16 08:17:02 +08:00
Nguyen Anh Quynh
4e52d98ced cstool: prepare for multiple C sources 2016-10-19 23:01:58 +08:00
Nguyen Anh Quynh
c5e661cbb8 cstool: compile with CMake using CMakeLists.txt in root dir 2016-10-11 23:24:44 +08:00
Nguyen Anh Quynh
0c6cc6a044 cstool: support CMake 2016-10-11 16:51:20 +08:00
tandasat
d4ef430b33 port Windows driver support 2016-05-11 21:48:32 -07:00
Daniel Collin
e8a4e98181 Fixed missing includes + changed CMakeLists.txt
Changes due to renaming and moving of files
2015-10-04 14:22:58 +02:00
Nguyen Anh Quynh
1e975049e2 CMake: better support for M68K 2015-10-04 14:56:35 +08:00
Daniel Collin
2ee675c10a This adds M68K support to Capstone 2015-10-02 20:47:00 +02:00
Taras Tsugrii
9a638e6d91 Resolve cmake project version policy warning 2015-08-04 11:48:55 -07:00
Taras Tsugrii
72403a5f0a Fix policy warning 2015-08-04 10:34:20 -07:00
Taras Tsugrii
753f52997b Fix bug in option propagation.
Used without {} SUPPORTED_ARCHITECTURES's name is used as a value, resulting in
not propagating any of the option definitions. Also added diagnostic to be
explicit about supported architectures.
2015-07-31 10:34:37 -07:00
Taras Tsugrii
63fbf8e560 Include tests only for supported architectures.
Capstone conveniently provides options to enable/disable specific architectures
which is very useful for trimming the size of the binary, but those options are
ignored in some tests, so when say X86 architecture is not included, some tests
would fail.

This change conditionally includes tests only for supported architectures.
2015-07-30 13:01:25 -07:00
Yegor Derevenets
6739f9fb13 Remove reference to missing osxkernel_inttypes.h from CMakeLists.txt 2015-06-20 12:25:42 +02:00
Yegor Derevenets
2c073468d8 Added test build target, fixed CMake warning
https://github.com/aquynh/capstone/issues/376
2015-05-31 09:01:38 +02:00
Nguyen Anh Quynh
0b96545f66 new option CS_OPT_MNEMONIC to customize instruction mnemonic 2015-04-26 22:54:41 +08:00
learn_more
3ff5dc5faf Also include the common headers. 2015-04-22 21:03:47 +02:00
learn_more
b68d6a9b01 Split headers and source in CMake
Headers and source are grouped per project.
2015-04-22 19:35:47 +02:00
learn_more
21a26950ac whitespace, as requested. 2015-04-15 07:24:59 +08:00
learn_more
147d95b6ce Change msvc ImportLib for static target to 'capstone_dll.lib'
This is the same as e268f46 changed in the vcxproj file.
2015-04-15 07:24:47 +08:00
reverser
160e198584 Add support to embed Capstone 3.x branch into OS X kernel extensions. 2015-04-09 18:28:19 +01:00
Nguyen Anh Quynh
70453c8b1e CMake: add new option CAPSTONE_BUILD_STATIC_RUNTIME 2015-02-04 10:34:18 +08:00
Nguyen Anh Quynh
c0f69e1f5b CMake: bump version to 4.0 2015-01-30 11:26:26 +08:00
flyingsymbols
d91f964d40 * Fixed bug in Thumb2 pop caused by me incorrectly assuming that
ARM_SP == 13, ARM_LR == 14, and ARM_PC == 15, which is not the case
* updated CMakeLists to include building arm regression test
* added explicit casts for 64 bit visual studio 2012 build to get around
  truncation warnings from size_t conversion
2014-10-23 12:04:23 -04:00
Nguyen Anh Quynh
a8fd71f406 CMake: fix option CAPSTONE_X86_ATT_DISABLE. bug reported by Yegor Derevenets 2014-10-14 07:55:30 +08:00
Nguyen Anh Quynh
0a2eca7c6c modify API cs_disasm_iter() and add new API cs_malloc(). also adds sample code test_iter.c 2014-10-11 00:36:16 +08:00
Yegor Derevenets
ebc4ced3cf Fixed a typo in a CMake option name 2014-09-22 10:43:03 +02:00
Yegor Derevenets
17176cd838 platform.h must be also installed 2014-09-21 16:11:34 +02:00
Nguyen Anh Quynh
8f67ec29e5 Added CAPSTONE prefix to CMake options 2014-09-20 10:55:50 +08:00
Yegor Derevenets
b4d78d916e Added CAPSTONE prefix to CMake options 2014-09-19 18:39:22 +02:00
Nguyen Anh Quynh
d17e28c7de cmake: rename static library libcapstone.lib to capstone.lib 2014-08-27 10:57:43 +08:00
baguette
86e845056d renamed CAPSTONE_NO_ATT to CAPSTONE_X86_ATT_DISABLE, added options to makefile, cmake, compile.txt 2014-08-17 20:59:05 +02:00
Ali Rizvi-Santiago
10053ba626 Modified CMakeLists.txt to re-enable support for building both static and shared versions of the library.
Removed definition of CAPSTONE_STATIC from capstone.h due to dllimport only really being a performance optimization while CAPSTONE_SHARED is only needed when building the shared version of the library.
2014-06-03 21:07:03 +00:00
Nguyen Anh Quynh
1969b83b9b windows: expose public APIs with dllimport for user apps 2014-06-03 23:10:07 +08:00
Nguyen Anh Quynh
07c3693cf2 cmake: properly export public APIs in capstone.DLL. thanks to Daniel Pistelli for helping to fix this issue 2014-06-03 18:33:15 +08:00
Nguyen Anh Quynh
d765ab21cb cmake: define macro CAPSTONE_USE_SYS_DYN_MEM when USE_DEFAULT_ALLOC is defined 2014-06-03 17:38:29 +08:00
Nguyen Anh Quynh
de8c689b42 cmake: bump version 2014-05-31 10:45:15 +08:00
Nguyen Anh Quynh
758fcbe69f cmake: fix CMakeLists.txt: rename library to 'capstone' & build static/shared libs in unified way. patch by Daniel Pistelli 2014-05-31 10:44:27 +08:00
Nguyen Anh Quynh
ecc5ffb16c cmake: use USE_SYS_DYN_MEM instead of USE_DEFAULT_ALLOC for consistency 2014-05-28 22:14:55 +08:00