Commit Graph

1478 Commits

Author SHA1 Message Date
Nguyen Anh Quynh
eb4dcfb214 arm: sync with llvm 7.0.1 2019-03-16 15:22:15 +08:00
Catena cyber
cb2940ccf6 Fix memory leak in RISC V (#1424) 2019-03-15 12:31:17 +08:00
ceeac
b5964c1bfc Fix #1420: Capstone 4 fails to build when targeting UWP (#1421) 2019-03-14 23:27:55 +08:00
Nguyen Anh Quynh
34d92258e0 riscv: coding style cleanup 2019-03-09 08:47:11 +08:00
z
b8fcf27b22 RISCV support ISRV32/ISRV64 (#1401)
* Added RISCV dir to contain the RISCV architecture engine code. Adding the TableGen files generated from llvm-tblgen. Add Disassembler.h

* Started working on RISCVDisassembler.c - RISCV_init(), RISCVDisassembler_getInstruction, and RISCV_getInstruction

* Added all functions to RISCVDisassembler.c and needed modifications to RISCVGenDisassemblerTables.inc. Add and modified RISCVGenSubtargetInfo.inc. Start creation of RISCVInstPrinter.h

* Finished RISCVGenAsmWriter.inc. Finished RISCVGenRegisterInfo.inc. Minor fixes to RISCVDisassembler.c. Working on RISCVInstPrinter

* Finished RISCVInstPrinter, RISCVMapping, RISCVBaseInfo, RISCVGenInstrInfo.inc, RISCVModule.c. Working on riscv.h

* Backport it from: 0db412ce3b

* All RISCV files added. Compiled correctly and initial test for ADD, ADDI, AND works properly.

* Add refactored cs.c for RISCV

* Testing all I instructions in test_riscv.c

* Modify the orignal backport for RISCVGenRegisterInfo.inc, capstone.h and test_iter to work w/ the current code strcuture

* Fix issue with RISCVGenRegisterInfo.inc - RISCVRegDesc[] (Excess elements in struct initializer). Added RISCV tests to test_iter.c

* fixed bug related to incorrect initialization of memory after malloc

* fix compile bug

* Fix compile errors.

* move riscv.h to include/capstone

* fix indentation issues

* fix coding style issues

* Fix indentation issues

* fix coding style

* Move variable declaration to the top of the block

* Fix coding indentation

* Move some stuff into RISCVMappingInsn.inc

* Fix code sytle

* remove cs_mode support for RISCV

* update asmwriter-inc to LLVM upstream

* update the .inc files to riscv upstream

* update riscv disassembler function for suport 16bit instructions

* update printer & tablegen inc files which have fixed arguments mismatch

* update headers and mapping source

* add riscv architecture specific test code

* fix all RISCV tons of compiler errors

* pass final tests

* add riscv tablegen patchs

* merge with upstream/next

* fix cstool missing riscv file

* fix root Makefile

* add new TableGen patchs for riscv

* fix cmakefile.txt of missing one riscv file

* fix declaration conflict

* fix incompatible declaration type

* change riscvc from arch to mode

* fix test_riscv warnning

* fix code style and add riscv part of test_basic

* add RISCV64 mode

* add suite for riscv

* crack fuzz test

* fix getfeaturebits test add riscvc

* fix test missing const qualifier warnning

* fix testcase type mismatch

* fix return value missing

* change getfeaturebits test

* add test cs files

* using a winder type contain the decode string

* fix a copy typo

* remove useless mode for riscv

* change cs file blank type

* add repo for update_riscv & fix cstool missing riscv mode

* fix typo

* add riscv for cstool useage

* add TableGen patch for riscv asmwriter

* clean ctags file

* remove black comment line

* fix fuzz related something

* fix missing RISCV string of fuzz

* update readme, etc..

* add riscv *.s.cs file

* add riscv *.s.cs file & clear ctags

* clear useless array declarations at capstone_test

* update to 5e4069f

* update readme change name more formal

* change position of riscv after bpf and modify copyright more uniform

* clear useless ctags file

* change blank with tab in riscv.h

* add riscv python bindings

* add riscv in __init__.py

* fix riscv define value for python binding

* fix test_riscv.py typo

* add missing riscvc in __init__.py of python bindings

* fix alias-insn printer bug, remove useless newline

* change inst print delimter from tab to bankspace for travis

* add riscv tablegen patch

* fix inst output more consistency

* add TableGen patch which fix inst output formal

* crack the effective address output for detail and change register print function

* fix not detail crash bug

* change item declaration position at cs_riscv

* update riscv.py

* change function name more meaningfull

* update python binding makefile

* fix register enum sequence according to riscvgenreginfo.inc

* test function name

* add enum s0/fp in riscv.h & update riscv_const.py

* add register name enum
2019-03-09 08:41:12 +08:00
Nguyen Anh Quynh
0f4300cf11 arm: cleanup ARMGenInstrInfo.inc 2019-03-07 18:13:39 +08:00
Nguyen Anh Quynh
165a964bb5 x86: operand size of BNDxxx is 16 2019-03-07 09:09:35 +08:00
Catena cyber
c5180bffd3 Fixes uninitialized memory for X86 BND instructions (#1415) 2019-03-07 09:06:45 +08:00
Catena cyber
2e13b39af5 Avoids type confusion in cpu12 for M680X (#1417) 2019-03-05 10:19:42 +08:00
Nguyen Anh Quynh
8c7cbaf415 x86: operand access for BND instructions 2019-03-04 16:12:56 +08:00
Nguyen Anh Quynh
f2233b7f44 x86: new files X86GenRegisterName.inc & X86GenRegisterName1.inc 2019-03-04 00:56:07 +08:00
Travis Finkenauer
31d0de4552 [M68K] store correct register value in op.reg_pair (#1411)
* m68k: store correct m68k_reg value in op.reg_pair

Originally, value - M68K_REG_D0 was stored and the print logic added
M68K_REG_D0.

* m68k: fix license typo
2019-03-02 17:40:29 +08:00
Nguyen Anh Quynh
7e1efae487 x86: remove PRINT_ALIAS_INSTR 2019-03-02 15:32:07 +08:00
Nguyen Anh Quynh
cb2b1bda53 x86: add BND registers to regsize_map_32 & regsize_map_64 2019-03-02 15:16:48 +08:00
Nguyen Anh Quynh
3dd39b0bc5 x86: add BND registers. this fixes OSS-fuzz issue 13467 2019-03-02 14:58:29 +08:00
Daniel Collin
9f53e3b0d4 Made instruction table static (#1408) 2019-03-02 10:53:30 +08:00
z
6eaf37cf87 fix SystemZRegDesc&SystemZMCRegisterClasses number of SystemZ InitMCRegisterInfo (#1405) 2019-03-01 09:55:11 +08:00
Nguyen Anh Quynh
b7ed33a1a0 Merge branch 'next' of github.com:aquynh/capstone into next 2019-03-01 01:12:50 +08:00
Nguyen Anh Quynh
2dc77357e1 x86: update ISA & mapping tables 2019-03-01 01:05:52 +08:00
Sebastian Macke
6ba9f001b9 MOS65XX: Fix instruction length for indirect addressing modes (#1402)
Signed-off-by: Sebastian Macke <sebastian@macke.de>
2019-02-28 07:39:59 +08:00
Nguyen Anh Quynh
357ef8e535 x86: X86_insn_name checks array boundary with ARR_SIZE 2019-02-27 00:19:43 +08:00
Nguyen Anh Quynh
49d46e6a52 x86: optimize X86MappingInsnName.inc to have only instruction names 2019-02-26 23:47:05 +08:00
Nguyen Anh Quynh
9836779db9 x64: fix binary searching functions in arch/X86/X86Mapping.c 2019-02-26 22:59:52 +08:00
Nguyen Anh Quynh
1e82cc5b36 x86: fix issue #1304 2019-02-26 22:16:39 +08:00
Nguyen Anh Quynh
c829a8bfd4 x86: fix is64Bit(), so it access insns array after ID lookup 2019-02-26 16:31:02 +08:00
Nguyen Anh Quynh
3dcdcfa713 sync with LLVM 7.0.1. X86 is first 2019-02-26 15:19:51 +08:00
Nguyen Anh Quynh
17f252ea96 x86: ENDBR64 & ENDBR32 are unavailable in REDUCE mode 2019-02-23 00:02:09 +08:00
Nguyen Anh Quynh
b227825267 x86: fix X86_BEXTRI64ri in X86MappingInsnOp_reduce.inc 2019-02-22 23:58:33 +08:00
Nguyen Anh Quynh
260bc7e44f trimming MCInstrDesc (ARM) 2019-02-21 23:30:38 +08:00
Nguyen Anh Quynh
de420ec49a trimming MCRegisterClass 2019-02-21 22:33:15 +08:00
Nguyen Anh Quynh
7131b7a8ad Revert "x86: trimming MCRegisterClass usage"
This reverts commit 1d71b36348.
2019-02-21 21:11:56 +08:00
Nguyen Anh Quynh
8b1a140db2 x86: trimming MCRegisterClass usage 2019-02-21 21:08:00 +08:00
Nguyen Anh Quynh
e0b9ca7329 Revert "trimming MCRegisterClass usage"
This reverts commit 86743f83cd.
2019-02-21 21:06:01 +08:00
Nguyen Anh Quynh
9426405822 trimming MCRegisterClass usage 2019-02-21 20:55:25 +08:00
Nguyen Anh Quynh
38e9716275 wasm: remove unused variable 2019-02-21 20:52:59 +08:00
Nguyen Anh Quynh
f59dac2237 Merge branch 'next' of github.com:aquynh/capstone into next 2019-02-21 15:33:54 +08:00
Nguyen Anh Quynh
85cac968ef X86: X86_insn_reg_att uses a wrong mapping array of Intel syntax 2019-02-21 15:33:14 +08:00
Catena cyber
e5fa5f8735 Avoids leak in wasm details (#1372)
* Avoids leak in wasm details

Extending cs_detail in capstone.h

* Safety checks before allocating memory for brtable in WASM

* Revert "Avoids leak in wasm details"

This reverts commit 03f822b34a03f23554aaffb2951b62c62645e5e5.

* Refactoring brtable for WASM

* Fix undefined shift in WASM get_varuint64
2019-02-20 23:38:11 +08:00
david942j
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
Nguyen Anh Quynh
fd433d897a x86: 8bit Imm operand has size = 1. this fixes issue #1389 2019-02-18 17:31:03 +08:00
Catena cyber
254c58b47a Fixes more undefined left shift of negative values (#1384) 2019-02-16 10:33:21 +08:00
Catena cyber
b43db80f9a Avoids overflow in getRegisterName for TMS320C64x (#1375)
* Avoids overflow in getRegisterName for TMS320C64x

* Revert "Avoids overflow in getRegisterName for TMS320C64x"

This reverts commit 18acee60cd.

* Checks register in DecodeMemOperandSc
2019-02-16 10:32:15 +08:00
Catena cyber
2426038f31 Multiply signed integer instead of left shift (#1382) 2019-02-15 22:35:04 +08:00
Nguyen Anh Quynh
b57ddf8bc5 merge master to next branch 2019-02-15 10:51:04 +08:00
Catena cyber
06f042c515 Fix undefined shift in WASM disassembler (#1380) 2019-02-15 08:18:03 +08:00
Nguyen Anh Quynh
f38aec3d72 arm64: fix CS_OPT_UNSIGNED option on memory operand offset 2019-02-13 22:12:00 +08:00
Nguyen Anh Quynh
b8ea017fcd x86: print imm with proper size for CS_OPT_UNSIGNED - ATT syntax 2019-02-13 22:01:39 +08:00
Nguyen Anh Quynh
b22426d8ac x86: print imm with proper size for CS_OPT_UNSIGNED 2019-02-13 21:48:38 +08:00
Nguyen Anh Quynh
7228b4a3a6 x86: ATT syntax print unsigned imm with 0x prefix 2019-02-13 01:26:56 +08:00
Nguyen Anh Quynh
988ad09d77 x86: ATT syntax print unsigned imm with 0x prefix 2019-02-13 01:26:04 +08:00
Nguyen Anh Quynh
8a7ebc3bd6 x86: do not print prefix 0 for memory operand for ATT syntax 2019-02-13 01:23:50 +08:00
Nguyen Anh Quynh
974b3b3cf1 x86: do not print prefix 0 for memory operand for ATT syntax 2019-02-13 01:04:57 +08:00
Nguyen Anh Quynh
432e507ce2 arm: lowercase for APSR_nzcv 2019-02-13 00:43:42 +08:00
Nguyen Anh Quynh
bc36e5fdfe arm: lowercase for APSR_nzcv 2019-02-13 00:43:22 +08:00
Nguyen Anh Quynh
bdb711390c arm64: support CS_OPT_UNSIGNED 2019-02-12 23:28:06 +08:00
Nguyen Anh Quynh
4ee7d45078 arm64: support CS_OPT_UNSIGNED 2019-02-12 23:27:29 +08:00
Nguyen Anh Quynh
ad38598a89 x86: support CS_OPT_UNSIGNED for ATT syntax 2019-02-12 23:15:39 +08:00
Nguyen Anh Quynh
00dc2e2e58 x86: support CS_OPT_UNSIGNED for ATT syntax 2019-02-12 23:14:30 +08:00
Nguyen Anh Quynh
6df9ab10ae TMS320C64x: remove unused variable 2019-02-10 18:04:56 +08:00
Nguyen Anh Quynh
cf05010186 TMS320C64x: remove unused variable 2019-02-10 18:03:30 +08:00
Catena cyber
2d2f3ae922 TMS320C64x instruction names (#1373)
* TMS320C64x instruction names

* Fix undefined shift in TMS320C64xDisassembler.c

* Adding spaces

* remove TMS320C64X_INS_ENDING naming
2019-02-07 22:37:46 +08:00
Catena cyber
bd110ef655 TMS320C64x instruction names (#1373)
* TMS320C64x instruction names

* Fix undefined shift in TMS320C64xDisassembler.c

* Adding spaces

* remove TMS320C64X_INS_ENDING naming
2019-02-07 22:36:07 +08:00
david942j
a512e2668f Fixed m68k has wrong type of read_imm_64 (#1369) 2019-02-06 00:07:54 +08:00
david942j
3ee4d90af0 Fixed TMS320C64x failed to print instructions (#1367) 2019-02-06 00:07:46 +08:00
david942j
18b33cbf53 Fixed m68k has wrong type of read_imm_64 (#1369) 2019-02-06 00:05:21 +08:00
david942j
a560a3a448 Fixed TMS320C64x failed to print instructions (#1367) 2019-02-05 23:34:33 +08:00
Spike
54cbc34349 fix wasm shift bug (#1362)
* fix bug in shift
2019-02-03 14:24:05 +08:00
Nguyen Anh Quynh
f9bd8785eb wasm: return CS_ERR_OPTION on unsupported option of cs_option() 2019-02-02 23:25:34 +08:00
Spike
55f242d498 Add webassembly arch (#1359)
* add wasm arch

* fix bug

* delete todo & add wasm into readme
2019-02-01 23:03:47 +08:00
Nguyen Anh Quynh
be24095038 arm: update writeback for STR_POST_REG (issue #1296) 2019-01-28 16:35:18 +08:00
Nguyen Anh Quynh
147eab3ff9 arm: update writeback for STR_POST_REG (issue #1296) 2019-01-28 16:34:44 +08:00
Nguyen Anh Quynh
dbab8d6494 arm: fix issue #746 for arm mode. reported by @HarDToBelieve 2019-01-27 22:37:43 +08:00
Nguyen Anh Quynh
66dd1cd0e3 arm: fix issue #746 for arm mode. reported by @HarDToBelieve 2019-01-27 22:37:13 +08:00
radare
f03310afe8 Add default case in MOS65XX instruction length helper (#1333) 2019-01-22 15:37:35 +08:00
Nguyen Anh Quynh
938b072655 MOS65XX: fix missing prototype for ‘MOS65XX_global_init' 2019-01-22 15:35:48 +08:00
Nguyen Anh Quynh
9afe61c8c0 MOS65XX: fix missing prototype for ‘MOS65XX_global_init' 2019-01-22 15:23:22 +08:00
JNA
5294fa9fb6 fix cmovcc eflags (#1349) 2019-01-22 14:13:05 +08:00
JNA
ad06af9643 fix cmovcc eflags (#1349) 2019-01-22 14:12:37 +08:00
JNA
43c8983096 fix cmovcc eflags (#1349) 2019-01-22 13:11:34 +07:00
Marius Melzer
7450461a5f Fix missing-prototypes warnings (#1348) 2019-01-22 09:01:13 +08:00
Nguyen Anh Quynh
a24eba1e0f X86: turn some print functions to static. see #1342 2019-01-22 09:01:13 +08:00
Marius Melzer
7d20c40060 Fix missing-prototypes warnings (#1348) 2019-01-22 08:43:02 +08:00
Nguyen Anh Quynh
48b08869c0 X86: turn some print functions to static. see #1342 2019-01-22 08:43:02 +08:00
Marius Melzer
c6612a3059 Fix missing-prototypes warnings (#1348) 2019-01-22 07:39:44 +07:00
Nguyen Anh Quynh
dddabb1bde X86: turn some print functions to static. see #1342 2019-01-21 20:21:18 +08:00
Erik Hemming
1200ad4486 Fix a couple of corner-cases with rarely used m68k instructions. (#1344)
* Bump the "cs_insn.bytes[]" size to 24 (from 16) to support M680x0 instructions with full EA (maximum 11 words)
Added a test for this in test_m68k.s

* Bump the "cs_detail.regs_read[]" size to 16 (from 12) to support M680x0 instructions with full REG_BITS (Dn+An = 16)

* m68k: use immediate mode syntax (#$0) for movem/fmovem instructions with empty register list

* update bindings to match changes to cs_insn and cs_detail
2019-01-21 17:42:28 +08:00
Erik Hemming
44ce36d1ad Fix a couple of corner-cases with rarely used m68k instructions. (#1344)
* Bump the "cs_insn.bytes[]" size to 24 (from 16) to support M680x0 instructions with full EA (maximum 11 words)
Added a test for this in test_m68k.s

* Bump the "cs_detail.regs_read[]" size to 16 (from 12) to support M680x0 instructions with full REG_BITS (Dn+An = 16)

* m68k: use immediate mode syntax (#$0) for movem/fmovem instructions with empty register list

* update bindings to match changes to cs_insn and cs_detail
2019-01-21 17:42:01 +08:00
Erik Hemming
652d5754e4 Fix a couple of corner-cases with rarely used m68k instructions. (#1344)
* Bump the "cs_insn.bytes[]" size to 24 (from 16) to support M680x0 instructions with full EA (maximum 11 words)
Added a test for this in test_m68k.s

* Bump the "cs_detail.regs_read[]" size to 16 (from 12) to support M680x0 instructions with full REG_BITS (Dn+An = 16)

* m68k: use immediate mode syntax (#$0) for movem/fmovem instructions with empty register list

* update bindings to match changes to cs_insn and cs_detail
2019-01-21 16:55:05 +08:00
Nguyen Anh Quynh
8a6c520e8f Merge branch 'master' into next 2019-01-04 17:24:16 +08:00
Nguyen Anh Quynh
3d8bba0a58 Merge branch 'master' into v4.1 2019-01-04 17:23:50 +08:00
Wolfgang Schwotzer
59d7387d37 M680X: Fix clang-analyzer issue #1329. (#1334) 2019-01-03 07:48:55 +08:00
radare
7de621bbf2 Add default case in MOS65XX instruction length helper (#1333) 2019-01-03 07:48:18 +08:00
Nguyen Anh Quynh
d4ce009086 Merge branch 'master' into next 2019-01-02 10:01:28 +08:00
Nguyen Anh Quynh
2e78e0c1b9 Merge branch 'master' into v4.1 2019-01-02 10:01:03 +08:00
Disconnect3d
6e29dfa2c0 Fix arm thb instruction shift value (#1330)
* Fixes #1317 - arm thb operand.shift.value

For a more detailed description, see issue #1317.

Release 4.0.0 introduced a new field for ARM operands:
`operand.mem.lshift`. This field was supposed to be a bug fix for #246.
The #246 issue has been fixed in the meantime and the proper shift value
was stored in `operand.shift.value`.

The 4.0.0 changes created a regression in which `operand.shift.value`
was not set for a `tbh [r0, r1, lsl #1]` instruction on ARM and the
value was set in a `operand.mem.lshift` field instead.

As the regression broke some of users codebase (e.g. in
[manticore](https://github.com/trailofbits/manticore/pull/1312) project), we fix it by setting
`operand.shift.value` back again.

As a result, the shift value is set in two fields: `operand.shift.value`
and `operand.mem.lshift`. As the `operand.shift` also stores a `.type`
field, we might want to deprecate `operand.mem.lshift` in the future.

* Add changelog stub
2019-01-02 09:51:22 +08:00
Nguyen Anh Quynh
23ff78bf05 Merge branch 'master' into next 2018-12-27 09:41:29 +08:00
Nguyen Anh Quynh
807dd33c0b Merge branch 'master' into v4.1 2018-12-27 09:41:01 +08:00
Nguyen Anh Quynh
454160598a arm: remove group ARM_REG_PC for thumb BX (#1323, 1126) 2018-12-27 09:40:19 +08:00
Nguyen Anh Quynh
44b2c29ab7 Merge branch 'master' into next 2018-12-20 02:58:23 +08:00
Nguyen Anh Quynh
09822dd129 x86: fix endbr32 & endbr64 in #1129 2018-12-20 02:54:44 +08:00
Nguyen Anh Quynh
a15bb088df Merge branch 'master' into next 2018-12-19 07:49:32 +07:00
Ammar
4e1b8c49f9 x86: correct access mode for cmp instruction (#1309)
cmp instruction does not modify its operands. Currently, cmp
variants that accept a memory operand have CS_AC_WRITE access mode
set. This commit removes CS_AC_WRITE mode from cmp variants that
have it.
2018-12-18 23:22:30 +08:00
Nguyen Anh Quynh
53b3e3f7c5 MOS65XX: lowercase for MOS65XX_AM_ACC 2018-12-18 22:46:23 +08:00
Nguyen Anh Quynh
ca984c3eb4 Merge branch 'master' into next 2018-12-18 22:44:57 +08:00
Nguyen Anh Quynh
8d4ba8d335 M680X: lowercase for registers & FCB instruction 2018-12-18 22:44:12 +08:00
Nguyen Anh Quynh
ce27eea732 TMS320C64x: lowercase for instruction mnemonics, registers & group names 2018-12-18 22:40:31 +08:00
Nguyen Anh Quynh
da6777f701 M680X: lowercase for instruction mnemonics & group names 2018-12-18 22:33:00 +08:00
Nguyen Anh Quynh
e4c8ea3e75 MOS65XX: lowercase for instruction mnemonic 2018-12-18 22:28:33 +08:00
mephi42
7ac73141c8 Update SystemZ to LLVM commit 5ad902a6 (#1306) 2018-12-16 21:48:51 +08:00
Nguyen Anh Quynh
7aa0fce4d8 mos65xx: fix warnings reported by CI 2018-12-16 20:47:52 +08:00
Nguyen Anh Quynh
96d1b894fa mos65xx: solve conflicts 2018-12-16 20:09:28 +08:00
Nguyen Anh Quynh
81baa7dccf fix conflicts 2018-12-08 09:52:08 +07:00
Sebastian Macke
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
keenk
c5140afc7b Fix a few registry access mode mappings (#1295) 2018-11-26 14:05:29 +07:00
Nguyen Anh Quynh
c63838c40c PPC: print 16bit imm as unsigned 2018-11-25 21:12:05 +07:00
Dimitri Bohlender
27a202f858 Typo in register's name (#1282)
Fixed Minor typo, i.e. the friendly string representation of X86_REG_ST0 was "st(0"
2018-11-02 07:43:54 +08:00
Nguyen Anh Quynh
a7faa5b383 x86: fix instruction suffix of MOV to segment register for ATT syntax. issue #1240 2018-10-26 14:08:18 +08:00
Nguyen Anh Quynh
d1927ee0a4 x86: fix operand access of FSTP (#1255) 2018-10-25 23:22:48 +08:00
Nguyen Anh Quynh
c3dfecb946 x86: fix operand access of SETE & SETNE (#1262) 2018-10-10 14:07:07 +08:00
Nguyen Anh Quynh
6360b82a3f x86: fix operand access of fistp & fstp, in #1255 2018-10-02 12:22:13 +02:00
Nguyen Anh Quynh
0492f93c3d x86: fix operand access of CMP in #1253 2018-10-02 12:18:29 +02:00
keenk
9d140beb47 Add files via upload (#1256)
Correct register access flag for the movdqa instruction
2018-10-02 17:45:11 +08:00
Tim Brooks
5cac05846e Correct use of strncpy function (#1247)
The last argument should be the max size of the destination, not the
source buffer. A null byte is added to the end of the destination buffer
since strncpy only adds one if it does not truncate the source.
This fixes the -Wstringop-overflow warning on GCC.
2018-09-15 13:47:52 +08:00
Riccardo Schirone
5212dc571a arch/X86: fix strncpy usage (#1243)
The `n` parameter should be the size of the destination buffer, not the
source one.
2018-09-04 08:51:02 +07:00
Riccardo Schirone
702ac842e1 WIP: arch/TMS320C64x: fix underflow (#1220)
* arch/TMS320C64x: fix underflow

(patch coming from radare2)

* arch/TMS320C64x: fix spaces between if/for/while and parenthesis

* arch/TMS320C64x: switch back to ==
2018-07-30 21:48:26 +08:00
Riccardo Schirone
71b32ce5e7 WIP: arch/TMS320C64x: fix underflow (#1220)
* arch/TMS320C64x: fix underflow

(patch coming from radare2)

* arch/TMS320C64x: fix spaces between if/for/while and parenthesis

* arch/TMS320C64x: switch back to ==
2018-07-30 15:17:43 +08:00
Nguyen Anh Quynh
757310df51 evm: fix EVMMappingInsn.inc 2018-07-29 02:38:38 +08:00
Nguyen Anh Quynh
e0bce87ef1 evm: fix EVMMappingInsn.inc 2018-07-29 02:38:10 +08:00
Riccardo Schirone
c316ef189d arch/M68k: do not return reg_name if beyond limits (#1219)
* arch/M68k: do not return reg_name if beyond limits

(patch coming from radare2)

* arch: checks index when returning reg names
2018-07-24 16:25:47 +08:00
Nguyen Anh Quynh
af286d4914 sparc: fix issue #1221 on double printing imm operand 2018-07-24 14:53:00 +08:00
Riccardo Schirone
b512f388cf arch/M68k: do not return reg_name if beyond limits (#1219)
* arch/M68k: do not return reg_name if beyond limits

(patch coming from radare2)

* arch: checks index when returning reg names
2018-07-24 13:40:02 +08:00
Francesco Tamagni
f6e0fa42f2 Fix testAndBranch sign extend to 64 bit (#1213) 2018-07-20 14:50:41 +08:00
Francesco Tamagni
baa10210fc Fix testAndBranch sign extend to 64 bit (#1213) 2018-07-20 14:50:01 +08:00
Nguyen Anh Quynh
76c1c3c4e9 merge next to master 2018-07-20 12:36:50 +08:00
Nguyen Anh Quynh
9783ea8585 mips: compilable for MSVC 2013 2018-07-18 23:47:07 +08:00
Nguyen Anh Quynh
d64cfab1d8 mips: compilable for MSVC 2013 2018-07-18 23:46:36 +08:00
clslgrnc
91601ac1fd Init cs_detail (#1205)
* Update init of cs_detail for AArch64

as @aquynh requested in #1125

* Update init of cs_detail for ARM

as @aquynh requested in #1125

* Update init of cs_detail for EVM

as @aquynh requested in #1125

* Update init of cs_detail for M680X

as @aquynh requested in #1125

* Update init of cs_detail for M68K

as @aquynh requested in #1125

* Update init of cs_detail for Mips

as @aquynh requested in #1125

* Update init of cs_detail for PowerPC

as @aquynh requested in #1125

* Update init of cs_detail for Sparc

as @aquynh requested in #1125

* Update init of cs_detail for SystemZ

as @aquynh requested in #1125

* Update init of cs_detail for TMS320C64x

as @aquynh requested in #1125

* Update init of cs_detail for XCore

as @aquynh requested in #1125

* Comment on init of cs_detail

* wrap long lines
2018-07-12 11:01:34 +07:00
Nguyen Anh Quynh
8171df5568 x86: fix imm operand of RETF. see #1204 2018-07-11 23:20:00 +08:00
Martin
ec81ee223b readDisplacement fix (#1200) 2018-07-11 23:19:45 +08:00
Martin
bd89989f5d readDisplacement fix (#1200) 2018-07-11 22:18:38 +07:00
Nguyen Anh Quynh
7e93de0714 x86: fix imm operand of RETF. see #1204 2018-07-11 23:12:18 +08:00
Nguyen Anh Quynh
940cbdcfea Merge branch 'next' of github.com:aquynh/capstone into next 2018-07-05 11:34:32 +08:00
Nguyen Anh Quynh
68d4e771eb evm: default case for switch 2018-07-05 11:33:39 +08:00
Nguyen Anh Quynh
5c173ca0cd evm: cleanup group_name_maps[] 2018-07-05 11:32:42 +08:00
Nguyen Anh Quynh
ec57c1b4ec evm: fix bug introduced in some recent fixes 2018-07-05 11:32:19 +08:00
Nguyen Anh Quynh
76a86e5354 evm: cleanup 2018-07-05 11:32:05 +08:00
Nguyen Anh Quynh
6c4ece4472 evm: simplify EVM_get_insn_id() 2018-07-05 11:31:53 +08:00
Nguyen Anh Quynh
3a3cff2e91 evm: correct comments on evm_insn_find() 2018-07-05 11:31:39 +08:00
Nguyen Anh Quynh
dfb75a21a0 evm: fix header guard in EVMModule.c 2018-07-05 01:16:24 +08:00
Nguyen Anh Quynh
97f34c87c7 x86: X86_immediate_size() returns uint8 2018-07-04 23:02:22 +08:00