Commit Graph

3802 Commits

Author SHA1 Message Date
Nguyen Anh Quynh
cbdea7ce19 sparc: fix relative branch target for Sparc64 2017-12-27 14:24:18 +08:00
bezita
1790ccdb1e Fix EFLAGS for the stosb/stosd/stosq/stosw instructions (#1065) 2017-12-22 00:05:47 +08:00
Nguyen Anh Quynh
130545f040 bindings: update after #1064 2017-12-21 09:15:24 +08:00
Tasuku SUENAGA a.k.a. gunyarakun
3f00044ae5 Fix wrong register aliases on arm64 (#1064) 2017-12-21 09:15:00 +08:00
Nguyen Anh Quynh
0acbc9e346 bindings: update after #1064 2017-12-21 09:14:05 +08:00
Tasuku SUENAGA a.k.a. gunyarakun
94ceca3181 Fix wrong register aliases on arm64 (#1064) 2017-12-21 09:13:03 +08:00
keenk
d6b8ad4265 Fix type of eflags (#1063)
changed eflags to long
2017-12-20 22:15:22 +08:00
Nguyen Anh Quynh
ccccef8727 indentation 2017-12-15 15:17:59 +08:00
Nguyen Anh Quynh
2a00340ddb fix signed int overflow reported by Google AutoFuzz at #1060, #1061, #1062 2017-12-15 10:17:56 +08:00
Nguyen Anh Quynh
6c1c82bdd7 sparc: fix #1061 2017-12-15 10:12:54 +08:00
Nguyen Anh Quynh
030b52458a systemz: fix #1062 2017-12-15 10:11:40 +08:00
Nguyen Anh Quynh
d75eedd8bc arm: fix #1060 2017-12-15 10:10:04 +08:00
Jean-David Gadina
3b67ab3ca4 macOS framework - Added a module map for Swift/Objective-C. (#1057) 2017-11-28 00:46:18 +08:00
Jean-David Gadina
80cf2d9d47 macOS framework - Added a module map for Swift/Objective-C. (#1056) 2017-11-23 09:26:39 +08:00
Jean-David Gadina
13f8129bba Updated Xcode project for Xcode 9.1 (#1055) 2017-11-23 09:26:01 +08:00
Jean-David Gadina
afc01dff25 Updated Xcode project for Xcode 9.1 (#1053) 2017-11-22 11:05:28 +08:00
Nguyen Anh Quynh
a105b2d234 cython: add m68x to ext_module_names[] 2017-11-21 15:21:49 +08:00
Jean-David Gadina
0efc9b9c5a 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
96411be363 fix python (cython) bindings 2017-11-21 15:17:24 +08:00
Terry Rodery
38db4d36f0 Update test.c to test_basic.c (#1049) 2017-11-17 21:21:50 +03:00
Nguyen Anh Quynh
811d8ceee6 x86: fix att syntax when imm operand is 0 (#1046) 2017-11-17 10:27:35 +03:00
Nguyen Anh Quynh
a45e860114 x86: fix att syntax when imm operand is 0 (#1046) 2017-11-17 10:26:26 +03:00
Nguyen Anh Quynh
4c96c85a2b 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
8277564617 bindings: update capstone-rs link (#1044) 2017-10-26 20:27:15 +08:00
Nguyen Anh Quynh
94134fd045 cstool: align assembly output 2017-10-25 01:03:24 +08:00
Richard Henderson
5423b215bf 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
236b70ce5c cleanup Makefile for M680K. also include its INC files in dependency 2017-10-21 14:05:02 +07:00
Stephen
891ef94819 more makefile cleanup (#1039)
* more makefile cleanup

* fix spelling mistake
2017-10-21 21:47:38 +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
Travis Finkenauer
de99147c73 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
ae616f901c cleanup makefile (#1038)
use wildcards
2017-10-20 23:17:30 +08:00
Daniel Collin
3b43ddb92c [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
975eebaf67 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
22ecb7c001 start watching brew HEAD builds (#1024) 2017-10-10 20:23:17 +08:00
Nguyen Anh Quynh
ee33de3f29 Mips64: fix the last cherry-pick on selecting getInstruction() 2017-10-09 09:26:41 +08:00
Nguyen Anh Quynh
578677bec5 Revert "cleanup travis and use environment variables"
This reverts commit 63913ef3f6.
2017-10-09 08:53:16 +08:00
Travis Finkenauer
69f9fabefa Mips: Fix selection of disasm handler (#1022) 2017-10-09 08:52:53 +08:00
Travis Finkenauer
2f4bc38eec 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
d926f18f2a cleanup travis and use environment variables 2017-10-08 00:01:53 +08:00
Stephen
97465fba0e 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
c7c6b0503c 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
4470bd824f 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
edb0cc57ac Fix pp field in readPrefix for VEX3 and EVEX (#1015) (#1016) 2017-09-19 08:46:59 +08:00
Richard Henderson
72cd9ee99e Fix pp field in readPrefix for VEX3 and EVEX (#1015) (#1016) 2017-09-19 07:46:00 +07:00
Ruslan Kabatsayev
018d64ab96 cstool: Separate instruction bytes by spaces (#1009) 2017-09-06 21:38:52 +08:00
smart-rabbit
f1201f4093 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
41f765f1f5 cstool: Separate instruction bytes by spaces (#1009) 2017-09-06 20:35:19 +07:00
Matt Suiche
0441af5ce7 Resolve some casting issues with Visual Studio. 2017-09-05 22:20:57 +07:00
Matt Suiche
4e7f49228b - Resolve some casting issues with Visual Studio. (#1007) 2017-09-05 22:15:13 +07:00
Jonas
ca71fc1155 Add posibility to disable universal build for osx 2017-09-05 21:51:07 +07:00