Commit Graph

3795 Commits

Author SHA1 Message Date
Nguyen Anh Quynh db15616594 sparc: fix #1061 2017-12-15 10:12:54 +08:00
Nguyen Anh Quynh 4582a67b85 systemz: fix #1062 2017-12-15 10:11:40 +08:00
Nguyen Anh Quynh 449b17d6ca arm: fix #1060 2017-12-15 10:10:04 +08:00
Jean-David Gadina bc8a649b35 macOS framework - Added a module map for Swift/Objective-C. (#1057) 2017-11-28 00:46:18 +08:00
Jean-David Gadina 93bfcf16c1 macOS framework - Added a module map for Swift/Objective-C. (#1056) 2017-11-23 09:26:39 +08:00
Jean-David Gadina 69f37989c7 Updated Xcode project for Xcode 9.1 (#1055) 2017-11-23 09:26:01 +08:00
Jean-David Gadina fe36ea9840 Updated Xcode project for Xcode 9.1 (#1053) 2017-11-22 11:05:28 +08:00
Nguyen Anh Quynh 8c472d0ccf cython: add m68x to ext_module_names[] 2017-11-21 15:21:49 +08:00
Jean-David Gadina 171731a583 Added an explicit cast to silence a compiler warning casting a parameter to an enum type (). (#1052) 2017-11-21 10:19:29 +03:00
Anton Bolshakov 9f1d438d6c fix python (cython) bindings 2017-11-21 15:17:24 +08:00
Terry Rodery 96b131a603 Update test.c to test_basic.c (#1049) 2017-11-17 21:21:50 +03:00
Nguyen Anh Quynh 6abcc704fd x86: fix att syntax when imm operand is 0 (#1046) 2017-11-17 10:27:35 +03:00
Nguyen Anh Quynh f5045f03c3 x86: fix att syntax when imm operand is 0 (#1046) 2017-11-17 10:26:26 +03:00
Nguyen Anh Quynh e0d1f3f87b x86: fix immediate operand for AND instruction in ATT mode (issue #1047) 2017-11-11 03:00:05 +08:00
Tasuku SUENAGA a.k.a. gunyarakun 1145eb2734 bindings: update capstone-rs link (#1044) 2017-10-26 20:27:15 +08:00
Nguyen Anh Quynh e965a58ef4 cstool: align assembly output 2017-10-25 01:03:24 +08:00
Richard Henderson 22ead3e0bf Constify backend data (#1040)
* Constify string literals

Use -Wwrite-strings to force string literals to be of
type "const char[]", then fix up all warning fallout.

* Constify common infrastructure

Step one in allowing backend data to be readonly.
Minimal changes to backends for now; just set all pointers
in common structs that aren't modified to const.

* Constify AArch64 backend

Section size changes within libcapstone.so are

-.rodata               602587
-.data.rel.ro          228416
-.data                1003746
+.rodata               769051
+.data.rel.ro          241120
+.data                 824578

* Constify ARM backend

Section size changes within libcapstone.so are

-.rodata               769051
-.data.rel.ro          241120
-.data                 824578
+.rodata               959835
+.data.rel.ro          245120
+.data                 629506

* Constify Mips backend

Section size changes within libcapstone.so are

-.rodata               959835
-.data.rel.ro          245120
-.data                 629506
+.rodata              1069851
+.data.rel.ro          256416
+.data                 508194

* Constify PowerPC backend

Section size changes within libcapstone.so are

-.rodata              1069851
-.data.rel.ro          256416
-.data                 508194
+.rodata              1142715
+.data.rel.ro          272224
+.data                 419490

* Constify Sparc backend

Section size changes within libcapstone.so are

-.rodata              1142715
-.data.rel.ro          272224
-.data                 419490
+.rodata              1175227
+.data.rel.ro          277536
+.data                 381666

* Constify SystemZ backend

Section size changes within libcapstone.so are

-.rodata              1175227
-.data.rel.ro          277536
-.data                 381666
+.rodata              1221883
+.data.rel.ro          278016
+.data                 334498

* Constify X86 backend

Section size changes within libcapstone.so are

-.rodata              1221883
-.data.rel.ro          278016
-.data                 334498
+.rodata              1533531
+.data.rel.ro          281184
+.data                  19714

* Constify XCore backend

Section size changes within libcapstone.so are

-.rodata              1533531
-.data.rel.ro          281184
-.data                  19714
+.rodata              1553026
+.data.rel.ro          281280
+.data                     40
2017-10-22 08:45:40 +08:00
Nguyen Anh Quynh d7281e9ea7 cleanup Makefile for M680K. also include its INC files in dependency 2017-10-21 14:05:02 +07:00
Stephen 1ec3060d08 more makefile cleanup (#1039)
* more makefile cleanup

* fix spelling mistake
2017-10-21 21:47:38 +08:00
Wolfgang Schwotzer 22b4d0eb41 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
Travis Finkenauer 8998a3a1d5 ppc: fix endian check (#1029)
* Remove `big_endian` field of `cs_struct`

Added a helper macro `MODE_IS_BIG_ENDIAN()` to check if
`CS_MODE_BIG_ENDIAN` is set.

Refactored `cs_open()` check for valid mode out of arch-specific code
into arch-independent code. Also added a valid mode check to
`cs_option()`.  The checks use a new global array
`arch_disallowed_mode_mask[]`, which is initialized in the arch-specific
`*_enable()` functions.

Fixes bug where endianness could not be set for ppc.

* Fix Mac OS brew for Travis CI
2017-10-20 23:33:24 +08:00
Stephen 572a4ae56a cleanup makefile (#1038)
use wildcards
2017-10-20 23:17:30 +08:00
Daniel Collin 4b2b160ef0 [M68K] Fixed invalid base reg (#1028)
This is one of those “how did this ever work?” changes. Problem was that as m68k_op was aliased with the imm value so when changing that to something big it would trash the values in the mem struct which would make things go really bad.

Now m68k_op_mem has been moved out of the union so this will not happen again. Also fixed instruction printing bug related to this (just happend to “work” due to the old union layout)
2017-10-13 09:06:01 +08:00
obs1dium 33f39e1632 Fix undefined behavior when disassembling ud0 x86 instructions (#1032)
* fix undefined behavior due to uninitialized memory

* fix bad calloc call
2017-10-13 09:04:16 +08:00
Stephen f524bc092c start watching brew HEAD builds (#1024) 2017-10-10 20:23:43 +08:00
Stephen 4e532107de start watching brew HEAD builds (#1024) 2017-10-10 20:23:17 +08:00
Nguyen Anh Quynh f5ee69e42b Mips64: fix the last cherry-pick on selecting getInstruction() 2017-10-09 09:26:41 +08:00
Nguyen Anh Quynh 99e303bdd4 Revert "cleanup travis and use environment variables"
This reverts commit 63913ef3f6.
2017-10-09 08:53:16 +08:00
Travis Finkenauer c1dbc8a42e Mips: Fix selection of disasm handler (#1022) 2017-10-09 08:52:53 +08:00
Travis Finkenauer 94bce437e8 Fix selection of mips disasm handler (#1022)
* Fix selection of mips disasm handler

handle->disasm was incorrectly set to Mips64_getInstruction if CS_MODE_MIPS32R6
was set but CS_MODE_32 was not set. Now, CS_MODE_32 is set automatically if
CS_MODE_MIPS32R6 is set.

* Align with current style
2017-10-09 08:44:01 +08:00
Stephen 63913ef3f6 cleanup travis and use environment variables 2017-10-08 00:01:53 +08:00
Stephen 20343cc03b cleanup travis and use environment variables (#1021)
* cleanup travis and use environment variables

* use global to prevent matrix expansion
2017-10-07 23:59:17 +08:00
Fernie c745e64573 fixed hardcoded paths with variables. (#1018)
* fixed hardcoded paths with variables.

cmake pkg-config file fixed hardcoded paths with variables. CMakeLists.txt line 394 needs to be modified
> configure_file("capstone.pc.in" "capstone.pc" @ONLY)

* forgot to add 64bit support variable.
2017-09-27 09:32:54 +08:00
Fernie a1eeb6fdfa fixed hardcoded paths with variables. (#1018)
* fixed hardcoded paths with variables.

cmake pkg-config file fixed hardcoded paths with variables. CMakeLists.txt line 394 needs to be modified
> configure_file("capstone.pc.in" "capstone.pc" @ONLY)

* forgot to add 64bit support variable.
2017-09-27 09:31:42 +08:00
Richard Henderson 629ae6653b Fix pp field in readPrefix for VEX3 and EVEX (#1015) (#1016) 2017-09-19 08:46:59 +08:00
Richard Henderson a279481dbf Fix pp field in readPrefix for VEX3 and EVEX (#1015) (#1016) 2017-09-19 07:46:00 +07:00
Ruslan Kabatsayev 02f7296a33 cstool: Separate instruction bytes by spaces (#1009) 2017-09-06 21:38:52 +08:00
smart-rabbit 881f9201d9 retrieve and print "status register updates" info (#995)
is equal to the code in https://github.com/aquynh/capstone/blob/next/tests/test_x86.c
2017-09-06 20:37:21 +07:00
Ruslan Kabatsayev 4aec4de0c1 cstool: Separate instruction bytes by spaces (#1009) 2017-09-06 20:35:19 +07:00
Matt Suiche 394cdfc11e Resolve some casting issues with Visual Studio. 2017-09-05 22:20:57 +07:00
Matt Suiche 782d339fc7 - Resolve some casting issues with Visual Studio. (#1007) 2017-09-05 22:15:13 +07:00
Jonas 7a274e24fb Add posibility to disable universal build for osx 2017-09-05 21:51:07 +07:00
Jonas 60f17f5b70 Add posibility to disable universal build for osx. (#1004)
Fixes #1003
2017-09-05 21:45:48 +07:00
Zach Riggle 596d31659c Fix the include path for Android builds when building cstool 2017-08-29 07:35:02 +07:00
Zach Riggle 8f813d4487 Fix the include path for Android builds when building cstool (#1000)
Previously, the CFLAGS= statement would strip --sysroot from CFLAGS.
2017-08-29 07:23:03 +07:00
Nguyen Anh Quynh c10a631e1e x86: fix an warning on unintialized vars 2017-08-16 09:01:58 +08:00
Andrew Calvano eeceed2cbe Bug fix for incorrect operand type in certain load/store instructions on AArch64. (#952) 2017-08-03 23:01:47 +07:00
Andrew Calvano 7925323569 Bug fix for incorrect operand type in certain load/store instructions on AArch64. (#952) 2017-08-03 23:00:53 +08:00
Nguyen Anh Quynh 088340d2c3 bump PKG_TAG to rc3 2017-08-03 09:36:31 +07:00
Alfredo Beaumont 9f6b28cc0b Add name to relative branch group in supported architectures. (#982) 2017-08-01 16:49:43 +08:00