900 Commits

Author SHA1 Message Date
kabeor
eed417a810 fix python binding 2023-03-07 13:17:45 +08:00
kabeor
118f08fdf7 fix python binding build 2023-03-07 12:03:47 +08:00
Josh Bundt (tr0gd0r)
df80b42799 Update __init__.py
Fix missing return value `post_index` - same as #1944
2023-03-04 18:13:37 -05:00
Kevin Sun
b2fff05ce3 Update Arm64.java 2023-02-20 15:06:41 +08:00
Kevin Sun
61d5ebe007 fix missing access field in arm64 java binding 2023-02-20 15:01:33 +08:00
HyperSine
bbab923555 arm64: fix missing post_index
Signed-off-by: HyperSine <hypersine.git@outlook.com>
2022-12-19 12:58:09 +08:00
ζeh Matt
648d4a2b55 Add post_index to python bindings 2022-11-22 22:25:49 +02:00
Finn Wilkinson
55f3d2eb4f Updated Arm64 python bindings after Armv9.2-a support. 2022-11-07 12:27:34 +00:00
John Ott
9f727d495f Remove outdated ctypes requirement
The library ctypes has shipped with the python standard library since
Python 2.5, however this was still added via the `requires` keyword in
setuptools.setup. This results in a spurious requirement being created
in the .whl METADATA file, causing warnings when packaged via tools like
pex:

```
$ python3 -m pex capstone -o capstone.pex
/Users/ott/.venv/lib/python3.9/site-packages/pex/dist_metadata.py:397: PEXWarning: Ignoring 1 `Requires` field in /Users/ott/.pex/installed_wheels/2a4c7a0d4c87aceed3134ae20997a764af1811fee8e151cf5da90e0462822893/capstone-4.0.2-py3-none-macosx_12_arm64.whl metadata:
1.) Requires: ctypes

You may have issues using the 'capstone' distribution as a result.
More information on this workaround can be found here:
  https://github.com/pantsbuild/pex/issues/1201#issuecomment-791715585
```

Since this requirement is outdated, it can just be removed.
2022-08-24 11:29:48 -07:00
Richard Patel
2f1c4524eb Add Python test for CS_MODE_PS 2022-07-23 10:49:13 +02:00
Richard Patel
ef560a1afa Sync eBPF and PowerPC bindings 2022-07-23 10:46:03 +02:00
Richard Patel
8507533bab Update bindings (PPC PS support) 2022-07-23 08:50:47 +02:00
Adam Seitz
d729d88e87 Combine aarch64 sys operand enums 2022-03-18 14:15:46 -04:00
David Zimmer
b81c64999b vb6 bindings: clarify license as Apache v2.0 (#1850) 2022-03-03 17:39:13 +08:00
kabeor
2b05b8ef94 replace missing option CMAKE_BUILD_SHARED for python setup.py 2022-02-28 00:01:09 +08:00
kabeor
d86c150854 fix for python publish build 2022-02-27 23:31:51 +08:00
Duncan Ogilvie
f4d86a3034 Modernize CMake and switch to CMake 3.15 2022-02-25 20:39:30 +01:00
David Pfeiffer
13cc08b6c9 Add encoding field to cs_x86 in python bindings for consistency (#1834) 2022-01-28 10:21:39 +08:00
kabeor
9057f42a89 add ci_test steps&&Fixed suite test for python3 2021-11-23 12:27:39 +08:00
jesko
8bd5dc1a37 adds test and bugfix for memoryview support 2021-11-13 11:32:18 +01:00
jesko
28dbf409cf invoke from_buffer only for writeable interfaces 2021-11-13 00:16:19 +01:00
jesko
3f75a02950 support disassembling bytes from memoryview 2021-07-05 22:40:07 +02:00
Mark Jansen
2b72d7c2bc Always return the same type from regs_read (#1736) 2021-03-20 07:32:23 +08:00
Nguyen Anh Quynh
ba932de97a bindings: update Arm64 register enum 2020-11-25 16:18:50 +08:00
Jesús A. Álvarez
4dd716c37e Swift binding (#1707)
* update const generator for swift

* groups constants by enum
* use pascal case for enum names
* use camel case for enum values
* values are always literals
* add extra options for some enums
* use different types for some enums
* generate option sets instead of enums for some types
* renaming constants according to regex pattern

* don't output documentation comments for non-exported defines

* add Swift binding to readme
2020-11-25 14:41:10 +08:00
Tobias Faller
20e3ebd372 Added export for Python CS_MODE_RISCVC binding (#1691) 2020-09-18 22:34:35 +08:00
Nikita
db20180560 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:54 +08:00
Disconnect3d
95f25c5325 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:54:28 +08:00
Nguyen Anh Quynh
cf59ad7de7 Merge branch 'next' of github.com:aquynh/capstone into next 2020-03-23 09:15:21 +08:00
Eric Schulte
d4670aa138 Add Common Lisp bindings (#1605) 2020-03-23 09:15:00 +08:00
david942j
1c85fcd0a9 Add Ruby binding by david942j (#1599) 2020-03-10 20:17:04 +08:00
Nguyen Anh Quynh
4e13196da8 python: classifier Python3 for setup.py 2020-01-26 13:26:58 +08:00
naq
4294ca7570 bindings: update after the last header fix 2019-10-08 10:42:47 +08:00
Tom Kelly
2dc088534f Fix for x86_op record for ocaml bindings (#1539) 2019-09-26 16:46:21 +08:00
Scott Knight
f871781c53 Update Go binding information (#1532) 2019-08-28 15:30:09 +08:00
mquigley
85dffaeb09 #1246 - Fix Java bindings to use pointers instead of longs (#1516)
Previously, a long was used instead of a pointer in the JNA binding library.
This would work until the allocated pointers exceeded 32-bits. On modern JVMs,
allocations may produce pointers in excess of 32-bits which would result in
invalid memory access errors.

This also updates the binding version to 5.0.
2019-07-11 17:35:27 +08:00
ksherlock
41e5f629ce updated 6502 support. (#1498)
* updated 6502 support. some improvements to the base 6502 support but also adds support for 65c02, w65c02, and 65816.

* add CS_OPT_SYNTAX_MOTOROLA.

This will use "$" as a hex prefix instead of "0x"

* remove excess blank lines
2019-06-03 23:20:51 +08:00
Nguyen Anh Quynh
1cf177d32e python: add PPC modes CS_MODE_SPE & CS_MODE_BOOKE 2019-05-08 14:03:10 +08:00
Nguyen Anh Quynh
b543c345ca ppc: sync with llvm 7.0.1 2019-04-30 13:50:42 +08:00
Nguyen Anh Quynh
4754471262 merge next-arm64 to next 2019-04-10 17:46:07 +08:00
Nguyen Anh Quynh
f407e94249 arm64: sync with LLVM 7.0.1 2019-04-10 14:17:08 +08:00
ChrisDenton
df261a901e Update __init__.py (#1453)
Pass bytearrays by reference instead of copying to bytes.
2019-04-03 11:41:32 +08:00
Wolfgang Schwotzer
23b3fba966 M680X: Use same output style as other archs (#1439)
- Lowercase hex numbers.
- Use comma + space between instruction parameters.
2019-03-22 11:07:15 +08:00
Nguyen Anh Quynh
af891f125a bindings: update ARM const after the last ARM update 2019-03-16 15:22:45 +08:00
z
b8fcf27b22 RISCV support ISRV32/ISRV64 (#1401)
* Added RISCV dir to contain the RISCV architecture engine code. Adding the TableGen files generated from llvm-tblgen. Add Disassembler.h

* Started working on RISCVDisassembler.c - RISCV_init(), RISCVDisassembler_getInstruction, and RISCV_getInstruction

* Added all functions to RISCVDisassembler.c and needed modifications to RISCVGenDisassemblerTables.inc. Add and modified RISCVGenSubtargetInfo.inc. Start creation of RISCVInstPrinter.h

* Finished RISCVGenAsmWriter.inc. Finished RISCVGenRegisterInfo.inc. Minor fixes to RISCVDisassembler.c. Working on RISCVInstPrinter

* Finished RISCVInstPrinter, RISCVMapping, RISCVBaseInfo, RISCVGenInstrInfo.inc, RISCVModule.c. Working on riscv.h

* Backport it from: 0db412ce3b

* All RISCV files added. Compiled correctly and initial test for ADD, ADDI, AND works properly.

* Add refactored cs.c for RISCV

* Testing all I instructions in test_riscv.c

* Modify the orignal backport for RISCVGenRegisterInfo.inc, capstone.h and test_iter to work w/ the current code strcuture

* Fix issue with RISCVGenRegisterInfo.inc - RISCVRegDesc[] (Excess elements in struct initializer). Added RISCV tests to test_iter.c

* fixed bug related to incorrect initialization of memory after malloc

* fix compile bug

* Fix compile errors.

* move riscv.h to include/capstone

* fix indentation issues

* fix coding style issues

* Fix indentation issues

* fix coding style

* Move variable declaration to the top of the block

* Fix coding indentation

* Move some stuff into RISCVMappingInsn.inc

* Fix code sytle

* remove cs_mode support for RISCV

* update asmwriter-inc to LLVM upstream

* update the .inc files to riscv upstream

* update riscv disassembler function for suport 16bit instructions

* update printer & tablegen inc files which have fixed arguments mismatch

* update headers and mapping source

* add riscv architecture specific test code

* fix all RISCV tons of compiler errors

* pass final tests

* add riscv tablegen patchs

* merge with upstream/next

* fix cstool missing riscv file

* fix root Makefile

* add new TableGen patchs for riscv

* fix cmakefile.txt of missing one riscv file

* fix declaration conflict

* fix incompatible declaration type

* change riscvc from arch to mode

* fix test_riscv warnning

* fix code style and add riscv part of test_basic

* add RISCV64 mode

* add suite for riscv

* crack fuzz test

* fix getfeaturebits test add riscvc

* fix test missing const qualifier warnning

* fix testcase type mismatch

* fix return value missing

* change getfeaturebits test

* add test cs files

* using a winder type contain the decode string

* fix a copy typo

* remove useless mode for riscv

* change cs file blank type

* add repo for update_riscv & fix cstool missing riscv mode

* fix typo

* add riscv for cstool useage

* add TableGen patch for riscv asmwriter

* clean ctags file

* remove black comment line

* fix fuzz related something

* fix missing RISCV string of fuzz

* update readme, etc..

* add riscv *.s.cs file

* add riscv *.s.cs file & clear ctags

* clear useless array declarations at capstone_test

* update to 5e4069f

* update readme change name more formal

* change position of riscv after bpf and modify copyright more uniform

* clear useless ctags file

* change blank with tab in riscv.h

* add riscv python bindings

* add riscv in __init__.py

* fix riscv define value for python binding

* fix test_riscv.py typo

* add missing riscvc in __init__.py of python bindings

* fix alias-insn printer bug, remove useless newline

* change inst print delimter from tab to bankspace for travis

* add riscv tablegen patch

* fix inst output more consistency

* add TableGen patch which fix inst output formal

* crack the effective address output for detail and change register print function

* fix not detail crash bug

* change item declaration position at cs_riscv

* update riscv.py

* change function name more meaningfull

* update python binding makefile

* fix register enum sequence according to riscvgenreginfo.inc

* test function name

* add enum s0/fp in riscv.h & update riscv_const.py

* add register name enum
2019-03-09 08:41:12 +08:00
Nguyen Anh Quynh
ee237e128a bingdings: update X86 consts 2019-03-02 14:59:16 +08:00
Nguyen Anh Quynh
b7ed33a1a0 Merge branch 'next' of github.com:aquynh/capstone into next 2019-03-01 01:12:50 +08:00
Sebastian Macke
6ba9f001b9 MOS65XX: Fix instruction length for indirect addressing modes (#1402)
Signed-off-by: Sebastian Macke <sebastian@macke.de>
2019-02-28 07:39:59 +08:00
Nguyen Anh Quynh
2defd57568 bindings: update X86 consts 2019-02-27 23:04:14 +08:00
david942j
9b3ead3ab8 fix conflicts 2019-02-18 20:04:30 +08:00