Commit graph

223 commits

Author SHA1 Message Date
Nguyen Anh Quynh
d553dbf3eb 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
Nguyen Anh Quynh
3f9978c809 Revert "Merges encoding branch (#1187)"
This reverts commit a1ed8fc6f6.
2018-07-03 11:55:29 +08:00
Stephen Eckels
a1ed8fc6f6 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
60ca025dd8 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
8879b5d6cc python: import os 2018-02-25 23:00:40 +08:00
Audrey Dutcher
aeda70f3cb 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
f48111db0e bindings: update after #1064 2017-12-21 09:14:05 +08:00
Nguyen Anh Quynh
54f4863303 python: add a debug line 2017-04-19 23:19:00 +08:00
Andrew Dutcher
e29ddbdbb3 Python: Actually attempt to load .so.3 extension on linux 2016-10-25 12:56:10 -07:00
Andrew Dutcher
ced66e3b77 Python: make setup work as expected 2016-10-25 12:56:10 -07:00
Nguyen Anh Quynh
f585a84966 add CS_VERSION_{MAJOR, MINOR, EXTRA} 2016-10-25 14:23:55 +08:00
Richo Healey
72daee3d07 Workaround unicorn handing back bytearrays 2016-10-05 22:47:40 -07:00
Nguyen Anh Quynh
5b80627a5d python: cast skipdata function inside binding to simplify the API 2016-10-02 01:36:03 +08:00
Nguyen Anh Quynh
0662879d35 python: fix CS_SKIPDATA_CALLBACK prototype 2016-10-01 01:33:09 +08:00
Andrew Dutcher
1647720656 Python bindings: Changes to how structures are copied so that capstone works correctly in PyPy 2016-06-09 19:04:27 -07:00
Sean Heelan
1e608ef4c5 __getattr__ should raise AttributeError, not return None, on failure
Fix for issue #624
2016-04-18 17:52:10 +08:00
Nguyen Anh Quynh
c586269900 python: add __version__ 2016-03-06 21:28:45 +08:00
Raijinili
b0c5436558 Python 3: CsError.__str__
Choose `CsError.__str__` implementation based on Python version.
2015-11-30 23:51:25 -05:00
Nguyen Anh Quynh
2b3a298609 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
f49ac59fd3 Merge pull request #515 from strazzere/master
Add OSX 10.11 dylib load fix
2015-10-17 11:06:40 +08:00
Tim Strazzere
f9ddf05bdb 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
e72bd24c97 [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
8b25b0abcf file.write() need bytes when file is opened in binary mode 2015-10-04 00:31:25 +08:00
Nguyen Anh Quynh
46ab570881 python: shared library can be unloaded from under our feet. issue reported by @joelpx 2015-06-04 11:38:26 +08:00
Zach Riggle
745ac64729 Fix error when _cs is None during teardown 2015-05-12 09:26:59 +08:00
Nguyen Anh Quynh
0187ad1b8a python: X86Op.avx_zero_mask should have c_bool type 2015-04-02 12:43:57 +08:00
Aidan Hobson Sayers
b449e54e25 Set _detail in a dummy Cs, closes #251 2015-01-21 06:48:27 +08:00
Maciej Szawlowski
2c24d88f89 fixed bug that prevented using md.detail = true and md.skipdata = true together 2014-12-31 10:33:05 +08:00
Nguyen Anh Quynh
2537cfd669 python: fix a memory leak issue when we stop enumeration over the disassembled instructions prematurely. patch by Jan Newger 2014-12-16 00:09:40 +08:00
Nguyen Anh Quynh
8ab01369d7 python: export generic operand types & groups 2014-11-19 22:12:40 +08:00
Nguyen Anh Quynh
89460299c3 python: python2.6 does not understand sys.versionn_info.major 2014-11-19 14:37:08 +08:00
Nguyen Anh Quynh
faa925ab8f fix bindings (python/java) and tests after the last change on the type of imm of cs_arm64_op 2014-11-17 11:39:36 +08:00
Nguyen Anh Quynh
75c9b6a45c python: fix comments on hardware modes 2014-11-13 11:55:56 +08:00
Nguyen Anh Quynh
143a494ae7 python: add CS_MODE_MIPS32/64 2014-11-13 11:45:57 +08:00
Nguyen Anh Quynh
0b3d95e4b3 java/ocaml/python: support the newly added mem_barrier field of cs_arm struct 2014-11-11 23:00:35 +08:00
Nguyen Anh Quynh
c942f22a09 arm: support new mode CS_MODE_V8 for Armv8 A32 encodings 2014-11-10 21:52:09 +08:00
Nguyen Anh Quynh
a65d7ef5fa java/ocaml/python: update bindings after the last change on generic instruction groups 2014-10-31 15:47:17 +08:00
Nguyen Anh Quynh
69271ddf74 java/ocaml/python: add the missing generic instruction operand types 2014-10-31 14:32:34 +08:00
Nguyen Anh Quynh
b0464ef805 java/python/ocaml: update bindings after the last changes on operand types 2014-10-31 13:59:19 +08:00
Nguyen Anh Quynh
58086346bc java/python/ocaml: update after latest changes in x86.h 2014-10-18 06:16:26 +08:00
Nguyen Anh Quynh
4d2c362aa6 python: update after the latest change on PPC in the core 2014-10-17 21:51:13 +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
db8eaa3d0b bindings: remove MIPS_REG_PC constant following the change in the core 2014-10-10 21:13:30 +08:00
Nguyen Anh Quynh
b0cc71da59 bindings: update java/ocaml/python after the last change in Arm's core 2014-10-06 21:01:32 +08:00
danghvu
ebeec9d9c2 Cython: update installation and tests to v3 2014-09-29 11:55:01 -05: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
acbafc6d75 ocaml/python/java: fix some broken arm64 constants generated by const_generator.py 2014-09-25 12:46:17 +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
5691dd4637 mips: fixed & added new instructions. also updated Ocaml/Python/Java bindings 2014-09-24 18:03:47 +08: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