Commit graph

678 commits

Author SHA1 Message Date
Mike Frysinger
dcb1c10540 update capstone-engine.org URIs to https:// 2023-01-17 00:01:24 -05:00
Tomasz CEDRO
3a135d8210
Enable detection and build on all BSD systems. (#1753)
With FreeBSD, OpenBSD, NetBSD verified we can simply use "bsd".

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2021-05-24 01:35:51 +08:00
Tomasz CEDRO
1859a8633a
Fixes the (pip) Python Module build on FreeBSD. (#1750)
Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2021-05-11 23:32:09 +08:00
Matej Urbas
310e37330c
add support for aarch64 distributions (#1720) 2021-03-07 21:52:57 +08:00
Catena cyber
2bc4e7cae7
python: only use ascii character (#1704)
Otherwise python setup.py install from bindings/python
will fail with
SyntaxError: Non-ASCII character '\xe2' in file setup.py on line 223,
but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
2020-11-17 22:47:27 +08:00
chfl4gs
87d8aa36d1
PyPI workflow (#1645) 2020-11-15 08:48:32 +08:00
Nikita
0dc008920f
Allow to override PYTHON[23] in Makefiles (#1639)
$(PYTHON2) and/or $(PYTHON3) might differ from python and/or python3,
accordingly. Allow to override these variables by user choice.
2020-05-30 10:51:02 +08:00
Disconnect3d
1b5014515d
Add __repr__ for capstone.CsInsn (#1625)
* Add __repr__ for capstone.CsInsn

Currently, a `print(instruction)` displays a not very useful string like `<capstone.CsInsn object at 0x7f3759d88128>`.

This PR enhances adds a `__repr__` magic method to the `capstone.CsInsn` class so it displays as follows:
```
<cs.CsInsn: address=0x5555555545fa, size=1, mnemonic=push, op_str=rbp>
```

* Update __init__.py
2020-05-05 01:53:17 +08:00
Nguyen Anh Quynh
aed212b618 python: classifier Python3 for setup.py 2020-01-26 13:28:25 +08:00
ChrisDenton
c8716f516a Update __init__.py (#1453)
Pass bytearrays by reference instead of copying to bytes.
2019-04-03 11:40:36 +08:00
Sebastian Macke
9baa0751ca MOS65XX: Fix instruction length for indirect addressing modes (#1402)
Signed-off-by: Sebastian Macke <sebastian@macke.de>
2019-02-28 06:12:52 +08:00
david942j
0b37390f49 Fix typos of MOS65XX (#1390)
* Fix typos

* make test_mos65xx.py and test_mos65xx.c have same output format

* mox65xx -> mos65xx
2019-02-18 19:52:51 +08:00
Семён Марьясин
58e3c8bc72 Fix skipdata struct being destroyed (#1385) 2019-02-17 01:29:53 +08:00
Invincible
6782c48166 For the benefit of mankind. (#1386)
For the peace and tranquility of the earth.
2019-02-17 01:28:01 +08:00
Nguyen Anh Quynh
6808a8e38c Python: version = 5.0.0 2019-01-30 01:00:18 +08:00
Nguyen Anh Quynh
b8a2ce1bec v4.1.0: set extra version = 0 2019-01-22 15:28:55 +08:00
Nguyen Anh Quynh
93f6257e8b MOS65XX: fix missing prototype for ‘MOS65XX_global_init' 2019-01-22 15:23:22 +08:00
Erik Hemming
5fdc7de0d9 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
cc2965bada 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
a8559cfb78 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
f52532a002 python: bump version to 4.0.1 2019-01-15 21:34:06 +08:00
Benno Fünfstück
08272a10fe bindings/python: fix install error due to old libname (#1338) 2019-01-11 00:13:02 +08:00
Benno Fünfstück
c20f9f0995 bindings/python: fix install error due to old libname (#1338) 2019-01-11 00:12:24 +08:00
Benno Fünfstück
6800af85c1 bindings/python: fix install error due to old libname (#1338) 2019-01-11 00:10:25 +08:00
Nguyen Anh Quynh
d1adb923cc python: temporarily comment out skipdata setup, which is still broken on MacOS. #1316 2019-01-02 10:12:29 +08:00
Nguyen Anh Quynh
88cf4895e1 python: temporarily comment out skipdata setup, which is still broken on MacOS. #1316 2019-01-02 10:12:14 +08:00
Nguyen Anh Quynh
7ede48cd90 python: temporarily comment out skipdata setup, which is still broken on MacOS. #1316 2019-01-02 10:11:48 +08:00
Nguyen Anh Quynh
90b90f9491 Merge branch 'master' into next 2019-01-02 10:01:28 +08:00
Nguyen Anh Quynh
d8b1e8b44b Merge branch 'master' into v4.1 2019-01-02 10:01:03 +08:00
Nguyen Anh Quynh
472bd43fcf python: rename getter/setter skipdata_cb to skipdata_callback. Hello 2019 2019-01-01 00:22:45 +08:00
Nguyen Anh Quynh
a593f8d028 python: attempt to fix #1320 2018-12-31 15:51:50 +08:00
Семён Марьясин
6c54814d25 Fix skipdata setup (#1320)
* Fix skipdata_setup for when _cb is None

ctypes prototype does not accept None value,
so if we want to get a NULL function pointer
then we should either call it with no arguments
or pass zero as an argument.

Fixes #1316

* Do store and return skipdata_setup data

* Add convenience wrappers for skipdata_setup

* Uncomment skipdata_setup tests

* Add alternate usage variants to test_skipdata.py

* document getter
2018-12-31 15:42:44 +08:00
mephi42
d9b8079aba Update SystemZ to LLVM commit 5ad902a6 (#1306) 2018-12-16 21:48:51 +08:00
Nguyen Anh Quynh
5c634289b4 bump version to 4.1 2018-12-16 20:18:20 +08:00
Sebastian Macke
8663d75c56 MOS65XX: Add binding for python
Signed-off-by: Sebastian Macke <sebastian@macke.de>
2018-12-06 22:53:43 +01:00
Hugo
fbeffa489c Add python_requires and update Trove classifiers (#1251) 2018-10-02 17:45:45 +08:00
Nguyen Anh Quynh
2b4aec9c76 bindings: make bindings/const_generator.py compatible with recent reformat of C headers 2018-10-01 20:29:39 +08:00
Nguyen Anh Quynh
a732cb0ca1 bindings: update PPC constants 2018-09-17 21:01:01 +08:00
xambroz
5c168e515d 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
afffa5d741 merge next to master 2018-07-20 12:36:50 +08:00
Nguyen Anh Quynh
49950e4672 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
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
Stephen Eckels
dce7da98f8 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
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
c956cc0631 Better error reporting for python binding (#1189) 2018-06-25 19:48:02 +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
718bad8b5b Python: pump number of Mips operands to 10. see #1183 2018-06-19 09:35:37 +08:00
Nguyen Anh Quynh
519d526641 x86: support new instructions endbr64 & endbr32 2018-06-01 22:57:53 +08:00
Nguyen Anh Quynh
863ec0aba8 EVM: add missing files 2018-03-31 17:32:22 +08:00