Commit Graph

237 Commits

Author SHA1 Message Date
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
Yegor Derevenets ced9d24e35 Workaround missing <inttypes.h> on MSVC 2010 2014-09-21 17:27:11 +02:00
Nguyen Anh Quynh 7e57e79800 ppc: handle branch condition for alias instructions. this also updates Python & Java bindings 2014-09-21 13:04:50 +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 4f0d7048cd arm64: vector_index = 0 is valid. this changed invalid value of vector_index to -1 2014-08-29 15:11:23 +08:00
Nguyen Anh Quynh 0beb0d494b api: get back the old API cs_disasm() & mark cs_disasm_ex() deprecated. cs_disasm_ex() will be removed in the future 2014-08-27 22:55:29 +08:00
Mr. eXoDia 9be1f93f88 fixed warnings in MSVC x64 compilation 2014-08-26 23:51:12 +08:00
Nguyen Anh Quynh 5166236e1c python: update after the latest changes in the core on arm64 2014-08-25 17:28:34 +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 0df7e93a3c Change the prototype of the callback in SKIPDATA option. Suggested by Ben Nagy.
Original prototype:
  typedef size_t (*cs_skipdata_cb_t)(const uint8_t *code, uint64_t offset, void* user_data);

Now we add @code_size argument to reflect the size of the input buffer @code.
Also, we change the data type of @offset to size_t because this argument indicates the
distance from currently examining bytes to @code, but not the address of the byte.

  typedef size_t (*cs_skipdata_cb_t)(const uint8_t *code, size_t code_size, size_t offset, void* user_data);
2014-07-10 15:42:16 +08:00
Nguyen Anh Quynh faf368b656 Merge branch 'next' into opsize 2014-07-07 11:59:36 +08:00
Ole André Vadla Ravnås ffc8aaa38a Fix minor style inconsistency 2014-07-04 23:39:59 +02:00
Ole André Vadla Ravnås b202b914f9 Simplify universal builds by relying on the linker to do the right thing 2014-07-04 23:38:20 +02:00
Ole André Vadla Ravnås 6583f069a7 Fix universal build support for Mac and iOS 2014-07-04 23:09:19 +02:00
Nguyen Anh Quynh 9f6ed7155a x86: add @rex to cs_x86 struct. updated python & java binding for this change 2014-07-01 10:13:28 +08:00
Nguyen Anh Quynh 1a66fecdbc x86: support avx_sae & avx_rm in cs_x86 struct. this also updates Python & Java bindings following the core's change 2014-06-26 12:09:15 +08:00
Nguyen Anh Quynh 92a3d4c079 x86: add AVX's zero_opmask to cs_x86_op struct. updated Python & Java bindings for this change 2014-06-25 23:10:39 +08:00
Nguyen Anh Quynh f1ec52628e x86: provide size for X86_OP_IMM operand. thank Gabriel Quadros for some suggestions 2014-06-25 22:03:18 +08:00
Nguyen Anh Quynh 4c5eabc32b x86: support SSE_CC & AVX_CC in cs_x86 struct. this also updates Python & Java bindings 2014-06-24 23:50:41 +08:00
Nguyen Anh Quynh 0d716450fc x86: add avx_bcast to cs_x86_op to support AVX512 instructions. this also updates Python & Java binding 2014-06-24 22:51:56 +08:00
Nguyen Anh Quynh bb6440c5ef x86: extend cs_x86.opcode to 4 bytes to contain EVEX opcode. this also updates Python binding following this interface change 2014-06-24 21:46:54 +08:00
Nguyen Anh Quynh 14ba46bfab x86: add segment to x86_op_mem struct. this fixes a bug in generating detail for instructions with segment override. bug reported by Sean Heelan. 2014-06-24 14:32:01 +08:00
Nguyen Anh Quynh d948dd42b8 tests/test_x86: prefix[] size is now 4, not 5 2014-06-20 13:55:24 +08:00
Nguyen Anh Quynh 1085073f8f x86: remove disp_size, imm_size, op_size. add size to each operand. thanks Gabriel Quadros for some nice ideas 2014-06-18 12:16:24 +08:00
Nguyen Anh Quynh 8c0ab867a1 rename CCLD to LINK 2014-06-03 23:43:53 +07:00
Nguyen Anh Quynh 0936b56c54 rename libcapstone.dll to capstone.dll, libcapstone.lib to capstone.lib for Windows platform 2014-06-04 00:26:33 +08:00
Nguyen Anh Quynh c80d840ffc add XCore architecture 2014-05-26 23:02:48 +08:00
Nguyen Anh Quynh 2c61656d99 tests: correct the prototype of mycallback() in test_skipdata 2014-05-20 10:30:33 +08:00
danghvu 50fdc6c463 Merge with upstream 2014-05-19 21:21:03 -05:00
danghvu 69a7c2d580 Make test_skipdata performs tests by default 2014-05-19 20:52:25 -05:00
Nguyen Anh Quynh cb2c4f90bf test_x86: output sib_base, sib_index, sib_scale separately 2014-05-17 13:12:29 +08:00
Nguyen Anh Quynh 9389353971 tests: fix warnings caused by unused variable/function in test_skipdata.c 2014-05-15 21:04:37 +08:00
Nguyen Anh Quynh 76087d2c33 rename static library extension to .lib for cross-windows building 2014-05-14 14:53:51 +08:00
Nguyen Anh Quynh b07523ff26 Merge branch 'next' into msvc2 2014-05-10 19:46:37 +08:00
Nguyen Anh Quynh 595386c668 do not overwrite LDFLAGS in tests/Makefile 2014-05-10 15:50:38 +08:00
Axel 0vercl0k Souchet de2dff44a0 fixed test_skipdata.c for VS2012 2014-05-09 21:32:41 +01:00
Axel 0vercl0k Souchet d3eb98bd34 fixed test_detail.c for VS2012 2014-05-09 21:28:07 +01:00
Axel 0vercl0k Souchet e116c51c08 fixed test_ppc.c for VS2012 2014-05-09 21:17:02 +01:00
Axel 0vercl0k Souchet a072459b4a fixed test_mips.c for VS2012 2014-05-09 21:14:19 +01:00
Axel 0vercl0k Souchet ca16d0c6ca fixed test_arm64.c for VS2012 2014-05-09 21:11:29 +01:00
Axel 0vercl0k Souchet 6b2395f5f7 fixed test_arm.c for VS2012 2014-05-09 21:08:40 +01:00
Axel 0vercl0k Souchet e47b8121fe test_x86.c now works on VS2012 2014-05-09 21:03:29 +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
danghvu 80c8c1f05c Remove unneeded -fPIC in tests 2014-05-08 11:37:55 -05:00
danghvu 6150a72596 Initialize CFLAGS and LDFLAGS properly for test 2014-05-08 11:19:33 -05:00
Nguyen Anh Quynh 58a0047d43 Makefile: put common functions into functions.mk 2014-05-01 22:53:52 +08:00
Ole André Vadla Ravnås 927fcbcf88 Makefile: make it possible to avoid building static/shared library 2014-05-01 16:06:11 +02:00
Ole André Vadla Ravnås f536d4014b Makefile: implement a "silent rules" approach
The old behavior is still available through `make V=1`. This is similar
to the Linux kernel and newer versions of automake.
2014-05-01 16:06:03 +02:00
Ole André Vadla Ravnås 7a7343945d Makefile: allow `BUILDDIR` to be a relative path 2014-04-30 00:06:41 +02:00
Ole André Vadla Ravnås 544ba8bf0b Makefile: fix implicit rule pre-requisite 2014-04-30 00:06:12 +02:00
Ole André Vadla Ravnås c920daff13 Makefile: fix out-of-tree build regression
Because `BUILDDIR` may be an absolute path.
2014-04-29 23:02:36 +02:00
Nguyen Anh Quynh 5519a68812 Makefile: fix clean targets and put all test binaries under BUILDIR/tests/ 2014-04-29 16:24:30 +08:00
Ole André Vadla Ravnås 35f937d2db Adapt core build system to allow building out-of-tree
Simply define `BUILDDIR` to where you would like build output to go.
2014-04-29 09:00:34 +02:00
Nguyen Anh Quynh 42288ac4e3 SKIPDATA: add 1 more argument to callback function pointing to the input buffer of cs_disasm_ex() 2014-04-14 14:53:13 +08:00
Nguyen Anh Quynh 943cb2d71b tests: add more example on customizing SKIPDATA mode to test_skipdata.c 2014-04-11 17:12:58 +08:00
Nguyen Anh Quynh 655c7021d2 tests: more C89 fixes 2014-04-11 12:15:33 +08:00
Nguyen Anh Quynh 8118bcd913 tests: add example code on how to rename 'data' instruction's mnemonic of SKIPDATA mode 2014-04-11 11:14:33 +08:00
Nguyen Anh Quynh 5b556e5fcf tests: C89 2014-04-11 10:15:26 +08:00
Nguyen Anh Quynh b64d1cf193 refine the comments for Skipdata sample code 2014-04-10 23:05:28 +08:00
Nguyen Anh Quynh 2579a3fae9 systemz: add a missing operand for instructions involving PCRel 2014-04-10 18:14:08 +08:00
Nguyen Anh Quynh c82581992a tests: add test_skipdata.c & do not test SKIPDATA in test.c anymore 2014-04-10 17:49:50 +08:00
Nguyen Anh Quynh 7eff377630 tests: fix typo referencing X86 in test_systemz.c. bug reported by Ben Nagy 2014-04-10 16:42:06 +08:00
Nguyen Anh Quynh 54015f45bc tests: add sanity check on insn->detail, since it can be NULL when SKIPDATA option is ON 2014-04-10 00:02:04 +08:00
Nguyen Anh Quynh e4fae8723e systemz: support length for Mem op 2014-03-24 17:26:57 +08:00
Nguyen Anh Quynh d5ef3b83b6 test: cleanup test.c 2014-03-23 22:59:27 +08:00
Nguyen Anh Quynh da1e833c8c systemz: support accesss register operand 2014-03-23 11:12:07 +08:00
Nguyen Anh Quynh cf2f9e1c17 tests: fix test_systemz.c following last changes on SystemZ's Op 2014-03-23 09:20:47 +08:00
Nguyen Anh Quynh 48a14ca4ce add SystemZ arch 2014-03-23 08:35:45 +08:00
Nguyen Anh Quynh 2ff665ad4a arm: support asm syntax CS_OPT_SYNTAX_NOREGNAME to print out registers with numbers (ex: 'r11' rather than 'fp') 2014-03-11 00:18:50 +08:00
Nguyen Anh Quynh ea9f4b197e sparc: add SparcV9 tests 2014-03-10 20:38:01 +08:00
Nguyen Anh Quynh 78153f59bb sparc: add SWAP instruction 2014-03-10 15:29:33 +08:00
Nguyen Anh Quynh 05e27138ae core: add Sparc arch 2014-03-10 11:58:57 +08:00
Nguyen Anh Quynh 8abb345ea9 tests: only compile tests for selected archs. bug reported by @osxreverser 2014-03-01 20:44:58 +08:00
Nguyen Anh Quynh 226d7dca64 change API cs_close() to take pointer to handle as argument. this lets us invalidate the closed handle 2014-02-27 22:20:39 +08:00
Nguyen Anh Quynh 491469155e tests: continue to next tests rather than quit when failing to initialize a test 2014-02-22 16:54:44 +08:00
Nguyen Anh Quynh ceae16d5a9 tests: report error when cs_open() failure 2014-01-19 16:04:23 +08:00
Nguyen Anh Quynh d80cede9a3 last change to support BSD broke cross-comple. fix Makefile so cross-compile work again 2014-01-16 21:07:59 +08:00
opn 73b6068ba0 build: switch from hardcoded gcc to default c compiler
modified:   tests/Makefile

Signed-off-by: Oliver Pinter <op@crysys.hu>
2014-01-16 12:28:25 +01:00
Nguyen Anh Quynh bdd1e340dd remove 'restrict' keyword in the definition of cs_vsnprintf(). also compile tests/* with -L option 2014-01-16 12:34:06 +08:00
Nguyen Anh Quynh d159a03f23 tests: proper extensions for newly added static executables 2014-01-09 15:49:44 +08:00
danghvu 78647863a5 Add test binary for static link 2014-01-09 11:14:40 +07:00
Nguyen Anh Quynh 39b812d9e9 switch detail to be CS_OPT_OFF by default 2014-01-07 23:36:26 +08:00
Nguyen Anh Quynh f122ae0629 tests: simplify some accesses to insn's details, and fix some typo bugs 2014-01-05 21:45:30 +08:00
Nguyen Anh Quynh 91e532d5ab print out ppc_bh information in test_ppc.c & TestPpc.java 2014-01-05 09:15:42 +08:00
Nguyen Anh Quynh f1d489b949 ppc: support details information 2014-01-05 00:00:05 +08:00
Nguyen Anh Quynh e29eaf9cbb tests: use LDFLAGS to link test files - this is to make Gentoo happy 2014-01-03 12:14:32 +08:00
Nguyen Anh Quynh 0d001bb1ef tests: correct the dummy setup for LDFLAGS. suggested by Anton Bolshakov 2014-01-03 11:40:00 +08:00
Nguyen Anh Quynh 34ce2a5325 tests: dummy setup LDFLAGS for Gentoo 2014-01-02 14:46:56 +08:00
Nguyen Anh Quynh 5f1f90c559 fix for the last commit, and make the test code no longer specify ppc code as 64bit 2014-01-01 23:28:05 +08:00
Nguyen Anh Quynh 42c6b1acc7 initial support for PPC 2013-12-30 00:15:25 +08:00
Nguyen Anh Quynh 4ca85111f6 tests: do not use -L option for clang 2013-12-29 22:36:00 +08:00
Nguyen Anh Quynh 04c19beefe rename API cs_disasm_dyn() to cs_disasm_ex(), and intentionally breaks compatibility with 1.0 2013-12-25 13:26:22 +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 397d0de598 tests: simplify print_insn_detail() function by deleting unused argument 2013-12-16 23:37:08 +08:00
Nguyen Anh Quynh 4d3e852fbb detail option: provide instruction id even when detail option is OFF 2013-12-14 10:45:09 +08:00
Nguyen Anh Quynh 9d946516c3 arm64: fix AArch64_getFeatureBits() 2013-12-11 18:00:19 +08:00
Nguyen Anh Quynh bdaf3b5089 x86: delete useless constant values assigned for instructions in x86.h 2013-12-09 00:55:49 +08:00
Nguyen Anh Quynh 6677b994e7 arm: fix a wrong calculation on sign of .disp value in mem reference 2013-12-08 22:20:35 +08:00
Nguyen Anh Quynh 9f523d1699 mips: properly map alias instruction back to public id. this fixes the crash reported by Pancake 2013-12-06 13:49:23 +08:00
Nguyen Anh Quynh b4ce38355a x86: map xstorerng alias instruction back to xstore. bug reported by Nicolas Ruff 2013-12-06 08:06:21 +08:00
Nguyen Anh Quynh 8f13f3c6ab rename @hex_code to @bytes, and move it to next to @size 2013-12-04 22:57:04 +08:00
Nguyen Anh Quynh c45b1588ef Merge branch 'master' of https://github.com/joxeankoret/capstone into hexcode 2013-12-04 19:28:54 +08:00
Nguyen Anh Quynh 641b78375f x86: fix relative call. bug reported by Joxean Koret 2013-12-04 16:56:40 +08:00
Joxean 367a4df66f Partially reverted previous commit
I added mistakenly various local-only changes.
2013-12-04 07:15:45 +01:00
Joxean 114df0ef2a Added @hex_code member
It's used to retrieve the bytes of the instruction.
2013-12-04 07:11:32 +01:00
Nguyen Anh Quynh c618db4473 change option names for cs_option(), and update python binding accordingly to support new cs_option() 2013-12-04 00:05:04 +08:00
Nguyen Anh Quynh b8ce68ec05 change cs_option() API to be more flexible with option value 2013-12-03 23:45:08 +08:00
Nguyen Anh Quynh 01aba002e3 add cs_option() API. move ATT & Intel syntax here, rather than having them as CS_MODE, which is wrong 2013-12-03 21:00:09 +08:00
Nguyen Anh Quynh 6d552e5540 x86: fix bug in relative jump. reported by Joxean 2013-12-03 18:23:53 +08:00
Nguyen Anh Quynh 5df9e4be91 tests: change variable address's type to uint64_t 2013-12-03 15:02:12 +08:00
Nguyen Anh Quynh 7b7b40c879 tests: now @address is uint64_t, no need to typecast for PRIx64 anymore 2013-12-03 12:24:06 +08:00
Nguyen Anh Quynh f35e2ad35c add @regs_read_count, @regs_write_count, @groups_count to @cs_insn. bump API to 1.4 2013-12-03 11:10:26 +08:00
Nguyen Anh Quynh d57fa4f68e x86: added bunch of test insn (commented) 2013-12-03 00:45:39 +08:00
Nguyen Anh Quynh 9c950c15d6 x86: fix all the shift rotate insns with 1 as immediate: shl, shr, sar, ror, rol. thus, removed the hack on this insns. 2013-12-02 23:20:07 +08:00
Nguyen Anh Quynh 8fcec67893 x86: do not sign-extend immediate. this fixes the issues reported by LongLD 2013-12-02 22:03:30 +08:00
Nguyen Anh Quynh b9b3d29ff5 x86: print segment register in some insns with memory references. This fixes the bug reported by Edgar & Attila 2013-12-02 16:21:55 +08:00
Nguyen Anh Quynh ec0ed8ee94 semantics: add insn group JUMP, so now we can check if this insn is branching 2013-12-02 13:55:38 +08:00
Nguyen Anh Quynh 7c7a8bc523 arm: move static variable ITBlock to cs_struct, so make arm code truly thread-safe 2013-12-02 13:16:44 +08:00
Nguyen Anh Quynh f1c2eee091 x86: clang still complains on unused enum type. this shuts it up 2013-12-02 12:29:07 +08:00
Nguyen Anh Quynh 0e3defb6f8 arm64: remove asprintf.c and use static buffer instead for SysRegMapper_toString(). this fixes the bug on MSR insn reported by Patroklos Argyroudis 2013-12-02 10:30:01 +08:00
Nguyen Anh Quynh 524194acfb test: add few (commented out) arm instructions to test_arm.c 2013-12-01 23:23:37 +08:00
Nguyen Anh Quynh bc38a28761 test: add some more insn to test_arm.c (commented out code) 2013-12-01 23:14:17 +08:00
Nguyen Anh Quynh 173ed2b1cb arm: upgrade core engine 2013-12-01 22:19:27 +08:00
Nguyen Anh Quynh cc6cf65980 tests: add some test insn (commented) 2013-12-01 09:01:52 +08:00
Nguyen Anh Quynh ad61c49288 arm64: handle decomposer properly for alias insn 2013-11-30 16:23:31 +08:00
Nguyen Anh Quynh 6b7abe3c81 arm64: handle alias insn in a better way, and add support for MNEG. bug reported by Patroklos Argyroudis 2013-11-30 00:54:24 +08:00
Nguyen Anh Quynh 81d35e6105 Merge branch 'master' of https://github.com/aquynh/capstone 2013-11-29 23:41:53 +08:00
Nguyen Anh Quynh 723687ea0e tests: typecast size_t to uint64_t for printf, since MingW doesnt support zu specifier 2013-11-29 22:36:45 +08:00
Daniel Godas-Lopez 9286504347 now the clean target deletes all binaries from all targets 2013-11-29 12:56:13 +00:00
Nguyen Anh Quynh 90acea3530 fix arm64_op_mem & arm64_op_type structures: int32_t is enough for imm & disp 2013-11-29 17:54:17 +08:00
Nguyen Anh Quynh b42a657873 change cs_disasm() and cs_disasm_dyn() to be portable API. fix related code using these API 2013-11-29 17:40:07 +08:00
Daniel Godas-Lopez 0f7c4325dd unified the targets for *nix and windows 2013-11-29 10:09:37 +08:00
danghvu 2e19d93db8 More generic name for *nix target 2013-11-28 03:06:31 -06:00
danghvu a0f93bd4ca Shorten tests/Makefile 2013-11-28 02:46:15 -06:00
pancake ad3cbaf5d4 Use proper Makefile targets in tests 2013-11-28 14:15:55 +08:00
Nguyen Anh Quynh 26ee41aa67 initial import 2013-11-27 12:11:31 +08:00