Commit Graph

792 Commits

Author SHA1 Message Date
Nguyen Anh Quynh 3cacf6772a bindings: make bindings/const_generator.py compatible with recent reformat of C headers 2018-10-01 20:29:39 +08:00
Nguyen Anh Quynh d499a349e4 bindings: update PPC constants 2018-09-17 21:01:01 +08:00
xambroz 67b9a2174f introduce PYTHON2 and PYTHON3 variables in the makefiles (#1236)
This change makes it possible to be explicit during the build time
on what python version/binary use to compile.
2018-08-29 12:26:53 +08:00
Nguyen Anh Quynh 76c1c3c4e9 merge next to master 2018-07-20 12:36:50 +08:00
Nguyen Anh Quynh 377ededee7 python: raise CsError(CS_ERR_SKIPDATA) when accessing irrelevant data in skipdata mode. this fixes issue #679 2018-07-18 13:43:32 +08:00
Nguyen Anh Quynh a1ccc8ebda python: raise CsError(CS_ERR_SKIPDATA) when accessing irrelevant data in skipdata mode. this fixes issue #679 2018-07-18 13:37:45 +08:00
Stephen Eckels 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
Nguyen Anh Quynh 1036de09bf Revert "Merges encoding branch (#1187)"
This reverts commit a1ed8fc6f6.
2018-07-03 11:55:29 +08:00
Stephen Eckels 699611072b Merges encoding branch (#1187)
* Added encoding field to instructions, as per encoding branch

The encoding branch appears to have added some useful fields
accessible from the public API, including the size and offsets
of displacements and immediates in instructions.  I needed access
to these fields, but the encoding branch is months behind the
active branches, so I took the minimum code from the old encoding
branch and put them into a more recent version of master.

It does seem that the most recent version does not have an offset
for the modRM byte in the InternalInstruction struct, so I did
not keep this field when bringing it to the more recent version.

I also added some of the changes made by user jellever, who added
support for accessing these new fields from the python bindings.

(cherry picked from commit d358c4b987cc77af90e24da15937e021c42f682f)

* Fixed bug with python bindings from adding encoding field

I had forgotten an import that resulted in failure when trying
to obtain instruction details.

(cherry picked from commit 44a15e378900efb624e7cdb952d32558ba0de684)

* promoted displacement to 64 bits

* Added modrm offset

* formatting from review fixed

* updated 32 bit C tests

* Added 64 and 16 bit C tests

* Updated python tests

* fixed formatting and size in py bindings

* Delete Solution.VC.db-shm

* Delete Solution.VC.db-wal

* Update test_x86.c

* fixed formatting and conditional prints

* fixed formatting
2018-06-28 21:37:34 +08:00
Catena cyber 8ccaab5f79 Better error reporting for python binding (#1189) 2018-06-25 19:48:02 +08:00
Catena cyber 154c9ffdd8 Better error reporting for python binding (#1188)
To diagnose issue with oss-fuzz building corpus
2018-06-25 01:35:59 +08:00
Nguyen Anh Quynh b6e566b726 Python: pump number of Mips operands to 10. see #1183 2018-06-19 09:35:37 +08:00
Nguyen Anh Quynh aeb4128cab x86: support new instructions endbr64 & endbr32 2018-06-01 22:57:53 +08:00
Nguyen Anh Quynh 1da2ae94de EVM: add missing files 2018-03-31 17:32:22 +08:00
Nguyen Anh Quynh 9c7a094b58 add Ethereum VM architecture 2018-03-31 17:29:22 +08:00
Nguyen Anh Quynh c21f94d565 python: import os 2018-02-25 23:00:40 +08:00
Nguyen Anh Quynh b54e7ae3b7 python: import os 2018-02-20 21:22:18 +08:00
Audrey Dutcher f32a63b03b Add option for inhibiting the core build while installing the python components. Add option for loading the core from a custom path. (#1089) 2018-02-20 21:12:46 +08:00
Audrey Dutcher 10c4aa807d Add option for inhibiting the core build while installing the python components. Add option for loading the core from a custom path. (#1089) 2018-02-20 21:11:19 +08:00
Nguyen Anh Quynh e9394bba5c python: cleanup 2018-01-15 13:42:00 +08:00
tdube e1aaa50a5b python: fix merge confliction of #1073 2018-01-15 13:34:13 +08:00
tdube 1a1077db01 Update setup.py (#1073)
Check to make sure static library file exists before trying to copy it. Current build options include option to not build a static lib.
2018-01-15 13:30:51 +08:00
Kalmalyzer 9944bfde76 M68K: Branch targets are a separate addressing mode; PC relative displacements printed as target addresses (#1068)
* Branch targets are a separate addressing mode

Branch targets are relative displacements that identify code locations. These are neither .w nor .l nor immediates. This change removes the immediate #s before branch target addresses in disassembly, and represents the actual branch instructions more accurately in the cs_m68k_op datastructure.

M68K Python bindings have also been updated.

* m68k_inst.pc handles better; print target for PC relative offsets

Previous changes to branch operations relied on m68k_inst.pc pointing to (start of instruction + 2). This was not the case - it pointed to the end of the current instruction. This change makes it so that m68k_inst.pc points to (start of instruction), which is simple to work with.

It also changes printing of PC relative offsets to print the absolute target address, which is consistent with how most 68000 assemblers & disassemblers behave.
2018-01-06 20:13:41 +08:00
Kalmalyzer 775a1d9825 Reorder M68KOp elements to match order on C side (#1067) 2018-01-02 13:35:25 +08:00
Nguyen Anh Quynh 2cf2c1a0fc sparc: change imm type from int32_t to int64_t 2017-12-27 14:46:47 +08:00
Nguyen Anh Quynh 130545f040 bindings: update after #1064 2017-12-21 09:15:24 +08:00
Nguyen Anh Quynh 0acbc9e346 bindings: update after #1064 2017-12-21 09:14:05 +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
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
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
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
Nguyen Anh Quynh ff2f6831db binding: update following addition of GRP_BRANCH_RELATIVE 2017-07-30 19:06:29 +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
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
Nick Briggs 2aedb8168c Rename test.c to test_basic.c with corresponding executable name change. (#923)
* Rename test.c to test_basic.c with corresponding executable name change.

* Fix Makefile, tests/Makefile to comprehend renamed test program. See issue #922

* Fix XCode project to comprehend renamed test program.  See issue #922

* Rename python test.py to test_basic.py to parallel C test name.  See issue #922

* Rename ocaml test.ml to test_basic.ml to parallel C test name.  See issue #922

* Fix MSVC project definitions to comprehend renamed test program.  See issue #922
2017-05-11 22:58:12 +07:00
Nguyen Anh Quynh fcaf7d9a6f x86: add UD0 instruction 2017-05-07 11:17:23 +08:00
Nguyen Anh Quynh 2bf26fe448 python: add a debug line 2017-04-19 23:19:00 +08:00
Fotis Loukos 5fbe75eb50 Fixed python bindings. 2017-04-14 18:57:40 +03:00
Fotis Loukos 308af00815 TMS320C64x support at tests and const generator. 2017-04-14 17:03:28 +03:00
Fotis Loukos ae6f2d1411 Added support for the TMS320C64x architecture. 2017-04-14 17:00:40 +03:00
Andrew Dutcher 425bf530f2 Add ability to copy prebuilt libraries from prebuilt directory during python build 2017-03-04 17:09:07 -08:00
Andrew Dutcher 6e95167865 Add ability to copy prebuilt libraries from prebuilt directory during python build 2017-03-05 06:08:36 +08:00
Nguyen Anh Quynh 617c64fbb5 Python: Automatically conform to PEP440 for version numbers. ported from Unicorn Python binding 2017-02-01 13:23:15 +08:00
Nguyen Anh Quynh 3925b332ce Python: Automatically conform to PEP440 for version numbers. ported from Unicorn Python binding 2017-02-01 13:11:21 +08:00
BartmanAbyss 6830660783 (M68k) make displacements signed (#836)
* (M68k) make displacements signed

* (M68k) revert group changes

* (m68k) signed displacement in python bindings
2017-01-01 01:11:48 +08:00
Nguyen Anh Quynh f1aa0a3d04 python: version 4.0.0 2016-11-04 23:55:20 +08:00
Nguyen Anh Quynh 1b5846ee90 Merge branch 'feat/better_python_setup_next' of https://github.com/angr/capstone into angr-feat/better_python_setup_next 2016-11-04 23:25:27 +08:00
Andrew Dutcher 2f1c3ce8a6 On this branch, dylib and so files are versioned 2016-10-31 10:54:58 -07:00
Nguyen Anh Quynh 91808ab6cd python: cleanup 2016-10-30 16:19:10 +08:00
Andrew Dutcher b2504b963e Python setup: Clean up some merge failures, adapt for changes on next branch 2016-10-26 23:15:42 -07:00
Andrew Dutcher 5acdd97ca2 Python: Actually attempt to load .so.3 extension on linux 2016-10-25 21:49:59 -07:00
Andrew Dutcher 97fac00499 Python: Spelling/capitalization/contact fixes in readme 2016-10-25 21:49:58 -07:00
Andrew Dutcher 73f92384ee Minor english fixes 2016-10-25 21:49:58 -07:00
Andrew Dutcher 06b26efbf4 Python: remove special case for cygwin build 2016-10-25 21:49:58 -07:00
Andrew Dutcher 816f131d27 Python: Make cython work with extreme prejudice 2016-10-25 21:49:58 -07:00
Andrew Dutcher 1008716ee5 Python: Clean up the capstone-windows stuff with extreme prejudice 2016-10-25 21:48:41 -07:00
Andrew Dutcher 3b5b5ff58c Python: make setup work as expected 2016-10-25 21:48:18 -07:00
Nguyen Anh Quynh 3bd582ef64 python: bump version to 3.0.5 2016-10-26 10:52:53 +08:00
Nguyen Anh Quynh 6bb33edf7e python: capitalized cython name 2016-10-26 04:52:58 +08:00
Andrew Dutcher 4c4d129f86 Python: Actually attempt to load .so.3 extension on linux 2016-10-25 12:56:10 -07:00
Andrew Dutcher 97422c15bd Python: Spelling/capitalization/contact fixes in readme 2016-10-25 12:56:10 -07:00
Andrew Dutcher ffd5320690 Minor english fixes 2016-10-25 12:56:10 -07:00
Andrew Dutcher a75324fc03 Python: remove special case for cygwin build 2016-10-25 12:56:10 -07:00
Andrew Dutcher c3f602e71d Python: Make cython work with extreme prejudice 2016-10-25 12:56:10 -07:00
Andrew Dutcher 21a241192c Python: Clean up the capstone-windows stuff with extreme prejudice 2016-10-25 12:56:10 -07:00
Andrew Dutcher 3c9a1eea08 Python: make setup work as expected 2016-10-25 12:56:10 -07:00
Nguyen Anh Quynh c72ab6014f bindings: regenerate consts 2016-10-25 14:30:13 +08:00
Nguyen Anh Quynh 1e5a48535c add CS_VERSION_{MAJOR, MINOR, EXTRA} 2016-10-25 14:29:21 +08:00
Nguyen Anh Quynh 6624dc446e add CS_VERSION_{MAJOR, MINOR, EXTRA} 2016-10-25 14:23:55 +08:00
Fish 8a5f7af308 Change pointer-deref-then-assignment to memmove to make PyPy happy. 2016-10-13 19:56:41 -07:00
Richo Healey 57cbb8beeb Workaround unicorn handing back bytearrays 2016-10-06 14:40:37 +08:00
Richo Healey 9413509982 Workaround unicorn handing back bytearrays 2016-10-05 22:47:40 -07:00
Benno Fünfstück b446327f3b python-bindings: fix setup.py for wheel installation
When the python bindings are installed using the new wheels
infrastructure, data_files are relative to the site-packages directory
even if using absolute paths.

The following example demonstrates the bug fixed by this commit: (ran on archlinux)

```bash
$ pip install wheel       # if this package is installed, wheel installation is made the default
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |################################| 71kB 124kB/s
Installing collected packages: wheel
Successfully installed wheel-0.29.0

$ pip install capstone    # this will use the wheel installation method now
Collecting capstone
  Using cached capstone-3.0.4.tar.gz
Building wheels for collected packages: capstone
  Running setup.py bdist_wheel for capstone ... done
  Stored in directory: /root/.cache/pip/wheels/7c/d1/d0/db6e2c5ef1063aabb9de2dd8b92b4c27ee6f9fd213240099b8
Successfully built capstone
Installing collected packages: capstone
Successfully installed capstone-3.0.4

$ find /usr/lib/ -name "libcapstone.so"
/usr/lib/python3.5/site-packages/usr/lib/python3.5/site-packages/capstone/libcapstone.so
```

So the path `SITE_PACKAGES` in the `data_files` specification of the
setup.py file was interpreted relative to the python site-packages
directory. The fix for this is simple: use `/capstone` instead of an
absolute path for `SITE_PACKAGES`.
2016-10-03 10:50:08 +08:00
Benno Fünfstück df96d9ee6d python-bindings: fix setup.py for wheel installation
When the python bindings are installed using the new wheels
infrastructure, data_files are relative to the site-packages directory
even if using absolute paths.

The following example demonstrates the bug fixed by this commit: (ran on archlinux)

```bash
$ pip install wheel       # if this package is installed, wheel installation is made the default
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |################################| 71kB 124kB/s
Installing collected packages: wheel
Successfully installed wheel-0.29.0

$ pip install capstone    # this will use the wheel installation method now
Collecting capstone
  Using cached capstone-3.0.4.tar.gz
Building wheels for collected packages: capstone
  Running setup.py bdist_wheel for capstone ... done
  Stored in directory: /root/.cache/pip/wheels/7c/d1/d0/db6e2c5ef1063aabb9de2dd8b92b4c27ee6f9fd213240099b8
Successfully built capstone
Installing collected packages: capstone
Successfully installed capstone-3.0.4

$ find /usr/lib/ -name "libcapstone.so"
/usr/lib/python3.5/site-packages/usr/lib/python3.5/site-packages/capstone/libcapstone.so
```

So the path `SITE_PACKAGES` in the `data_files` specification of the
setup.py file was interpreted relative to the python site-packages
directory. The fix for this is simple: use `/capstone` instead of an
absolute path for `SITE_PACKAGES`.
2016-10-02 15:25:13 +02:00
Nguyen Anh Quynh 744181744f python: cast skipdata function inside binding to simplify the API 2016-10-02 01:36:03 +08:00
Nguyen Anh Quynh 71a42c13c6 python: cast skipdata function inside binding to simplify the API 2016-10-02 01:35:28 +08:00
Nguyen Anh Quynh a83352a33b python: fix CS_SKIPDATA_CALLBACK prototype 2016-10-01 01:33:09 +08:00
Nguyen Anh Quynh 0cac0ec5e8 python: fix CS_SKIPDATA_CALLBACK prototype 2016-10-01 01:31:24 +08:00
Nguyen Anh Quynh 399dd9da81 Merge pull request #764 from akihikodaki/next
arm: treat ARM address as unsigned
2016-09-07 09:51:04 +08:00
Akihiko Odaki e7e4e1dfda arm: treat ARM address as unsigned
It should be unsigned because:
* It does arithmetic operations
* Format strings have "%u" instead of "%d"

# Conflicts:
#	arch/ARM/ARMInstPrinter.c
#	bindings/python/test_arm.py
#	tests/test_arm.c
2016-09-04 00:13:50 +09:00
Akihiko Odaki 2876044815 arm: treat ARM address as unsigned
It should be unsigned because:
* It does arithmetic operations
* Format strings have "%u" instead of "%d"
2016-09-03 14:28:46 +09:00
mrexodia fb2c843f66 changed fcompi to fcomip and fucompi to fucomip 2016-08-30 23:10:04 +02:00
Nguyen Anh Quynh e93290962c arm64: add NEGS & NGCS alias instructions. this fixes issue #752 2016-08-23 14:01:17 +08:00
Nguyen Anh Quynh a4634b45dc Merge pull request #696 from emoon/m68k-reg-read-write
[M68K] Implemented regs read/write lists
2016-08-11 11:22:48 +08:00
Daniel Collin 147083be67 [M68K] Implemented regs read/write lists 2016-08-09 17:29:36 +02:00
Nguyen Anh Quynh fae35cedac x86: properly handle SSE/AVX instructions 2016-07-15 20:37:19 +08:00
lucasg 8b1899d859 Replace copy.deepcopy by copy_ctypes_list for get_arch_info
This replacement was done for commit
1647720656, allowing the python binding to
be used in PyPy. It seems the m68k arch has been forgotten.
2016-07-09 14:38:01 +02:00
Pranith Kumar ddaeb354ee Fix error return code 2016-06-29 11:08:13 -04:00
Andrew Dutcher fcd06dedd7 Re-apply changes from 1647720656 on next branch, that's the commit that lets the python bindings run in pypy 2016-06-16 15:47:43 -07:00
Niels Boehm 06cc17d41c Fix typo in m68k constant for immediate operand. 2016-06-15 08:25:59 +02:00
Niels Boehm 78893a5473 Add m68k to the general Python tests. 2016-06-14 13:35:02 +02:00
Niels Boehm 901928e28d Add missing architectures to test_lite.py.
The code constants and the all_tests tuple is now analogous to
test_basic.py.
2016-06-14 13:28:14 +02:00
Niels Boehm 0f4ecc6ccc Use and test syntax against None in all_tests.
Comparing against 0 or just testing the truthiness is suboptimal, as you
lose the ability to explicitly set the syntax to CS_OPT_SYNTAX_DEFAULT
or 0.

Also, using None to mean "don't change" or other "here is no value"
interpretations is much more pythonic than the C-idiomatic 0.
2016-06-13 12:25:24 +02:00
Andrew Dutcher 0ed9820d2f Python bindings: Changes to how structures are copied so that capstone works correctly in PyPy 2016-06-09 19:04:27 -07:00
Nguyen Anh Quynh e3f94ac4ab fix merging conflict 2016-05-22 08:58:33 +08:00
Nguyen Anh Quynh 7b03323b8c Merge pull request #682 from ibabushkin/next
Reduced confusion caused by the m68k test being out of date
2016-05-14 18:19:36 +08:00
Nguyen Anh Quynh 820d7d02c7 Merge pull request #669 from zachriggle/next-mips
Add MIPS_GRP_INT and MIPS_GRP_CALL
2016-05-14 09:36:49 +08:00
Inokentiy Babushkin bdb1d2988c Further refinements to the tests + python test fix for M68K 2016-05-13 18:39:32 +02:00
Inokentiy Babushkin e488a7ed8e Fixed ordering in files 2016-05-12 08:57:25 +02:00
Inokentiy Babushkin 1b0779b97a Fixed python bindings to align with struct changes 2016-05-12 08:50:05 +02:00
Zach Riggle 1b3f07ad12 Add MIPS_GRP_XXX aliases for generic types. 2016-05-03 07:30:31 -07:00
Pranith Kumar 4a3af7b1c8 Handle python test failure properly 2016-04-30 13:12:16 -04:00
Nguyen Anh Quynh 6858c0f590 binding: remove cx_x86_op::fp following the change in the core 2016-04-24 00:16:08 +08:00
Sean Heelan 83cd155db2 __getattr__ should raise AttributeError, not return None, on failure
Fix for issue #624
2016-04-18 18:21:24 +08:00
Sean Heelan 6f043f1635 __getattr__ should raise AttributeError, not return None, on failure
Fix for issue #624
2016-04-18 17:52:10 +08:00
Nguyen Anh Quynh 5c85a75d40 m68k: fix conflicts when merging with #625 2016-04-12 19:58:29 +07:00
Nguyen Anh Quynh 7fff673415 bindings: update after recent changes on some M68k enums 2016-04-12 18:47:19 +08:00
Nguyen Anh Quynh c6397bf354 python: add access field for ARM64 2016-04-12 13:42:07 +08:00
Nicolas PLANEL a66b4b425c update generated bindings 2016-04-11 23:05:11 +10:00
Nicolas PLANEL c086c904d3 fixup indentation, mix of spaces and tabs 2016-04-11 23:03:45 +10:00
Daniel Collin 0bcb2e546c Various fixes
* Fixed a break indentation
* Fixed incorrect enum value for M68K_GRP_IRET
* Fixed so groups_count is set to 0 at init
* Added group_count printing in python example
2016-04-10 16:16:28 +02:00
jmechnich 066febc6fe bugfix: removed leading ./ from OBJDIR to avoid corrupting setup.py install 2016-03-26 10:29:52 +08:00
jmechnich 52294728e5 bugfix: removed leading ./ from OBJDIR to avoid corrupting setup.py install 2016-03-25 22:31:13 +01:00
Nguyen Anh Quynh a23f9d37ed add CS_OPT_UNSIGNED option to print immediate in unsigned form. only ARM is supported for now (issue #585) 2016-03-14 13:52:23 +08:00
Nguyen Anh Quynh 3ffc798787 python: add __version__ 2016-03-06 21:28:45 +08:00
Nguyen Anh Quynh c69b6a921d Merge branch 'next' of https://github.com/aquynh/capstone into next 2016-03-06 21:28:16 +08:00
Nguyen Anh Quynh 3766ed1282 python: add __version__ 2016-03-06 21:27:55 +08:00
Michael Cohen 32923cf004 Added a missed dependency to MANIFEST.in to allow packaging of C src in the sdist. 2016-03-04 08:06:05 -08:00
Michael Cohen 40a42b4939 Fix setup.py to use setuptools and put the libcapstone.so in the right place. 2016-02-15 02:34:32 +01:00
Michael Cohen 29ee560688 Support all OSs. 2016-02-11 23:43:22 +01:00
Michael Cohen ff5b295b88 Fix setup.py. 2016-02-11 15:24:17 +01:00
Nguyen Anh Quynh 31f239f920 python: implement setter for skipdata_setup. this fixes issue 564 so it is now possible to redefine skipdata's mnemonic 2015-12-06 01:00:21 +07:00
Raijinili 6ea7ec83ad Python 3: CsError.__str__
Choose `CsError.__str__` implementation based on Python version.
2015-12-02 12:19:11 +07:00
Raijinili 491ebd217a Python 3: CsError.__str__
Choose `CsError.__str__` implementation based on Python version.
2015-11-30 23:51:25 -05:00
Nguyen Anh Quynh 5def39eab0 python: perform the last dylib loader only if it fails before that (for El Capitan) 2015-10-19 20:04:47 +08:00
Nguyen Anh Quynh 7fc95e82bb python: perform the last dylib loader only if it fails before that (for El Capitan) 2015-10-19 20:03:45 +08:00
Tim Strazzere 73c255a0cf Add OSX 10.11 dylib load fix
El Capitan does not guaranteed that
(DY)LD_LIBRARY_PATH will exist, so force
one last check for the default install
directory that the install script uses.
2015-10-17 11:08:58 +08:00
Nguyen Anh Quynh 6c22904682 Merge pull request #515 from strazzere/master
Add OSX 10.11 dylib load fix
2015-10-17 11:06:40 +08:00
Tim Strazzere 36cabb6b1d Add OSX 10.11 dylib load fix
El Capitan does not guaranteed that
(DY)LD_LIBRARY_PATH will exist, so force
one last check for the default install
directory that the install script uses.
2015-10-16 17:09:00 -07:00
Nicolas PLANEL 051140f3ba [binding][python] print the string value of CsError
Print the string error of CsError.
2015-10-08 16:48:26 +11:00
Nicolas PLANEL 3593749e29 [python] test_m68k sync with C implementation
Sync the sample test to have the same output than the C implementation.
2015-10-06 16:08:33 +11:00
Nicolas PLANEL b2e3ff296f [binding][python] fixup M68KOpMem structure
Fixup the structure, to be in sync with the C implementation.
2015-10-06 16:05:09 +11:00
Nicolas PLANEL a496bbfc0c [binding][python] fixup python 3 compatibility
In Python 3.x dict.keys() return a dict_keys object not a list.
2015-10-04 10:44:17 +08:00
Nicolas PLANEL 65106cfde7 file.write() need bytes when file is opened in binary mode 2015-10-04 00:31:25 +08:00
Nicolas PLANEL 0db56e33da [binding][python] fixup python 3 compatibility
In Python 3.x dict.keys() return a dict_keys object not a list.
2015-10-03 21:11:17 +10:00
Daniel Collin 2ee675c10a This adds M68K support to Capstone 2015-10-02 20:47:00 +02:00
Nguyen Anh Quynh 4d7d5c13a1 python: support newly added MASM syntax 2015-08-09 10:52:43 -07:00
learn_more 07a7f6c8aa Add missing const for arm64
update suite/test_group_name
2015-08-02 14:21:55 +02:00
Nguyen Anh Quynh cc7434c57e python: do not copy msvc/headers directory in setup.py 2015-07-15 17:38:12 +08:00
Nguyen Anh Quynh 932381aacc python: do not copy msvc/headers directory in setup.py 2015-07-15 15:44:42 +08:00
Nguyen Anh Quynh 1a7a13e4da Merge branch 'master' into v3 2015-06-22 16:50:35 +08:00
Alex Chernetz 5799c485a6 [Python binding] Fix setup.py to allow installing in a virtualenv
In a virtualenv:
- site.getusersitepackages() won't import
- get_python_lib() will return the directory inside the virtualenv
- the "--user" option can therefore be safely ignored.
2015-06-19 23:22:36 -07:00
Alex Chernetz 38094b1098 [Python binding] Fix setup.py to allow installing in a virtualenv
In a virtualenv:
- site.getusersitepackages() won't import
- get_python_lib() will return the directory inside the virtualenv
- the "--user" option can therefore be safely ignored.
2015-06-19 23:18:52 -07:00
w4kfu 3dcb8fbc49 remove the redundant detail copy 2015-06-18 11:44:12 +02:00
w4kfu 7a4e5f7305 remove duplicate detail info, modify all access to _detail to _raw.detail.contents 2015-06-18 11:07:05 +02:00
w4kfu 5ffd2f0761 fix issue #398 (Python binding no deep copy of detail pointer) 2015-06-17 17:25:56 +02:00
Nguyen Anh Quynh ebc370ff40 bump version to 3.0.4 2015-06-08 22:29:55 +08:00
Nguyen Anh Quynh 2737135350 python: rename test to test_basic in test_all.py 2015-06-08 17:21:27 +08:00
neuromancer a210229a0f Allow local installations of the python bindings
These changes will allow a pypi user to locally install capstone using the --user flag. If it possible, please update the correspondent package (https://pypi.python.org/pypi/capstone/3.0.3)
2015-06-04 21:46:09 +08:00
Nguyen Anh Quynh 0c391bb88b Merge branch 'patch-1' of https://github.com/neuromancer/capstone into t5 2015-06-04 21:40:58 +08:00
Nguyen Anh Quynh 8ac478bd4b python: shared library can be unloaded from under our feet. issue reported by @joelpx 2015-06-04 11:38:26 +08:00
Nguyen Anh Quynh 3808eec033 python: shared library can be unloaded from under our feet. issue reported by @joelpx 2015-06-04 11:37:45 +08:00
Nguyen Anh Quynh 1319f0c6d7 python: rename test.py to test_basic.py 2015-06-03 22:14:59 +08:00
neuromancer 911d0506cd Allow local installations of the python bindings
These changes will allow a pypi user to locally install capstone using the --user flag. If it possible, please update the correspondent package (https://pypi.python.org/pypi/capstone/3.0.3)
2015-06-02 14:31:36 +02:00
Nguyen Anh Quynh 147729e8d7 python: change PpcOpValue.imm type to c_int64 after the recent change in the core 2015-05-16 09:29:02 +08:00
Nguyen Anh Quynh cff5186e08 python: cleanup README.pypi-win 2015-05-15 17:04:16 +08:00
Nguyen Anh Quynh 38d3f661aa python: update README.pypi-src 2015-05-15 17:02:47 +08:00
Nguyen Anh Quynh 53c2b0a290 python: update PyPi packages installation doc 2015-05-15 17:01:18 +08:00
Nguyen Anh Quynh 87ba408aff python: update PyPi packages installation doc 2015-05-15 16:59:09 +08:00
Zach Riggle 73537ceeaf Add reverse lookup for top-level Capstone constants 2015-05-13 11:54:22 +08:00
Nguyen Anh Quynh 1af98dc352 cython: bump version in setup_cython.py to 3.0.3 2015-05-12 09:33:38 +08:00
Zach Riggle a10fbb2b3f Fix error when _cs is None during teardown 2015-05-12 09:26:59 +08:00
Nguyen Anh Quynh 76e46d6e9b Merge branch 'next' of https://github.com/aquynh/capstone into next 2015-05-12 09:26:18 +08:00
Nguyen Anh Quynh a34b231220 python: README.pypi-src 2015-05-10 22:57:47 +08:00
Nguyen Anh Quynh 4b7616183c python: do not try to load libcapstone.so.3 2015-05-10 10:23:05 +08:00
Zach Riggle 1b293064f6 Fix error when _cs is None during teardown 2015-05-09 16:06:48 -04:00
Nguyen Anh Quynh af416e2ff8 bindings: update newly added ARM groups CALL & INT 2015-05-08 23:59:15 +08:00
Nguyen Anh Quynh f5785613ba python: add links to PyPi packages in their README 2015-05-08 17:26:57 +08:00
Nguyen Anh Quynh b89c95fc99 python: bump package version to 3.0.3 (setup.py) 2015-05-08 17:06:59 +08:00
Nguyen Anh Quynh d1e2a292a0 bump version to 3.0.3 2015-05-08 15:22:26 +08:00
Nguyen Anh Quynh 34502fad7d python: remove the leftover code in the last commit 2015-05-02 11:39:38 +08:00
Nguyen Anh Quynh 91a1cb4b03 arm: correct the alias instruction id for MOVsi instructions. bug reported by @joelpx 2015-05-02 11:38:34 +08:00
learn_more 3e915db782 give reg_name, insn_name, group_name a customizable default instead of returning something else for id 0
remove the check for self._raw.id on reg_name and group_name (in CsInsn, since the to_name functions don't operate on the current instruction)
Add reg_name, insn_name and group_name to Cs.
update test_group_name.py with the new api.
2015-04-28 19:29:51 +02:00
danghvu 60a7f422fd Fix a bug in Cython due to renaming 2015-04-28 13:55:29 +08:00
danghvu 14029d8b37 Fix a bug in Cython due to renaming 2015-04-28 00:19:41 -05:00
Nguyen Anh Quynh 9554a4f318 python: a minor fix for test_customized_mnem.py 2015-04-27 12:56:31 +08:00
Nguyen Anh Quynh 03d1e1f86d python: clean up test_*.py 2015-04-27 11:51:48 +08:00
Nguyen Anh Quynh bbde6d5c63 python: support option CS_OPT_MNEMONIC 2015-04-27 11:34:44 +08:00
Nguyen Anh Quynh 44adb35f6a python: clean test_skipdata.py 2015-04-27 11:12:53 +08:00
Nguyen Anh Quynh 97eba89f3d python: correct a comment of method CsInsn.group_name() 2015-04-26 10:44:34 +08:00
Vincent Bénony d2f47d065f Remove enum for ASRS, LSRS, SUBS and MOVS
These instructions are now disassembled ASR, LSR, SUB and MOV, with the "update_flags" bit set.
2015-04-17 11:42:45 +02:00
Nguyen Anh Quynh cbbbac24c3 Merge branch 'next' of https://github.com/aquynh/capstone into next 2015-04-07 16:06:27 +08:00
Nguyen Anh Quynh c343a917fb python: revert to use distutils rather than setuptools 2015-04-07 16:03:01 +08:00
Hank Leininger 3feaa11cd9 Add DESTDIR support for the python binding.
Without this patch, DESTDIR is ignored, so build systems that use a
staging sandbox prior to installing in real-root, such as Gentoo,
cannot build the python binding.

Caveats:

1) I wrote/tested this against the 3.0.2 release, not current HEAD.

2) It might be preferable to do DESTDIR ?= / at the top of the Makefile,
   so that the if/else/fi can be squashed back out.

3) The install_cython target probably needs a similar change; untested.

4) Other bindings might need something similar.
2015-04-07 15:39:05 +08:00
Nguyen Anh Quynh 4504dcdc48 Merge branch 'master' into v3 2015-04-07 13:21:56 +08:00
Hank Leininger 1c0288043c Add DESTDIR support for the python binding.
Without this patch, DESTDIR is ignored, so build systems that use a
staging sandbox prior to installing in real-root, such as Gentoo,
cannot build the python binding.

Caveats:

1) I wrote/tested this against the 3.0.2 release, not current HEAD.

2) It might be preferable to do DESTDIR ?= / at the top of the Makefile,
   so that the if/else/fi can be squashed back out.

3) The install_cython target probably needs a similar change; untested.

4) Other bindings might need something similar.
2015-04-07 13:16:55 +08:00
Nguyen Anh Quynh 2a36c1631b python: fix test_arm.py (indentation on output) 2015-04-07 13:09:16 +08:00
Nguyen Anh Quynh 8fa48fbd8a bindings: update java/ocaml/python bindings after the last change on Arm core 2015-04-07 12:22:51 +08:00
Hank Leininger cf6dea61e8 Add DESTDIR support for the python binding.
Without this patch, DESTDIR is ignored, so build systems that use a
staging sandbox prior to installing in real-root, such as Gentoo,
cannot build the python binding.

Caveats:

1) I wrote/tested this against the 3.0.2 release, not current HEAD.

2) It might be preferable to do DESTDIR ?= / at the top of the Makefile,
   so that the if/else/fi can be squashed back out.

3) The install_cython target probably needs a similar change; untested.

4) Other bindings might need something similar.
2015-04-06 16:40:31 -04:00
Nguyen Anh Quynh 4544ba1f02 cython: support cs_regs_access() API 2015-04-02 22:54:52 +08:00
Nguyen Anh Quynh 0187ad1b8a python: X86Op.avx_zero_mask should have c_bool type 2015-04-02 12:43:57 +08:00
Nguyen Anh Quynh a9015396eb python: X86Op.avx_zero_mask should have c_bool type 2015-04-01 01:10:27 +08:00
Nguyen Anh Quynh 076dc6f124 Merge branch 'newapi' into next 2015-03-26 00:40:57 +08:00
Nguyen Anh Quynh 95d4e9fd00 python: fix access info of test_x86.py (CS_AC_READ|CS_AC_WRITE) 2015-03-26 00:27:19 +08:00
Nguyen Anh Quynh 10647aef58 bindings: update java/ocaml/python after the latest changes in the core for the new API 2015-03-25 17:35:59 +08:00
Richo Healey 3c862d5c11 python: Use setuptools if avilable 2015-03-22 23:05:58 -07:00
Nguyen Anh Quynh 88a95535d0 python: simplify setup.py 2015-03-19 16:57:47 +08:00
Nguyen Anh Quynh 3036ada407 python: simplify setup.py 2015-03-19 16:57:39 +08:00