Commit Graph

2978 Commits

Author SHA1 Message Date
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
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
13f8129bba Updated Xcode project for Xcode 9.1 (#1055) 2017-11-23 09:26:01 +08:00
Nguyen Anh Quynh
a105b2d234 cython: add m68x to ext_module_names[] 2017-11-21 15:21:49 +08:00
Anton Bolshakov
96411be363 fix python (cython) bindings 2017-11-21 15:17:24 +08: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
94134fd045 cstool: align assembly output 2017-10-25 01:03:24 +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
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
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
Stephen
d926f18f2a cleanup travis and use environment variables 2017-10-08 00:01:53 +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
Richard Henderson
edb0cc57ac Fix pp field in readPrefix for VEX3 and EVEX (#1015) (#1016) 2017-09-19 08:46:59 +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
Jonas
ca71fc1155 Add posibility to disable universal build for osx 2017-09-05 21:51:07 +07:00
Zach Riggle
cd77024711 Fix the include path for Android builds when building cstool 2017-08-29 07:35:02 +07:00
Nguyen Anh Quynh
e87caa789a x86: fix an warning on unintialized vars 2017-08-16 09:01:58 +08:00
Andrew Calvano
166feea41c Bug fix for incorrect operand type in certain load/store instructions on AArch64. (#952) 2017-08-03 23:01:47 +07:00
Alfredo Beaumont
5fc444c073 Add name to relative branch group in supported architectures. (#982) 2017-08-01 16:49:43 +08:00
Fotis Loukos
104832daed Fixed bug in memory operand decoding. (#981)
Fixed bug #979. Decoding a memory operand with a register offset from
the B file would return an incorrect register.
2017-07-31 20:56:29 +08:00
Nguyen Anh Quynh
6cd9313c70 arm: UADD8 updates flags. fix #980 2017-07-31 01:05:28 +07:00
Nguyen Anh Quynh
ff2f6831db binding: update following addition of GRP_BRANCH_RELATIVE 2017-07-30 19:06:29 +08:00
Alfredo Beaumont
f82395b959 Relative branch group (#964)
* Add a new group for relative branching instructions

* x86: Add relative branch group to appropiate instructions

* Rename RELATIVE_BRANCH to BRANCH_RELATIVE

* aarch64: Add relative branch group to appropiate instructions

* arm: Add relative branch group to appropiate instructions

* m68k: Add relative branch group to appropiate instructions

* mips: Add relative branch group to appropiate instructions
2017-07-30 19:05:03 +08:00
Nguyen Anh Quynh
819dd2231e cstool: fix #975 2017-07-26 23:22:46 +08:00
Nguyen Anh Quynh
3a63649f34 cstool: cs_op_count() can return -1. fix #978 2017-07-26 23:16:00 +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
589585ecc1 cstool: some cleanup 2017-07-04 16:04:53 +08:00
Sergi Àlvarez i Capilla
8561f15d66 Refactor cstool to use getopt -100LOC (#953)
* Refactor cstool to use getopt -100LOC

* Add getopt.h for portability

* Do not use os-specific separators in include paths
2017-07-04 15:55:46 +08:00
Snarpix
a2948cca80 Fixes DATA REX_W CALL_PC_REL IMM32 issue (decoded as IMM16) (#883) 2017-06-28 07:07:26 +08:00
Francesco Tamagni
b8342f9b90 Add CS_MODE_MIPS2 to opt-in for COP3 instructions (#939)
* Add CS_MODE_MIPS2 to opt-in for COP3 instructions

* Fix indentation

* Get rid of `+`
2017-06-27 20:56:54 +08:00
radare
7a4567612c Honor CS_OPT_UNSIGNED on x86 and add cstool -u (#945) 2017-06-16 02:13:28 +08:00
Adrian Herrera
42b3ef0233 mingw build: cstool fails to build with mingw (#941)
The correct compiler was not being passed to cstool/Makefile. The expected name
for the capstone lib was also incorrect - there is no "lib" prefix when
compiling with mingw.
2017-06-02 21:49:59 +08:00
Nguyen Anh Quynh
bd66403357 x86: fix FPU flags so const_generator.py can generate proper Python symbols 2017-05-31 21:42:02 +08:00
Nguyen Anh Quynh
f9fabed4d2 bindings: update FPU flags & FPU group for x86 after the last merge 2017-05-31 21:19:50 +08:00
echotyh
572d864b2f Next (#918)
* Add FPUFLAGS information.

* Change the structure insn_op: from uint64_t eflags to union{ uint64_t eflags, uint64_t fpuflags; }.

* Adjust the  modified structure insn_op.

* Add missing flags.

* Change flags information acorrding to xed files and instruction manual.

* Rename fpuflags to fpu_flags.

* Updating flags information accoring to manual and xed files.

* Changing the name eflags to flags.

* Printing the FPU_FLAGS information when it belongs to group X86_GRP_FPU.

* Defining new flags.

* Updating flags information according to manual and xed files.

* Adding X86_GRP_FPU to all the instructions which have modified fpu_flags.

* Solving the conflict problem when do git commit.

* Rectify the annotation within the structure insn_op.

* Supplement fpu flags information for floating-point instructions which missed fpu flags before.

* Print fpu group information when an instructure belongs to X86_GRP_FPU.

* Add two new groups ARM64_GRP_BASE(base instructions) and ARM64_GRP_FPSIMD(SIMD&FP instructions).

* Revert "Add two new groups ARM64_GRP_BASE(base instructions) and ARM64_GRP_FPSIMD(SIMD&FP instructions)."

This reverts commit 8ab50e80a3.

* X86 clean up.

* Clean up arch/X86/X86MappingInsn.inc.

* Double check.

* Delete files.

* Clean up x86.

* Clean up reduce file

* Fix btr

* fix x86
2017-05-29 22:43:47 +08:00
vit9696
158646b843 Added qsort implementation for OS X kernel mode (#934)
* Added qsort implementation for OS X kernel mode

* Added qsort source reference
2017-05-26 09:27:01 +08:00
Nguyen Anh Quynh
e8bd91b8c5 Merge branch 'next' of https://github.com/aquynh/capstone into next 2017-05-25 23:10:26 +08:00
Nguyen Anh Quynh
2af5fce099 rebuild cstool when the core changes. fix #932 2017-05-25 23:10:19 +08:00
vit9696
1c0f3d887c Merge #929 with some changes to get things compile (#930) 2017-05-25 16:01:48 +08:00
Nguyen Anh Quynh
b7bd162539 x86: indentation 2017-05-22 21:36:48 +08:00