Commit Graph

35 Commits

Author SHA1 Message Date
Rot127
2cfca35e2f
Add CC and VAS compatibility macros (#2525)
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) Has been cancelled
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 build-system:make diet-build:OFF enable-asan:OFF name:ubuntu-22.04 x64 make os:ubuntu-22.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 }} (ubuntu-latest) (push) Has been cancelled
RELEASE BUILD - PyPI 📦 Distribution / Build wheels on ${{ matrix.os }} (windows-latest) (push) Has been cancelled
RELEASE BUILD - PyPI 📦 Distribution / Make SDist (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
2024-10-25 21:38:33 +08:00
billow
21f7bc85f9
Xtensa Support (#2380)
* Fix leaks

* Remove unnecessary new lines

* Add checks for actual buffer length before attempting reading it.

* Xtensa: add xtensa support

* Xtensa fixes

- fix MCExpr
- fix Xtensa_add_cs_detail
- add `add_cs_detail`
- add `MCExpr *MCOperand_getExpr(const MCOperand *MC)` `void printExpr(const MCExpr *E, SStream *O)`

autosync fix

- fix StreamOperation.py
- replace `report_fatal_error` with `CS_ASSERT`
- fix patch StreamOperation.py
- replace `assert` with `CS_ASSERT`
- fix AddCSDetail.py
- fix QualifiedIdentifier

* Xtensa fix

* Xtensa fix .py

* add Xtensa to the fuzzer

* Xtensa `LITBASE`: add a basic implementation

* Xtensa `LITBASE`: add a integration test

* Xtensa: fix cs_v6_release_guide.md

* Xtensa: fix `XTENSA_OP_GROUP_MEMOPERAND`

* Xtensa: fix

* Xtensa: fix Targets.py

* Use isUint and isInt all over Xtensa

* Add documentation about LITBASE functionality

* Fix typo

* Replace hard with Capstone assert

* Xtensa: fix arch_config.json

* Xtensa: fix

---------

Co-authored-by: Rot127 <unisono@quyllur.org>
2024-09-30 11:35:51 +08:00
Rot127
823bfd53e3
AArch64 issues (#2473)
* Fix Pn was printed as register, not predicate.

* Fix: is_alias must be an int to allow for -1 as false.

* Fix, shift immediate was casted to incorrect width.

* Store theexact float also in fp field for convenience.

* Fix: MRS has no implicit write of NCVZ

* Fix signs of Imm8 shifted operands.

* Fix another MRS test

* Fix: Src operand of CASAL had write flag set.

* Fix sysop access in Python data structures.
2024-09-24 12:32:10 +08:00
Rot127
5430745e96
ARM fixes (#2477)
* Fix #2381

* Fix #2382

* Fix post-index correction only for pop with single register

* Fix missing memory index register scale

* Remove faulty and duplicated lshift field.

* Add shift information to shift alias instructions and add several tests.

* Fix scale tests

---------

Co-authored-by: Wu ChenXu <kabeor00@gmail.com>
2024-09-23 11:30:33 +08:00
Rot127
40dffb2668
Documentation updates (#2476)
* Remove Windows msvc project files and move build instructions to single BUILDING.md file.

* Move HACK.txt to Contributing and update it.

* Add refactoring guide.

* Add known bugs

* Remove compatibility headers.

* Fix smaller issues.

* Remove 'possible revert' column. People always can do manual changes.

* Move instruction alias description to the top

* Add table to general breaking changes.

* Update general release guide with the newest information.

* Highlight NanoMips and be more precise in writing.

* Add note about archs without alias.

* Add sentence about what is planned.

* Small corrections for Windows build instructions and debug macros.

* Fix rebase issues.

* Bring back make.sh for the CI
2024-09-23 11:26:56 +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
Rot127
0a67596f70
Add test with ASAN enabled. (#2313)
* Add test with ASAN enabled.

* Fix leaks in cstool and cs.c

* Add work around so ASAN binaries don't DEADSIGNAL due to too many randomized address bits.

* Add ASAN build arguments to cstest

* Fix leaks in cstest

* Use cstest binary build by the main build.

* Add clonging step for cmocka when cstest is build

* Skip Python tests for ASAN

* Remove make build from CI

* Fix leaks in cstest.

- Rewrite split to remove leaks and improve runtime by 6%
- Add free()

* Fix cmocka external project to stable branch.

* Revert "Fix leaks in cstest."

This reverts commit bf8ee125b0c58f9c794eb081a69c80f8a71825cd.

* Fix memleaks in cstest

* Document adding of ASAN job to release guide

* Add CAPSTONE_BUILD_CSTEST to build docs

* Fix double free

* Add more detail tests to CI and fix them

* Initialize variables

* Fix typo

* Update cstest build docs

* Revert "Remove make build from CI"

This reverts commit 84f7360c6da6183cd41bec0fef3e1d0a2ee49ddf.

* Make cstest only run for cmake builds.

* Add cstest job for make build.

* Add CAPSTONE_DIET build test.

* Compile the compatibility header test with ASAN if enabled.

* Fix DIET build by excluding not used code.

* Missing "

* Build static library with ASAN and DIET if enabled.

* Revert "Add CAPSTONE_DIET build test."

This reverts commit 71e1469dee.
2024-06-10 10:01:00 +08:00
Rot127
03c41e1be4
Restructure auto-sync docs to have them more contained (#2355)
* Restructure auto-sync docs to have them more contained in suite/auto-sync

* Enhance Differ documentation

* Fix link and emphasize importance of ARCHITECTURE.md

* Add auto-syc intro.md document, based on @moste00 work

* Be consistent with Auto-Sync naming and use python3
2024-06-10 09:55:47 +08:00
Rot127
1a6921f5cc
AArch64 compatibility header (#2321) 2024-05-31 20:07:03 +08:00
Rot127
6c7b54817f
Add a clang-tidy checks and warnings (#2312) 2024-04-26 15:11:46 +08:00
Rot127
b4fde983de
[PPC] Expose instruction formats (#2276)
* Expose PPC formats in PPC details

* Add PPC format note in v6 release guide.

* Update python bindings
2024-02-23 13:20:46 +08:00
Rot127
0d0edad81d
Update docs wit ASUpdater.py script (#2217) 2024-01-07 22:07:46 +09:00
Rot127
1fdb4895cc
V6 release guide (#2124)
* Add a Capstone v6 release guide with a general explanation,
breaking changes and new feature descriptions.

* Add note about Rizin sponsorship

* Fix spelling and grammar mistakes.
2023-12-16 16:18:59 +08:00
Rot127
926cfebd6b Architecture updater (auto-sync) - Updating PPC (#2013) 2023-09-05 12:24:59 +08:00
Rot127
104f693c11 Architecture updater (auto-sync) - Updating ARM (#1949)
* Add auto-sync updater.

* Update Capstone core with auto-sync changes.

* Update ARM via auto-sync.

* Make changes to arch modules which are introduced by auto-sync.

* Update tests for ARM.

* Fix build warnings for make

* Remove meson.build

* Print shift amount in decimal

* Patch non LLVM register alias.

* Change type of immediate operand to unsiged (due to: #771)

* Replace all occurances of a register with its alias.

* Fix printing of signed imms

* Print rotate amount in decimal

* CHange imm type to int64_t to match LLVM imm type.

* Fix search for register names, by completing string first.

* Print ModImm operands always in decimal

* Use number format of previous capstone version.

* Correct implicit writes and update_flags according to SBit.

* Add missing test for RegImmShift

* Reverse incorrect comparision.

* Set shift information for move instructions.

* Set mem access for all memory operands

* Set subtracted flag if offset is negative.

* Add flag for post-index memory operands.

* Add detail op for BX_RET and MOVPCLR

* Use instruction post_index operand.

* Add VPOP and VPUSH as unique CS IDs.

* Add shifting info for MOVsr.

* Add TODOs.

* Add in LLVM hardcoded operands to detail.

* Move detail editing from InstPrinter to Mapping

* Formatting

* Add removed check.

* Add writeback register and constraints to RFEI instructions.

* Translate shift immediate

* Print negative immediates

* Remove duplicate invalid entry

* Add CS groups to instructions

* Fix write attriutes of stores.

* Add missing names of added instructions

* Fix LLVM bug

* Add more post_index flags

* http -> https

* Make generated functions static

* Remove tab prefix for alias instructions.

* Set ValidateMCOperand to NULL.

* Fix AddrMode3Operand operands

* Allow getting system and banked register name via API

* Add writeback to STC/LDC instructions.

* Fix (hopefully) last case where disp is negative and subtracted = true

* Remove accidentially introduced regressions
2023-07-19 17:56:27 +08:00
Wu ChenXu
67d43e98f7 Update README (#1534) 2019-08-30 23:39:52 +08:00
Nguyen Anh Quynh
ff350f42a7 add docs/capstone-logo.png 2018-12-31 16:29:00 +08:00
Satoshi Tanda
cb003974a4 fix typo, style
Signed-off-by: Satoshi Tanda <tanda.sat@gmail.com>
2016-09-28 07:33:14 -07:00
tandasat
b9882ee634 update docs/README 2016-05-26 19:30:37 -07:00
Nguyen Anh Quynh
a76c2ffa97 docs: add the link to mnemonic.html 2015-04-27 16:35:30 +08:00
Nguyen Anh Quynh
475b9622d5 docs: add link to op_access.html 2015-03-26 00:40:44 +08:00
Nguyen Anh Quynh
a91c1994ea docs: add a link to online doc of cs_disasm_iter() 2014-10-13 07:27:16 +08:00
Nguyen Anh Quynh
ee98e408ca move slides to docs/ 2014-08-15 14:08:20 +08:00
Nguyen Anh Quynh
aa791a2f48 update docs/README for some sample kernel applications 2014-07-11 11:18:15 +08:00
Nguyen Anh Quynh
e1245135db update docs to add link to SKIPDATA mode 2014-04-11 01:32:48 +08:00
Nguyen Anh Quynh
3c5ab99c80 docs: indentation 2014-03-27 16:05:38 +08:00
Nguyen Anh Quynh
1dce9c203a docs: add X86-reduce link 2014-03-27 11:45:28 +08:00
Nguyen Anh Quynh
48476dd33d docs: update README 2014-03-02 00:15:04 +08:00
Nguyen Anh Quynh
0fce8d7caa docs: add link to embedded doc 2014-03-01 23:32:23 +08:00
Nguyen Anh Quynh
cc0cb49581 docs: add 2.1 API doc 2014-02-28 17:32:17 +08:00
Nguyen Anh Quynh
1cbe4c66a3 docs: update README 2014-02-25 10:04:07 +08:00
Nguyen Anh Quynh
35b5eb00c3 docs: add links to docs/README 2014-02-24 17:48:07 +08:00
Nguyen Anh Quynh
3aebd8c6fa add docs/ 2014-01-24 07:24:44 +08:00