Commit Graph

5175 Commits

Author SHA1 Message Date
Giovanni
e9b9b649cd
Fix jumps and branches on a non-zero PC (#2479)
Some checks failed
Run Test / ${{ matrix.config.name }} (map[arch:x64 build-system:cmake diet-build:OFF enable-asan:OFF name:ubuntu-22.04 x64 cmake os:ubuntu-22.04]) (push) Failing after 0s
Run Test / ${{ matrix.config.name }} (map[arch:x64 build-system:make diet-build:OFF enable-asan:OFF name:ubuntu-22.04 x64 make os:ubuntu-22.04]) (push) Failing after 0s
RELEASE BUILD - PyPI 📦 Distribution / Build wheels on ${{ matrix.os }} (ubuntu-latest) (push) Failing after 0s
RELEASE BUILD - PyPI 📦 Distribution / Make SDist (push) Failing after 0s
Run Test / ${{ matrix.config.name }} (map[arch:x64 build-system:cmake diet-build:OFF enable-asan:ON name:ubuntu-24.04 x64 ASAN os:ubuntu-24.04]) (push) Has been cancelled
Run Test / ${{ matrix.config.name }} (map[arch:x64 name:windows x64 MSVC 64bit os:windows-latest platform:windows python-arch:x64 python-version:3.9]) (push) Has been cancelled
Run clang-tidy / clang-tidy (push) Has been cancelled
RELEASE BUILD - PyPI 📦 Distribution / Build wheels on ${{ matrix.os }} (macos-latest) (push) Has been cancelled
RELEASE BUILD - PyPI 📦 Distribution / Build wheels on ${{ matrix.os }} (windows-latest) (push) Has been cancelled
Python Package CI / build (macOS-14, 3.12) (push) Has been cancelled
Python Package CI / build (macOS-14, 3.8) (push) Has been cancelled
Python Package CI / build (ubuntu-24.04, 3.12) (push) Has been cancelled
Python Package CI / build (ubuntu-24.04, 3.8) (push) Has been cancelled
Python Package CI / build (windows-2022, 3.12) (push) Has been cancelled
Python Package CI / build (windows-2022, 3.8) (push) Has been cancelled
RELEASE BUILD - PyPI 📦 Distribution / publish (push) Has been cancelled
Coverity Scan / latest (push) Has been cancelled
* Fix ASAN shift runtime check

* Fix jumps and branches addresses when applying a PC address

* Add tests for branches and jumps
2024-09-19 22:41:46 +08:00
david942j
10db5f4f8c
[next][SuperH] Fix missing setting detail->sh (#2466)
Some checks failed
Run Test / ${{ matrix.config.name }} (map[arch:x64 build-system:cmake diet-build:OFF enable-asan:ON name:ubuntu-24.04 x64 ASAN os:ubuntu-24.04]) (push) Waiting to run
Run Test / ${{ matrix.config.name }} (map[arch:x64 name:windows x64 MSVC 64bit os:windows-latest platform:windows python-arch:x64 python-version:3.9]) (push) Waiting to run
Run clang-tidy / clang-tidy (push) Waiting to run
RELEASE BUILD - PyPI 📦 Distribution / Build wheels on ${{ matrix.os }} (macos-latest) (push) Waiting to run
RELEASE BUILD - PyPI 📦 Distribution / Build wheels on ${{ matrix.os }} (windows-latest) (push) Waiting to run
RELEASE BUILD - PyPI 📦 Distribution / publish (push) Blocked by required conditions
Python Package CI / build (macOS-14, 3.12) (push) Waiting to run
Python Package CI / build (macOS-14, 3.8) (push) Waiting to run
Python Package CI / build (ubuntu-24.04, 3.12) (push) Waiting to run
Python Package CI / build (ubuntu-24.04, 3.8) (push) Waiting to run
Python Package CI / build (windows-2022, 3.12) (push) Waiting to run
Python Package CI / build (windows-2022, 3.8) (push) Waiting to run
Run Test / ${{ matrix.config.name }} (map[arch:x64 build-system:cmake diet-build:OFF enable-asan:OFF name:ubuntu-22.04 x64 cmake os:ubuntu-22.04]) (push) Failing after 0s
Run Test / ${{ matrix.config.name }} (map[arch:x64 build-system:make diet-build:OFF enable-asan:OFF name:ubuntu-22.04 x64 make os:ubuntu-22.04]) (push) Failing after 0s
RELEASE BUILD - PyPI 📦 Distribution / Build wheels on ${{ matrix.os }} (ubuntu-latest) (push) Failing after 0s
RELEASE BUILD - PyPI 📦 Distribution / Make SDist (push) Failing after 0s
* [next][SuperH] Fix missing setting detail->sh

detail->sh is never set. Which makes the detailed output related to operands is always missing.

Signed-off-by: david942j <david942j@gmail.com>

* Fix merge commit

---------

Signed-off-by: david942j <david942j@gmail.com>
2024-09-19 19:03:29 +08:00
Lucas Azevedo
67d975662e
[next] SH: Use bitwise OR with mask for sign extension (#2389)
Some checks failed
Run Test / ${{ matrix.config.name }} (map[arch:x64 build-system:cmake diet-build:OFF enable-asan:ON name:ubuntu-24.04 x64 ASAN os:ubuntu-24.04]) (push) Waiting to run
Run Test / ${{ matrix.config.name }} (map[arch:x64 name:windows x64 MSVC 64bit os:windows-latest platform:windows python-arch:x64 python-version:3.9]) (push) Waiting to run
Run clang-tidy / clang-tidy (push) Waiting to run
RELEASE BUILD - PyPI 📦 Distribution / Build wheels on ${{ matrix.os }} (macos-latest) (push) Waiting to run
RELEASE BUILD - PyPI 📦 Distribution / Build wheels on ${{ matrix.os }} (windows-latest) (push) Waiting to run
RELEASE BUILD - PyPI 📦 Distribution / publish (push) Blocked by required conditions
Python Package CI / build (macOS-14, 3.12) (push) Waiting to run
Python Package CI / build (macOS-14, 3.8) (push) Waiting to run
Python Package CI / build (ubuntu-24.04, 3.12) (push) Waiting to run
Python Package CI / build (ubuntu-24.04, 3.8) (push) Waiting to run
Python Package CI / build (windows-2022, 3.12) (push) Waiting to run
Python Package CI / build (windows-2022, 3.8) (push) Waiting to run
Run Test / ${{ matrix.config.name }} (map[arch:x64 build-system:cmake diet-build:OFF enable-asan:OFF name:ubuntu-22.04 x64 cmake os:ubuntu-22.04]) (push) Failing after 1s
Run Test / ${{ matrix.config.name }} (map[arch:x64 build-system:make diet-build:OFF enable-asan:OFF name:ubuntu-22.04 x64 make os:ubuntu-22.04]) (push) Failing after 0s
RELEASE BUILD - PyPI 📦 Distribution / Build wheels on ${{ matrix.os }} (ubuntu-latest) (push) Failing after 1s
RELEASE BUILD - PyPI 📦 Distribution / Make SDist (push) Failing after 1s
Auto-Sync / check (push) Has been cancelled
* Use bitwise OR with mask for sign extension

Sign extend using bitwise OR with mask, instead of unary minus.
Fixes error when building for UWP with Security Development Lifecycle (SDL).
See https://learn.microsoft.com/en-us/cpp/build/reference/sdl-enable-additional-security-checks?view=msvc-170

* Remove unused store

Remove unused store caught by clang-tidy.

* Suppress clang-tidy false positive

Ignore an unitialized va_list false positive emitted by clang-tidy

---------

Co-authored-by: Wu ChenXu <kabeor00@gmail.com>
2024-09-19 01:09:54 +08:00
Rot127
3a2cd3c331
Coverity defects (#2469)
* Fix CID 508418 - Uninitialized struct

* Fix CID 509089 - Fix OOB read and write

* Fix CID 509088 - OOB.

Also adds tests and to ensure no OOB access.

* Fix CID 509085 - Resource leak.

* Fix CID 508414 and companions - Using undefined values.

* Fix CID 508405 - Use of uninitialized value

* Remove unnecessary and badly implemented dev fuzz code.

* Fix CID 508396 - Uninitialzied variable.

* Fix CID 508393, 508365 -- OOB read.

* Fix CID 432207 - OVerlapping memory access.

* Remove unused functions

* Fix CID 432170 - Overlapping memory access.

* Fix CID 166022 - Check for negative index

* Let strncat not depend n src operand.

* Fix 509083 and 509084 - NULL dereference

* Remove duplicated code.

* Initialize sysop

* Fix resource leak

* Remove unreachable code.

* Remove duplicate code.

* Add assert to check return value of cmoack

* Fixed: d should be a signed value, since it is checked against < 0

* Add missing break.

* Add NULL check

* Fix signs of binary search comparisons.

* Add explicit cast of or result

* Fix correct scope of case.

* Handle invalid integer type.

* Return UINT_MAX instead of implicitly casted -1

* Remove dead code

* Fix type of im

* Fix type of d

* Remove duplicated code.

* Add returns after CS_ASSERTS

* Check for len == 0 case.

* Ensure shift operates on uint64

* Replace strcpy with strncpy.

* Handle edge cases for 32bit rotate

* Fix some out of enum warnings

* Replace a strcpy with strncpy.

* Fix increment of address

* Skip some linting

* Fix: set instruction id

* Remove unused enum

* Replace the last usages of strcpy with SStream functions.

* Increase number of allowed AArch64 operands.

* Check safety of incrementing t the next operand.

* Fix naming of operand

* Update python constants

* Fix option setup of CS_OPT_DETAIL_REAL

* Document DETAIL_REAL has to be used with CS_OPT_ON.

* Run Coverity scan every Monday.

* Remove dead code

* Fix OOB read

* Rename macro to reflect it is only used with sstreams

* Fix rebase issues
2024-09-18 21:19:42 +08:00
Rot127
af1ed2fb3d
SystemZ Auto-Sync refactor (#2462)
Some checks failed
Run Test / ${{ matrix.config.name }} (map[arch:x64 build-system:cmake diet-build:OFF enable-asan:OFF name:ubuntu-22.04 x64 cmake os:ubuntu-22.04]) (push) Failing after 0s
Run Test / ${{ matrix.config.name }} (map[arch:x64 build-system:make diet-build:OFF enable-asan:OFF name:ubuntu-22.04 x64 make os:ubuntu-22.04]) (push) Failing after 0s
RELEASE BUILD - PyPI 📦 Distribution / Build wheels on ${{ matrix.os }} (ubuntu-latest) (push) Failing after 0s
RELEASE BUILD - PyPI 📦 Distribution / Make SDist (push) Failing after 0s
Run Test / ${{ matrix.config.name }} (map[arch:x64 build-system:cmake diet-build:OFF enable-asan:ON name:ubuntu-24.04 x64 ASAN os:ubuntu-24.04]) (push) Has been cancelled
Run Test / ${{ matrix.config.name }} (map[arch:x64 name:windows x64 MSVC 64bit os:windows-latest platform:windows python-arch:x64 python-version:3.9]) (push) Has been cancelled
Auto-Sync / check (push) Has been cancelled
Run clang-tidy / clang-tidy (push) Has been cancelled
RELEASE BUILD - PyPI 📦 Distribution / Build wheels on ${{ matrix.os }} (macos-latest) (push) Has been cancelled
RELEASE BUILD - PyPI 📦 Distribution / Build wheels on ${{ matrix.os }} (windows-latest) (push) Has been cancelled
Python Package CI / build (macOS-14, 3.12) (push) Has been cancelled
Python Package CI / build (macOS-14, 3.8) (push) Has been cancelled
Python Package CI / build (ubuntu-24.04, 3.12) (push) Has been cancelled
Python Package CI / build (ubuntu-24.04, 3.8) (push) Has been cancelled
Python Package CI / build (windows-2022, 3.12) (push) Has been cancelled
Python Package CI / build (windows-2022, 3.8) (push) Has been cancelled
RELEASE BUILD - PyPI 📦 Distribution / publish (push) Has been cancelled
2024-09-14 16:57:54 +08:00
Giovanni
6a7fef60ea
Auto-Sync Mips (#2410) 2024-09-07 22:30:47 +08:00
Giovanni
e6da49d549
Some small fixes for capstone-next (#2460) 2024-09-03 09:22:47 +08:00
Rot127
191db14531
Modern Testing (#2456) 2024-08-31 21:33:38 +08:00
Rot127
df72286749
Use any-glob for labeler. Otherwise it is not checked recursively. (#2450) 2024-08-19 16:33:37 +08:00
Rot127
42d3acf5ec
[next] Wheel build fixes: manylinux1, trigger upload on release, Linux AArch64... (#2444)
* Add AArch64 linux build again.

* Enable package build also for PRs and pushes.

* Fix: don't append python version to injected platform name.

* Add musllinux build to wheel checking script

* Trigger wheel upload only on published full-releases.

* Remove duplicate workflow file

* Ensure all artifacts are moved to the same directory 'dist'

* Enable verbose twine upload.

* Add step to show downloaded artifacts for debugging.
2024-08-19 16:33:08 +08:00
Rot127
7149ec8dca
Update and add labels (#2446) 2024-08-19 10:52:41 +08:00
Mario Haustein
78eee139f4
Fix 'make check' for python tests (#2439) 2024-08-19 10:50:29 +08:00
Duncan Ogilvie
f38d56b692
Add back support for relocatable packages (#2431) 2024-08-17 23:54:12 +08:00
Rot127
5e6807bab9
[next] Updates and fixes to the Python wheel builder workflow (#2441) 2024-08-15 20:57:23 +08:00
Rot127
1f0087a7a2
Add Coverity workflow (#2437) 2024-08-13 12:25:50 +08:00
luozexuan
edbcf9e017
chore: fix some comments (#2432)
Signed-off-by: luozexuan <fetchcode@139.com>
2024-08-12 12:01:22 +08:00
Rot127
d713dda315
Fix CI fuzz job yml syntax (#2429) 2024-08-08 18:27:19 +08:00
david942j
4c629d9be1
[next] Fix unintended zero set in Sparc printInst (#2421) 2024-08-04 18:46:43 +08:00
Rot127
3a0c96c689
Add release wheel build workflow for all Python versions (#2414) 2024-08-01 12:02:22 +08:00
david942j
c666fbdb74
Fix typo in AArch64 Python binding (#2413) 2024-08-01 11:58:47 +08:00
Sahil Siddiq
4f964a264e
Fix incorrect operand in disassembled instruction (#2401) (#2403)
Disassembling the "slwi", "srwi" and "rldicr" PowerPC instructions
with the "-d" option displays the wrong operands in the detailed
view. This is due to an incorrect break condition in the
"PPC_insert_detail_op_imm_at" function.

This patch fixes #2401.
2024-07-24 14:19:39 +08:00
Rot127
5ba4ca4ba6
Merge pull request #2396 from twizmwazin/python/remove-deprecated-packaging
Python/remove deprecated packaging
2024-07-19 14:04:16 +00:00
Kevin Phoenix
8ddb2b971f Update setup.py to reflect minimum python 3.8 2024-07-16 12:26:15 -07:00
Richard Henderson
de5120ed0c
Constify three ARM and AArch64 variables (#2399)
* arm: Constify arm_flag_regs

* aarch64: Constify aarch64_flag_regs and aarch64_flag_sys_regs
2024-07-16 17:20:10 +08:00
Kevin Phoenix
f9949e567c Remove cython bindings 2024-07-15 12:16:13 -07:00
Kevin Phoenix
2b3383d0f6 Only test python 3.8 and 3.12 2024-07-15 12:14:03 -07:00
Kevin Phoenix
7891cbe5b5 Install importlib_resources with cython bindings 2024-07-15 12:14:03 -07:00
Kevin Phoenix
fd91c20c64 Remove bindings/cython/capstone.egg-info 2024-07-15 12:14:03 -07:00
Kevin Phoenix
adfcba3c92 Undelete ccapstone.pyx 2024-07-15 12:14:03 -07:00
Kevin Phoenix
46be9c02a3 Fix test file path 2024-07-15 12:14:03 -07:00
Kevin Phoenix
6f96163adc Seperate cython bindings into seperate bindings package 2024-07-15 12:14:03 -07:00
Kevin Phoenix
add1659f32 Move python tests to test directory 2024-07-15 12:14:03 -07:00
Kevin Phoenix
bb1084523a Remove python tests from main CI 2024-07-15 12:14:03 -07:00
Kevin Phoenix
dfdd331b8d Use ilammy/msvc-dev-cmd in python tests 2024-07-15 12:14:03 -07:00
Kevin Phoenix
0cca459683 Drop python 3.7 2024-07-15 12:14:03 -07:00
Kevin Phoenix
9858c06111 Seperate windows install to activate vcvars64 2024-07-15 12:14:03 -07:00
Kevin Phoenix
60907d2288 Use older ubuntu to support python 3.7 2024-07-15 12:14:03 -07:00
Kevin Phoenix
2bd76ee987 Fix test_all.py path 2024-07-15 12:14:03 -07:00
Kevin Phoenix
63284d4643 Add simpler python CI 2024-07-15 12:14:03 -07:00
Kevin Phoenix
19ce4baaf5 Disable zip_safe 2024-07-15 12:14:03 -07:00
Kevin Phoenix
16d56703a3 Cast resources path to str 2024-07-15 12:14:03 -07:00
Kevin Phoenix
9237f6d84d Install importlib_resources in the CI 2024-07-15 12:14:03 -07:00
Kevin Phoenix
95f82446c1 Remove PurePath() call breaking .join() 2024-07-15 12:14:03 -07:00
Kevin Phoenix
9d7bd099ac Add tests for python 3.7, 3.8, 3.10 2024-07-15 12:14:03 -07:00
Kevin Phoenix
f23d862b03 Use importlib_resources on python<3.9 2024-07-15 12:14:03 -07:00
Pyrox
0acbec877a Fix cython bindings 2024-07-15 12:14:03 -07:00
Pyrox
c427b3a799 Fix fuzz tests in CI 2024-07-15 12:14:03 -07:00
Pyrox
402df98f80 Add setuptools to python bindings tests
Needed to fix a setuptools error on python 3.9
2024-07-15 12:14:03 -07:00
Pyrox
d9ead27248 Remove python 3.6 from CI Tests
Since support is removed per maintainer request, this should be removed
from the test suite as well.
2024-07-15 12:14:03 -07:00
Pyrox
b555844526 Remove distutils
Removes distutils from the setup.py script for the python bindings, as
it is removed in Python 3.12 onwards.
2024-07-15 12:14:03 -07:00