Commit Graph

112 Commits

Author SHA1 Message Date
b227acc29c New architecture: BPF (#1388)
* Basic changes of new arch - BPF

* Define some constants

* defined some API methods

* Able to print MISC instruction

* Follow Linux coding style

* Ability to show ALU insn names

* decode return

* Add suite/MC/BPF

* decode jump

* decode store

* decode load

* print instruction done

* try to implement BPF_reg_access

* Implements explicit accessed registers and fix some tiny bugs

* Fix unhandled ja case

* Added BPF_REG_OFF do fix wrong display in jump class

* Great I'm able to decode cBPF with eyes

* Fix: misunderstood the 16-byte instruction's imm

* Add ldxdw

* Add extended-all.cs

* Implements cstest/bpf_getdetail.c

* Fix memory leak

* Add BPF to fuzz

* Implemented regs_read and regs_write

* Fix missing write-access on ALU's dst

* Updated cstool/, test_basic.c, test_detail.c, and test_iter.c

* Updated docs

* Fix type of cs_bpf#operands

* Implements python bindings

* Fix some bugs found by self code review

* Remove dummy tests

* remove typeof

* Address comments

* Fix MSVC's warnings and add test_bpf.py to bindings/python/Makefile

* Fix: call is not offset
2019-02-18 17:39:51 +08:00
a7f12d96b0 cstool: print extra options in alphabet order 2019-02-18 10:45:52 +08:00
19351b5b76 cstool: indent Wasm usage 2019-02-18 10:44:12 +08:00
1104bf8bd2 cstool: set prototype for function 'print_string_hex', to silence compiler warning 2019-02-03 14:46:54 +08:00
a1d2810a3c cstool: move code from getopt.h to getopt.c 2019-02-03 14:34:20 +08:00
b6c253e22b cstool: sort flags in alphabet order 2019-02-02 07:44:44 +08:00
0783e3fa38 wasm: silence some compilation warnings 2019-02-02 00:13:52 +08:00
55f242d498 Add webassembly arch (#1359)
* add wasm arch

* fix bug

* delete todo & add wasm into readme
2019-02-01 23:03:47 +08:00
5cf65cf1bd cstool: print mem.scale as int, not uint. bug reported by @hardtobelieve 2019-01-28 12:38:57 +08:00
48ba21041b cstool: cleanup usage instructions 2019-01-23 14:39:01 +08:00
120fe0425a cstool: add MOS65XX to output of -v option 2019-01-09 18:32:33 +08:00
2ff3baa138 cstool -v print out the core build setup 2019-01-09 18:32:33 +08:00
8a6c520e8f Merge branch 'master' into next 2019-01-04 17:24:16 +08:00
82c77d663d cstool: add -s option to turn on skipdata mode on disassembling 2019-01-04 17:23:15 +08:00
77a4c0d00b Merge branch 'master' into next 2018-12-20 22:34:29 +08:00
165383e161 Normalize IS_MINGW checks (and include MSYS, like main Makefile) (#1318)
Following in the steps of #1290
2018-12-20 15:09:27 +08:00
82cd4c0747 Add support for the MOS65XX family such as the MOS 6502.
Signed-off-by: Sebastian Macke <sebastian@macke.de>
2018-12-06 22:53:33 +01:00
60616a6175 cstool: fix memleak to prevent ASAN from complaining (#1222) 2018-07-24 10:19:07 +08:00
cdf269e020 fix warnings on const char * discards qualifiers 2018-07-24 01:41:59 +08:00
76c1c3c4e9 merge next to master 2018-07-20 12:36:50 +08:00
e9861a1192 Merges encoding to next (#1194)
* merge encoding branch into next branch

* added python bindings and updated test to support encoding

* fix python import

* fix py binding fields

* fix disp size printing

* fixed py binding, again

* Update CREDITS.TXT

* fixed formatting and a cast

* Changed param from int to uint8_t, fixed warnings
2018-07-04 22:47:55 +08:00
1da2ae94de EVM: add missing files 2018-03-31 17:32:22 +08:00
9c7a094b58 add Ethereum VM architecture 2018-03-31 17:29:22 +08:00
cc4ace75cc cstool: Add cortexm support (#1100) 2018-03-20 08:52:33 +08:00
16f1887be5 Add cortex-m support to cstool, refactoring and crash fix (#1099)
* cstool: Refactor architecture parsing and fix crash with invalid arch

* cstool: Enable cortex-m decoder
2018-03-19 00:04:27 +08:00
5d4f927488 fix tests & cstool, so we can compile on MSVC 2010 2018-02-14 15:02:05 +08:00
2cf2c1a0fc sparc: change imm type from int32_t to int64_t 2017-12-27 14:46:47 +08:00
94134fd045 cstool: align assembly output 2017-10-25 01:03:24 +08:00
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
018d64ab96 cstool: Separate instruction bytes by spaces (#1009) 2017-09-06 21:38:52 +08:00
41f765f1f5 cstool: Separate instruction bytes by spaces (#1009) 2017-09-06 20:35:19 +07:00
cd77024711 Fix the include path for Android builds when building cstool 2017-08-29 07:35:02 +07:00
464ea46b8d 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
819dd2231e cstool: fix #975 2017-07-26 23:22:46 +08:00
42b6b1f56d cstool: cs_op_count() can return -1. fix #978 2017-07-26 23:16:52 +08:00
3a63649f34 cstool: cs_op_count() can return -1. fix #978 2017-07-26 23:16:00 +08:00
589585ecc1 cstool: some cleanup 2017-07-04 16:04:53 +08:00
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
7a4567612c Honor CS_OPT_UNSIGNED on x86 and add cstool -u (#945) 2017-06-16 02:13:28 +08:00
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
9dff618b04 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:10 +08:00
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 8ab50e80a3688eb8cc3c9e256b1e0809c712a132.

* 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
edf289d784 rebuild cstool when the core changes. fix #932 2017-05-25 23:11:12 +08:00
2af5fce099 rebuild cstool when the core changes. fix #932 2017-05-25 23:10:19 +08:00
c8336e0add cstool: support arm64be 2017-04-25 21:33:56 +08:00
c768fa919f cstool: support arm64be 2017-04-25 21:33:26 +08:00
e963a1e17c Added cstool support for tms320c64x 2017-04-17 11:58:29 +03:00
536e4a11a3 cstool: fix mips64 mode 2017-04-11 09:46:18 +08:00
bd20ee1f75 cstool: fix mips64 mode 2017-04-11 09:45:55 +08:00
c978ea26fb cstool: support armbe mode 2017-03-10 20:31:23 +08:00