Commit Graph

186 Commits

Author SHA1 Message Date
Nguyen Anh Quynh 6bb255bb12 mips: remove mode CS_MODE_MIPSGP64 2015-03-07 09:47:11 +08:00
Nguyen Anh Quynh ad42f16b14 mips: remove the confusing mode CS_MODE_MIPSGP64 2015-03-07 00:48:06 +08:00
Nguyen Anh Quynh bfcaba5851 2015 2015-03-04 17:45:23 +08:00
Nguyen Anh Quynh 603a32e968 systemz: upgrade core 2015-03-04 13:58:07 +08:00
Nguyen Anh Quynh 2c55b81f06 mips: fix conflict when merging with 'next' branch 2015-03-04 11:29:49 +08:00
Félix Cloutier 3973d8b11e Silencing Clang warning bys casting values
Warnings were: "Implicit conversion loses integer precision: 'size_t' to 'cs_mode'/'cs_opt_value'"
2015-03-04 11:26:27 +08:00
Nguyen Anh Quynh 7334a88041 Merge branch 'master' into v3 2015-03-03 11:43:36 +08:00
Félix Cloutier c141af9052 Silencing Clang warning bys casting values
Warnings were: "Implicit conversion loses integer precision: 'size_t' to 'cs_mode'/'cs_opt_value'"
2015-03-02 22:11:55 -05:00
Nguyen Anh Quynh c87ccd1b89 mips: fix bugs in the last update 2015-03-02 17:31:44 +08:00
Nguyen Anh Quynh bf88118974 Merge branch 'next' into mips 2015-03-02 15:13:40 +08:00
Nguyen Anh Quynh cfe18ad7ca mips: update core 2015-03-02 15:12:42 +08:00
Nguyen Anh Quynh fbfa06deb7 mips: sanity check for input code length of Mips64 2015-02-27 17:31:24 +08:00
pancake 9c10ace558 Make pkg-config and source consistent with installation 2015-02-24 05:03:04 +01:00
Nguyen Anh Quynh 22278ec937 mips & xcore: some safety guards to make sure printOperand() do not overflow Operands[] for some unknown reasons 2014-11-17 22:59:24 +08:00
Nguyen Anh Quynh 0d97a3b3aa mips: CS_MODE_MIPS32R6 is an independent mode, and should not combine with CS_MODE_32 2014-11-13 11:12:52 +08:00
Marcin Bukat 921a46c38f mips: Fix j/jal target address calculation 2014-11-12 11:06:34 +01:00
Nguyen Anh Quynh c36e675213 mips: refine getFeatureBits() to make it more clear what Mips features are supported 2014-11-12 15:57:52 +08:00
Nguyen Anh Quynh 05bd294920 mips: Mips64 does not go with Mips32R6. this fixes some 64bit instructions 2014-11-10 15:20:49 +08:00
Nguyen Anh Quynh 248519efea mips: properly handle Mips32R6 mode. bug reported by Jay Oster 2014-11-09 14:07:07 +08:00
Nguyen Anh Quynh c2ea812ea7 fix cs_group_name() after the change on generic group ids 2014-10-31 15:36:19 +08:00
Nguyen Anh Quynh 1084f3afda mips: properly support modes MIPS32R6 & CS_MODE_MIPSGP64 2014-10-29 22:20:38 +08:00
Jay Oster 79e253c516 Remove CS_MODE_N64
- This mode is for the so-called MIPS "N64" ABI; it has nothing to do with the Nintendo 64 game platform.
- N64, O64, et al. are just different ABIs for the 64-bit MIPS architecture, so we replace CS_MODE_N64 with the existing CS_MODE_64
2014-10-12 16:03:12 -07:00
Nguyen Anh Quynh c64d6292fc mips: remove MIPS_REG_PC register. reviewed by Jay Oster 2014-10-10 21:11:50 +08:00
Nguyen Anh Quynh df92a7f346 mips: BC0F is relative branch instruction. bug reported by Pancake 2014-10-01 21:25:18 +08:00
Nguyen Anh Quynh c96f1b06b2 x86: fix Out-of-bounds read error in is16BitEquivalent(). issue reported by Coverity 2014-10-01 14:35:29 +08:00
Nguyen Anh Quynh 9bf1b87a66 mips: fix out-of-bounds read error in Mips_reg_name(). issue reported by Coverity 2014-10-01 14:32:15 +08:00
Nguyen Anh Quynh 9d54544288 mips: verify if RegDecoder can get NULL value. issue reported by Coverity 2014-10-01 14:16:07 +08:00
Nguyen Anh Quynh d7e42b7d36 rename all the constants marking ending from _MAX to _ENDING. this also updates Java/Python/Ocaml bindings accordingly 2014-09-29 17:15:25 +08:00
Nguyen Anh Quynh 54f8cef449 mips: add JR.HB & JALR.HB instructions. also update Ocaml/Python/Java bindings 2014-09-24 22:53:54 +08:00
Nguyen Anh Quynh 7ac7d4e245 mips: on BEQZL, printAlias() should return instruction string. also cleanup some redundant code 2014-09-24 22:29:03 +08:00
Nguyen Anh Quynh 240e1c75be mips: print absolute target address for relative branch instructions: BEQL, BGEZALL, BGEZL, BGTZL, BLEZL, BLTZALL, BLTZL, BNEL, BNEZL, BEQZL, BC1F, BC1FL, BC1TL 2014-09-24 18:16:23 +08:00
Nguyen Anh Quynh 5691dd4637 mips: fixed & added new instructions. also updated Ocaml/Python/Java bindings 2014-09-24 18:03:47 +08:00
Yegor Derevenets ced9d24e35 Workaround missing <inttypes.h> on MSVC 2010 2014-09-21 17:27:11 +02:00
Nguyen Anh Quynh 36567558b7 mips: cleanup 2014-09-15 15:25:19 +08:00
Nguyen Anh Quynh 04d9f8ee17 arm: update core with a lot more details provided in detail mode now. update Python & Java bindings to reflect the core's changes 2014-09-01 23:27:24 +08:00
Nguyen Anh Quynh e0eb06b7ab mips: correct mapping instruction string to instruction ID for alias instructions BAL & BEQZ. bug reported by Pancake 2014-08-29 22:40:38 +08:00
Nguyen Anh Quynh eda85064ee mips: add BC1T & BLTZAL to the list of relative branch instructions. thanks @hlide for the input. 2014-08-29 09:58:07 +08:00
Nguyen Anh Quynh d1a9090eab mips: relative branch address calculated current IP added to the relative offset. thanks Pancake, Jay Oster, hlide & jvoisin for helping 2014-08-28 11:36:57 +08:00
Nguyen Anh Quynh 0c07cc9b06 zero-out instruction details, mnemonic & op_str so cs_insn doesnt have garbage in Diet mode 2014-08-27 22:31:54 +08:00
Nguyen Anh Quynh 4b6b15fcb1 fix more MSVC warnings 2014-08-26 15:57:04 +08:00
Nguyen Anh Quynh 14b684e07d last commit missed a check 2014-08-25 23:45:52 +08:00
Nguyen Anh Quynh b1e87e3e31 arm, mips, ppc, spac, x86: printAliasInstr() should handle \t (besides space) as separate char between mnemonic & operands 2014-08-25 23:27:33 +08:00
Nguyen Anh Quynh 46a74e53b7 arm64: update core. this added a lot more details to cs_arm64_op struct 2014-08-25 16:47:12 +08:00
Nguyen Anh Quynh 2124b8a9c9 mips: indentations 2014-08-15 16:37:03 +08:00
Nguyen Anh Quynh 0f0eb9851a mips: update core. this added bunch of new instructions & groups. updated Python & Java bindings accordingly 2014-08-14 18:26:39 +08:00
Nguyen Anh Quynh 650f96ce43 add new API cs_group_name() to return group name in string, given the group id 2014-07-08 08:59:27 +08:00
Nguyen Anh Quynh f08b83ddba mips: use CreateImm0() & CreateReg0() to create MCOperand* to avoid using malloc/free 2014-06-16 12:04:25 +08:00
Nguyen Anh Quynh 0c764d4a70 mips: use SStream_concat0() instead of SStream_concat() for simple string processing whenever possible 2014-06-16 11:53:08 +08:00
Nguyen Anh Quynh 69582d71ae initialize cs_insn.detail by properly zero-out right members for each arch 2014-06-09 17:50:01 +07:00
Nguyen Anh Quynh 29fd0f6405 fix all the code in other non-X86 archs after the change made by commit 5329a6ffd4 2014-06-09 08:00:18 +07:00
Nguyen Anh Quynh 5e2e660be7 fix some warnings reported by Coverity 2014-05-30 17:43:36 +08:00
Nguyen Anh Quynh 9148420b0d replace strcasecmp() with strcmp() 2014-05-28 12:57:46 +08:00
Nguyen Anh Quynh f721e3124d Disassembler -> Disassembly 2014-05-27 10:45:58 +08:00
Nguyen Anh Quynh 04f2ec6d0f cleanup redundant headers included 2014-05-27 10:39:04 +08:00
Jason Oster 984ed7e9e8 MIPS: Add HI, LO, and PC registers to MipsMapping.c
- Using MIPS_REG_HI, MIPS_REG_LO, and MIPS_REG_PC with cs_reg_name() caused out-of-bounds reads
2014-05-19 22:56:19 -07:00
Nguyen Anh Quynh c5cad6cab3 avoid using stdbool.h to support compilers without C99 support 2014-05-15 21:40:24 +08:00
Nguyen Anh Quynh 1d2e69b869 msvc: remove headers/ directory & replace it with include/platform.h 2014-05-15 13:56:54 +08:00
Nguyen Anh Quynh b2a88df20f MSVC added some code picked up by MingW, so cross-win32/74 compile is broken. this fixes the issue 2014-05-14 14:28:40 +08:00
Nguyen Anh Quynh 8598a219f3 enable arch code from source with CAPSTONE_HAS_* for MSVC to pick up 2014-05-14 11:26:41 +08:00
Nguyen Anh Quynh 805fed5162 make checkDecoderPredicate() handle boolean casting for MSVC 2014-05-12 21:29:04 +08:00
Nguyen Anh Quynh 043702e9ef more fixes for warnings reported by MSVC 2014-05-12 16:17:00 +08:00
Nguyen Anh Quynh bb0744df5d do not initialize some local vars unnecessarily. this problem was introduced when we fixed C89 issues for MSVC 2014-05-12 13:41:49 +08:00
Axel 0vercl0k Souchet 35c8467275 still want that to compile on other systems 2014-05-09 20:51:02 +01:00
Nguyen Anh Quynh 42706a39e2 indentation with tab 2014-05-09 07:33:35 +08:00
Axel 0vercl0k Souchet 779d4c75d9 first changes to get a successfully compiled version of capstone on VS2012 2014-05-08 23:44:49 +01:00
Nguyen Anh Quynh 958927eb56 clean up after the last removal of SubtargetFeature.h 2014-05-08 22:59:28 +08:00
Nguyen Anh Quynh a5ffdc3a80 x86: properly handle LOCK/REP in the core, so remove buch of hacks 2014-05-07 08:25:24 +08:00
Nguyen Anh Quynh 2cff6f61fc x86: handle instructions with LOCK/REP/REPNE prefix after other prefixes. bear with this until we have a better approach 2014-04-28 11:19:44 +08:00
Nguyen Anh Quynh 017df604dc arm64, mips, x86: print -9, not -0x9 2014-03-20 15:38:51 +08:00
Nguyen Anh Quynh f6c7cbc972 core: fix some warnings 2014-03-12 12:50:54 +08:00
Nguyen Anh Quynh 1c68ab9293 cleaning up unused code 2014-03-06 12:41:28 +08:00
Nguyen Anh Quynh fc83a439e5 add diet compile option (CAPSTONE_DIET option in config.mk). This reduces binary size by around 40% 2014-02-22 23:26:27 +08:00
Nguyen Anh Quynh bc0b3b92fd mips: update core 2014-02-19 15:13:20 +08:00
Nguyen Anh Quynh 74c41ebb1d mips: simplify handling alias insn 2014-02-18 17:57:06 +08:00
Nguyen Anh Quynh a82a0890a6 more more fixes on C coding style 2014-01-23 23:42:40 +08:00
Alex Ionescu b8a57fe285 Additional MSVC fixes, including to fixed tables (temporary so Quynh can see what to do). 2014-01-22 18:12:01 -08:00
Alex Ionescu 46018db884 Initial set of changes to support building with MSVC 2013. Right now there's a bunch fo assumptions in the .vcxproj file and some things are not as clean as they should be, but it does build a full build and works (at least the x86 side). The point of this initial checkpoint is to make sure that nothing breaks on the GCC side, that everyone is ok with the changes to the source (or if better fixes/typing can be done). 2014-01-22 09:45:00 -08:00
Nguyen Anh Quynh 53fc5c103a cs_open() should return error on invalid mode 2014-01-21 15:26:02 +08:00
Nguyen Anh Quynh 3732725342 rename mapping.c, mapping.h, module.c to have arch prefix. suggested by Alex Ionescu 2014-01-20 09:52:05 +08:00
Nguyen Anh Quynh c272e9d000 do not use constructor to enable archs, so code is more portable. suggested by Alex Ionescu 2014-01-19 12:03:22 +08:00
Nguyen Anh Quynh a9ffb440f8 replace strdup() with our cs_strdup(), which call cs_mem_malloc() internally 2014-01-15 18:27:01 +08:00
Nguyen Anh Quynh 75ef2426ea mips: update core 2014-01-14 23:08:20 +08:00
Nguyen Anh Quynh 56774a158c mips: printInstruction() is static function. add dummy third argument MRI to be consistent with other archs 2014-01-12 18:13:53 +08:00
Nguyen Anh Quynh a8eb7a5ca5 rename memory function pointer types to have cs_ prefix. also rename internal function pointers my_* to have cs_mem_ prefix - suggested by Pancake 2014-01-11 12:55:31 +08:00
danghvu 701b850af9 Fix: bug that static link does not know constructor 2014-01-09 11:14:40 +07:00
Nguyen Anh Quynh 9fac512efc no longer need to free insn_cache for each arch: simply do it from cs_close() 2014-01-07 10:56:04 +08:00
Nguyen Anh Quynh 1acfd0b883 move insn_cache into cs_struct to gurantee thread-safe 2014-01-06 10:56:59 +08:00
Nguyen Anh Quynh c7404075ff move internal memory management declarations from utils.h to cs_priv.h 2014-01-05 11:35:47 +08:00
Nguyen Anh Quynh 24bf0d9079 add new option CS_OPT_MEM for cs_option(): this enable user-defined dynamic memory management. idea proposed by Pancake 2014-01-05 11:19:04 +08:00
Nguyen Anh Quynh f1d489b949 ppc: support details information 2014-01-05 00:00:05 +08:00
Nguyen Anh Quynh b265406960 cache insns for fast lookup in mapping.c. based on the idea of Dang Hoang Vu 2014-01-03 17:08:58 +08:00
Nguyen Anh Quynh 19b0de3c8d moving static doing_mem variable into cs_struct to guarantee thread-safe when handling memory operands 2013-12-31 22:40:04 +08:00
Nguyen Anh Quynh 04ac9c3725 arm,arm64,mips,x86: rename PPC_getFeatureBits() to getFeatureBits() 2013-12-31 18:15:12 +08:00
Nguyen Anh Quynh 42c6b1acc7 initial support for PPC 2013-12-30 00:15:25 +08:00
Nguyen Anh Quynh ec4ead2c02 function pointers in arch_init[] should be able to report errors 2013-12-28 14:34:21 +08:00
Nguyen Anh Quynh 4fe224b1ed change API cs_disasm_dyn(): break cs_insn into 2 structures, and put all details into new structure cs_detail. this break API compatibility 2013-12-24 16:49:36 +08:00
Nguyen Anh Quynh f954f871e8 initialize all_arch in constructors 2013-12-22 18:49:22 +08:00
Nguyen Anh Quynh d345839bce support cs_option() for arm64 module 2013-12-22 11:10:56 +08:00
Nguyen Anh Quynh 39a42eddfb Change the way of supporting arch modularization
- Always use libapstone.so as library name, no matter which archs are compiled in.

- Add new API cs_support() to check if a particular arch is supported.

- Change cs_version(): return hexical version which encodes both major & minor version.
    the return value can be comparable.

- Bump API version to 1.1
2013-12-22 10:40:58 +08:00
Nguyen Anh Quynh 13a7d95763 add missing arch/*/module.c 2013-12-21 12:19:44 +08:00