mirror of
https://github.com/hedge-dev/XenonRecomp.git
synced 2025-07-23 13:33:56 +00:00
Initial Commit
This commit is contained in:
58
thirdparty/capstone/.github/ISSUE_TEMPLATE/bug_report_asm.md
vendored
Normal file
58
thirdparty/capstone/.github/ISSUE_TEMPLATE/bug_report_asm.md
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
name: Bug report - Incorrect disassembly
|
||||
about: Create a report about incorrect disassembly.
|
||||
---
|
||||
|
||||
<!-- This template is meant for disassembly related bug reports, please be as descriptive as possible -->
|
||||
|
||||
### Work environment
|
||||
|
||||
<!-- Filling this table is mandatory -->
|
||||
|
||||
| Questions | Answers
|
||||
|------------------------------------------|--------------------
|
||||
| OS/arch/bits | Debian arm 64, MacOS AArch64, MacOS x86, Windows x86 etc.
|
||||
| Architecture | ppc, x86, cortexm, armv8 etc.
|
||||
| Source of Capstone | `git clone`, brew, pip, release binaries etc.
|
||||
| Version/git commit | v5.0.1, <commit hash>
|
||||
|
||||
<!-- INCORRECT DISASSEMBLY BUGS -->
|
||||
|
||||
### Instruction bytes giving faulty results
|
||||
|
||||
```
|
||||
0x00,0x00,0x00,0x00
|
||||
```
|
||||
|
||||
### Expected results
|
||||
|
||||
It should be:
|
||||
```
|
||||
<this or that>
|
||||
```
|
||||
|
||||
### Steps to get the wrong result
|
||||
|
||||
With `cstool`:
|
||||
|
||||
```sh
|
||||
cstool arm -d 0x00,0x00,0x00,0x00
|
||||
```
|
||||
|
||||
or with `Python`
|
||||
|
||||
```python
|
||||
CODE = b'\x90\x90\x90\x90'
|
||||
|
||||
md = Cs(CS_ARCH_ARM, CS_MODE_THUMB)
|
||||
md.detail = True
|
||||
for insn in md.disasm(CODE, 0x1000):
|
||||
# Print the faulty disassembly
|
||||
```
|
||||
|
||||
<!-- ADDITIONAL CONTEXT -->
|
||||
|
||||
### Additional Logs, screenshots, source code, configuration dump, ...
|
||||
|
||||
Drag and drop zip archives containing the Additional info here, don't use external services or link.
|
||||
Screenshots can be directly dropped here.
|
40
thirdparty/capstone/.github/ISSUE_TEMPLATE/bug_report_general.md
vendored
Normal file
40
thirdparty/capstone/.github/ISSUE_TEMPLATE/bug_report_general.md
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
name: Bug report - Other bugs
|
||||
about: Create a report to help us improve
|
||||
|
||||
---
|
||||
|
||||
<!-- This template is meant for GENERAL bug reports.
|
||||
For bugs regarding incorrect disassembly,
|
||||
please use the "Bug report - Incorrect disassembly" template.
|
||||
|
||||
Please be as descriptive as possible
|
||||
-->
|
||||
|
||||
### Work environment
|
||||
|
||||
<!-- Filling this table is mandatory -->
|
||||
|
||||
| Questions | Answers
|
||||
|------------------------------------------|--------------------
|
||||
| OS/arch/bits | Debian arm 64, MacOS AArch64, MacOS x86, Windows x86 etc.
|
||||
| Architecture | ppc, x86, cortexm, armv8 etc.
|
||||
| Source of Capstone | `git clone`, brew, pip, release binaries etc.
|
||||
| Version/git commit | v5.0.1, <commit hash>
|
||||
|
||||
<!-- OTHER BUGS -->
|
||||
|
||||
### Expected behavior
|
||||
|
||||
### Actual behavior
|
||||
|
||||
### Steps to reproduce the behavior
|
||||
|
||||
- Use code markdown `CODE` to make your code visible
|
||||
|
||||
<!-- ADDITIONAL CONTEXT -->
|
||||
|
||||
### Additional Logs, screenshots, source code, configuration dump, ...
|
||||
|
||||
Drag and drop zip archives containing the Additional info here, don't use external services or link.
|
||||
Screenshots can be directly dropped here.
|
19
thirdparty/capstone/.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
19
thirdparty/capstone/.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
|
||||
---
|
||||
|
||||
### Feature
|
||||
|
||||
- [ ] New architecture module
|
||||
- [ ] Support for processor extension
|
||||
- [ ] Add more instruction details (elaborated below)
|
||||
- [ ] Binding support for: `language`
|
||||
- [ ] Other (elaborated below)
|
||||
|
||||
**Describe the feature you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the feature request here.
|
23
thirdparty/capstone/.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
23
thirdparty/capstone/.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<!-- Filling this template is mandatory -->
|
||||
|
||||
**Your checklist for this pull request**
|
||||
- [ ] I've documented or updated the documentation of every API function and struct this PR changes.
|
||||
- [ ] I've added tests that prove my fix is effective or that my feature works (if possible)
|
||||
|
||||
**Detailed description**
|
||||
|
||||
<!-- Explain the **details** for making this change. Is a new feature implemented? What existing problem does the pull request solve? How does the pull request solve these issues? Please provide enough information so that others can review your pull request. -->
|
||||
|
||||
...
|
||||
|
||||
**Test plan**
|
||||
|
||||
<!-- What steps should the reviewer take to test your pull request? Demonstrate the code is solid. Or what test cases you added. Disassembly tests should be added in suite/cs_test/issues.cs -->
|
||||
|
||||
...
|
||||
|
||||
**Closing issues**
|
||||
|
||||
<!-- put "closes #XXXX" in your comment to auto-close the issue that your PR fixes (if any). -->
|
||||
|
||||
...
|
175
thirdparty/capstone/.github/labeler.yml
vendored
Normal file
175
thirdparty/capstone/.github/labeler.yml
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
Auto-Sync-files:
|
||||
- suite/auto-sync/**
|
||||
|
||||
LLVM-core-files:
|
||||
- MC*.[ch]
|
||||
|
||||
LLVM-generated-files:
|
||||
- arch/*/*.inc
|
||||
|
||||
Documentation:
|
||||
- '**/*.md'
|
||||
|
||||
CS-core-files:
|
||||
- cs*.[ch]
|
||||
- SStream.[ch]
|
||||
- utis.[ch]
|
||||
- MathExtras.h
|
||||
- Mapping.[ch]
|
||||
- LEB128.h
|
||||
- cstool/cstool.[ch]
|
||||
- cstool/getopt.[ch]
|
||||
- include/capstone/capstone.h
|
||||
- include/capstone/cs_operand.h
|
||||
- include/capstone/platform.h
|
||||
|
||||
ARM:
|
||||
- arch/ARM/**
|
||||
- cstool/cstool_arm.c
|
||||
- include/capstone/arm.h
|
||||
- suite/MC/ARM/**
|
||||
- tests/test_arm.c
|
||||
|
||||
AArch64:
|
||||
- arch/AArch64/**
|
||||
- cstool/cstool_aarch64.c
|
||||
- include/capstone/aarch64.h
|
||||
- suite/MC/AArch64/**
|
||||
- tests/test_aarch64.c
|
||||
|
||||
Alpha:
|
||||
- arch/Alpha/**
|
||||
- cstool/cstool_alpha.c
|
||||
- include/capstone/alpha.h
|
||||
- suite/MC/Alpha/**
|
||||
- tests/test_alpha.c
|
||||
|
||||
BPF:
|
||||
- arch/BPF/**
|
||||
- cstool/cstool_bpf.c
|
||||
- include/capstone/bpf.h
|
||||
- suite/MC/BPF/**
|
||||
- tests/test_bpf.c
|
||||
|
||||
EVM:
|
||||
- arch/EVM/**
|
||||
- cstool/cstool_evm.c
|
||||
- include/capstone/evm.h
|
||||
- tests/test_evm.c
|
||||
|
||||
HPPA:
|
||||
- arch/HPPA/**
|
||||
- cstool/cstool_hppa.c
|
||||
- include/capstone/hppa.h
|
||||
- suite/MC/HPPA/**
|
||||
- tests/test_hppa.c
|
||||
|
||||
LoongArch:
|
||||
- arch/LoongArch/**
|
||||
- cstool/cstool_loongarch.c
|
||||
- include/capstone/loongarch.h
|
||||
- suite/MC/LoongArch/**
|
||||
- tests/test_loongarch.c
|
||||
|
||||
M680X:
|
||||
- arch/M680X/**
|
||||
- cstool/cstool_m680x.c
|
||||
- include/capstone/m680x.h
|
||||
- tests/test_m680x.c
|
||||
|
||||
M68K:
|
||||
- arch/M68K/**
|
||||
- cstool/cstool_m68k.c
|
||||
- include/capstone/m68k.h
|
||||
- tests/test_m68k.c
|
||||
|
||||
MOS65XX:
|
||||
- arch/MOS65XX/**
|
||||
- cstool/cstool_mos65xx.c
|
||||
- include/capstone/mos65xx.h
|
||||
- tests/test_mos65xx.c
|
||||
|
||||
Mips:
|
||||
- arch/Mips/**
|
||||
- cstool/cstool_mips.c
|
||||
- include/capstone/mips.h
|
||||
- suite/MC/Mips/**
|
||||
- tests/test_mips.c
|
||||
|
||||
PowerPC:
|
||||
- arch/PowerPC/**
|
||||
- cstool/cstool_powerpc.c
|
||||
- include/capstone/ppc.h
|
||||
- suite/MC/PowerPC/**
|
||||
- tests/test_powerpc.c
|
||||
|
||||
RISCV:
|
||||
- arch/RISCV/**
|
||||
- cstool/cstool_riscv.c
|
||||
- include/capstone/riscv.h
|
||||
- suite/MC/RISCV/**
|
||||
- tests/test_riscv.c
|
||||
|
||||
SH:
|
||||
- arch/SH/**
|
||||
- cstool/cstool_sh.c
|
||||
- include/capstone/sh.h
|
||||
- tests/test_sh.c
|
||||
|
||||
Sparc:
|
||||
- arch/Sparc/**
|
||||
- cstool/cstool_sparc.c
|
||||
- include/capstone/sparc.h
|
||||
- suite/MC/Sparc/**
|
||||
- tests/test_sparc.c
|
||||
|
||||
SystemZ:
|
||||
- arch/SystemZ/**
|
||||
- cstool/cstool_systemz.c
|
||||
- include/capstone/systemz.h
|
||||
- suite/MC/SystemZ/**
|
||||
- tests/test_systemz.c
|
||||
|
||||
TMS320C64x:
|
||||
- arch/TMS320C6x/**
|
||||
- cstool/cstool_tms320c64x.c
|
||||
- include/capstone/tms320x64x.h
|
||||
- tests/test_tms320c64x.c
|
||||
|
||||
TriCore:
|
||||
- arch/TriCore/**
|
||||
- cstool/cstool_tricore.c
|
||||
- include/capstone/tricore.h
|
||||
- suite/MC/Tricore/**
|
||||
- tests/test_tricore.c
|
||||
|
||||
WASM:
|
||||
- arch/WASM/**
|
||||
- cstool/cstool_wasm.c
|
||||
- include/capstone/wasm.h
|
||||
- tests/test_wasm.c
|
||||
|
||||
X86:
|
||||
- arch/X86/**
|
||||
- cstool/cstool_x86.c
|
||||
- include/capstone/x86.h
|
||||
- suite/MC/X86/**
|
||||
- tests/test_x86.c
|
||||
|
||||
XCore:
|
||||
- arch/XCore/**
|
||||
- cstool/cstool_xcore.c
|
||||
- include/capstone/xcore.h
|
||||
- tests/test_xcore.c
|
||||
|
||||
python:
|
||||
- bindings/python/**
|
||||
|
||||
ocaml:
|
||||
- bindings/ocaml/**
|
||||
|
||||
java:
|
||||
- bindings/java/**
|
||||
|
||||
Github-files:
|
||||
- .github/**
|
172
thirdparty/capstone/.github/workflows/CITest.yml
vendored
Normal file
172
thirdparty/capstone/.github/workflows/CITest.yml
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
name: Run Test
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- ".gitignore"
|
||||
- "docs/**"
|
||||
- "ChangeLog"
|
||||
- "CREDITS.TXT"
|
||||
- "COMPILE_MAKE.TXT"
|
||||
- "COMPILE_MSVC.TXT"
|
||||
- "COMPILE_CMAKE.TXT"
|
||||
- "HACK.TXT"
|
||||
- "LICENSE.TXT"
|
||||
- "LICENSE_LLVM.TXT"
|
||||
- "README.md"
|
||||
- "RELEASE_NOTES"
|
||||
- "SPONSORS.TXT"
|
||||
- "TODO"
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
CI: true
|
||||
|
||||
jobs:
|
||||
Linux:
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
name: ${{ matrix.config.name }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- {
|
||||
name: 'ubuntu-22.04 x64 make',
|
||||
os: ubuntu-22.04,
|
||||
arch: x64,
|
||||
build-system: 'make',
|
||||
diet-build: 'OFF',
|
||||
enable-asan: 'OFF'
|
||||
}
|
||||
- {
|
||||
name: 'ubuntu-22.04 x64 cmake',
|
||||
os: ubuntu-22.04,
|
||||
arch: x64,
|
||||
build-system: 'cmake',
|
||||
diet-build: 'OFF',
|
||||
enable-asan: 'OFF'
|
||||
}
|
||||
- {
|
||||
name: 'ubuntu-24.04 x64 ASAN',
|
||||
os: ubuntu-24.04,
|
||||
arch: x64,
|
||||
build-system: 'cmake',
|
||||
diet-build: 'OFF',
|
||||
enable-asan: 'ON'
|
||||
}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.config.python-version }}
|
||||
|
||||
- name: Prepare fuzzing
|
||||
run: |
|
||||
export LD_LIBRARY_PATH=`pwd`/tests/:$LD_LIBRARY_PATH
|
||||
wget https://github.com/groundx/capstonefuzz/raw/master/corpus/corpus-libFuzzer-capstone_fuzz_disasmnext-latest.zip
|
||||
unzip -q corpus-libFuzzer-capstone_fuzz_disasmnext-latest.zip -d suite/fuzz
|
||||
|
||||
- name: make
|
||||
if: startsWith(matrix.config.build-system, 'make')
|
||||
run: |
|
||||
./make.sh
|
||||
sudo make install
|
||||
|
||||
- name: cmake
|
||||
if: startsWith(matrix.config.build-system, 'cmake')
|
||||
env:
|
||||
asan: ${{ matrix.config.enable-asan }}
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
# build static library
|
||||
cmake -DCAPSTONE_INSTALL=1 -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_ASAN=${asan} -DCAPSTONE_BUILD_DIET=${diet_build} ..
|
||||
cmake --build . --config Release
|
||||
# build shared library
|
||||
cmake -DCAPSTONE_INSTALL=1 -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_PREFIX=/usr -DCAPSTONE_BUILD_CSTEST=ON -DENABLE_ASAN=${asan} ..
|
||||
sudo cmake --build . --config Release --target install
|
||||
|
||||
- name: Lower number of KASL randomized address bits
|
||||
run: |
|
||||
# Work-around ASAN bug https://github.com/google/sanitizers/issues/1716
|
||||
sudo sysctl vm.mmap_rnd_bits=28
|
||||
|
||||
- name: "Compatibility header test"
|
||||
if: startsWith(matrix.config.build-system, 'cmake') && matrix.config.diet-build == 'OFF'
|
||||
run: |
|
||||
ctest --test-dir build --output-on-failure -R ASCompatibilityHeaderTest
|
||||
|
||||
- name: cstool - reaches disassembler engine
|
||||
run: |
|
||||
sh suite/run_invalid_cstool.sh
|
||||
|
||||
- name: cstest unit tests
|
||||
if: startsWith(matrix.config.build-system, 'cmake')
|
||||
run: |
|
||||
ctest --test-dir build --output-on-failure -R UnitCSTest
|
||||
|
||||
- name: cstest integration tests
|
||||
if: startsWith(matrix.config.build-system, 'cmake')
|
||||
run: |
|
||||
ctest --test-dir build --output-on-failure -R IntegrationCSTest
|
||||
|
||||
- name: cstest MC
|
||||
if: startsWith(matrix.config.build-system, 'cmake')
|
||||
run: |
|
||||
ctest --test-dir build --output-on-failure -R MCTests
|
||||
|
||||
- name: cstest details
|
||||
if: startsWith(matrix.config.build-system, 'cmake')
|
||||
run: |
|
||||
ctest --test-dir build --output-on-failure -R DetailTests
|
||||
|
||||
- name: cstest issues
|
||||
if: startsWith(matrix.config.build-system, 'cmake')
|
||||
run: |
|
||||
ctest --test-dir build --output-on-failure -R IssueTests
|
||||
|
||||
- name: cstest features
|
||||
if: startsWith(matrix.config.build-system, 'cmake')
|
||||
run: |
|
||||
ctest --test-dir build --output-on-failure -R FeaturesTests
|
||||
|
||||
- name: Legacy integration tests
|
||||
if: startsWith(matrix.config.build-system, 'cmake')
|
||||
run: |
|
||||
ctest --test-dir build --output-on-failure -R legacy*
|
||||
|
||||
Windows:
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
name: ${{ matrix.config.name }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- name: 'windows x64 MSVC 64bit'
|
||||
os: windows-latest
|
||||
arch: x64
|
||||
platform: windows
|
||||
python-arch: x64
|
||||
python-version: '3.9'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: lukka/get-cmake@latest
|
||||
name: Get CMake
|
||||
|
||||
- name: '🛠️ Win MSVC 64 setup'
|
||||
if: contains(matrix.config.name, 'MSVC 64')
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: 'x64'
|
||||
|
||||
- name: '🚧 Win MSVC 64 build'
|
||||
if: contains(matrix.config.name, 'MSVC 64')
|
||||
shell: bash
|
||||
run: |
|
||||
cmake --version
|
||||
cmake --preset=${{ matrix.config.platform }}-x64
|
||||
cmake --build --preset build-${{ matrix.config.platform }}-release
|
||||
cmake --build --preset install-${{ matrix.config.platform }}-release
|
101
thirdparty/capstone/.github/workflows/auto-sync.yml
vendored
Normal file
101
thirdparty/capstone/.github/workflows/auto-sync.yml
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
name: Auto-Sync
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "suite/auto-sync/**"
|
||||
- ".github/workflows/auto-sync.yml"
|
||||
pull_request:
|
||||
|
||||
# Stop previous runs on the same branch on new push
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-24.04
|
||||
defaults:
|
||||
run:
|
||||
working-directory: suite/auto-sync/
|
||||
steps:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Install auto-sync package
|
||||
run: |
|
||||
pip install .
|
||||
|
||||
- name: Check formatting
|
||||
run: |
|
||||
python3.11 -m black --check src/autosync
|
||||
|
||||
- name: Install llvm-mc
|
||||
run: |
|
||||
sudo apt install llvm-18
|
||||
llvm-mc-18 --version
|
||||
FileCheck-18 --version
|
||||
sudo ln -s $(whereis -b llvm-mc-18 | grep -Eo "/.*") /usr/local/bin/llvm-mc
|
||||
sudo ln -s $(whereis -b FileCheck-18 | grep -Eo "/.*") /usr/local/bin/FileCheck
|
||||
llvm-mc --version
|
||||
FileCheck --version
|
||||
|
||||
- name: Clone llvm-capstone
|
||||
run: |
|
||||
git clone https://github.com/capstone-engine/llvm-capstone.git vendor/llvm_root
|
||||
|
||||
- name: Build llvm-tblgen
|
||||
run: |
|
||||
cd vendor/llvm_root
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ../llvm
|
||||
cmake --build . --target llvm-tblgen --config Debug
|
||||
cd ../../../
|
||||
|
||||
- name: Test Header patcher
|
||||
run: |
|
||||
python -m unittest src/autosync/Tests/test_header_patcher.py
|
||||
python -m unittest src/autosync/Tests/test_mcupdater.py
|
||||
|
||||
- name: Remove llvm-mc
|
||||
run: |
|
||||
sudo apt remove llvm-18
|
||||
sudo rm /usr/local/bin/llvm-mc
|
||||
sudo rm /usr/local/bin/FileCheck
|
||||
|
||||
- name: Test generation of inc files
|
||||
run: |
|
||||
./src/autosync/ASUpdater.py -d -a AArch64 -s IncGen
|
||||
./src/autosync/ASUpdater.py -d -a Alpha -s IncGen
|
||||
./src/autosync/ASUpdater.py -d -a ARM -s IncGen
|
||||
./src/autosync/ASUpdater.py -d -a PPC -s IncGen
|
||||
./src/autosync/ASUpdater.py -d -a LoongArch -s IncGen
|
||||
|
||||
- name: CppTranslator - Patch tests
|
||||
run: |
|
||||
python -m unittest src/autosync/cpptranslator/Tests/test_patches.py
|
||||
|
||||
- name: CppTranslator - Differ tests
|
||||
run: |
|
||||
python -m unittest src/autosync/cpptranslator/Tests/test_differ.py
|
||||
|
||||
- name: CppTranslator - Test translation
|
||||
run: |
|
||||
./src/autosync/ASUpdater.py --ci -d -a AArch64 -s Translate
|
||||
./src/autosync/ASUpdater.py --ci -d -a ARM -s Translate
|
||||
./src/autosync/ASUpdater.py --ci -d -a PPC -s Translate
|
||||
./src/autosync/ASUpdater.py --ci -d -a LoongArch -s Translate
|
||||
|
||||
- name: Differ - Test save file is up-to-date
|
||||
run: |
|
||||
./src/autosync/cpptranslator/Differ.py -a AArch64 --check_saved
|
||||
./src/autosync/cpptranslator/Differ.py -a ARM --check_saved
|
||||
./src/autosync/cpptranslator/Differ.py -a PPC --check_saved
|
||||
./src/autosync/cpptranslator/Differ.py -a LoongArch --check_saved
|
50
thirdparty/capstone/.github/workflows/build_release.yml
vendored
Normal file
50
thirdparty/capstone/.github/workflows/build_release.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
name: Build Source Release
|
||||
|
||||
# Trigger whenever a release is created
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: archive
|
||||
id: archive
|
||||
run: |
|
||||
VERSION=${{ github.event.release.tag_name }}
|
||||
PKGNAME="capstone-$VERSION"
|
||||
SHASUM=$PKGNAME.tar.xz.sha256
|
||||
mkdir -p /tmp/$PKGNAME
|
||||
mv * /tmp/$PKGNAME
|
||||
mv /tmp/$PKGNAME .
|
||||
TARBALL=$PKGNAME.tar.xz
|
||||
tar cJf $TARBALL $PKGNAME
|
||||
sha256sum $TARBALL > $SHASUM
|
||||
echo "::set-output name=tarball::$TARBALL"
|
||||
echo "::set-output name=shasum::$SHASUM"
|
||||
- name: upload tarball
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
asset_path: ./${{ steps.archive.outputs.tarball }}
|
||||
asset_name: ${{ steps.archive.outputs.tarball }}
|
||||
asset_content_type: application/gzip
|
||||
|
||||
- name: upload shasum
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
asset_path: ./${{ steps.archive.outputs.shasum }}
|
||||
asset_name: ${{ steps.archive.outputs.shasum }}
|
||||
asset_content_type: text/plain
|
43
thirdparty/capstone/.github/workflows/clang-tidy.yml
vendored
Normal file
43
thirdparty/capstone/.github/workflows/clang-tidy.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Run clang-tidy
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**.c'
|
||||
- '**.h'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
name: clang-tidy
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install clang-tidy
|
||||
run: |
|
||||
sudo apt install clang-tidy
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
CC=clang cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_SHARED_LIBS=1 ..
|
||||
CC=clang sudo cmake --build . --config Release
|
||||
cd ..
|
||||
|
||||
- name: Install clang-tidy-18
|
||||
run: |
|
||||
sudo apt install clang-tidy-18
|
||||
|
||||
- name: Check for warnings
|
||||
env:
|
||||
base_sha: ${{ github.event.pull_request.base.sha }}
|
||||
head_sha: ${{ github.event.pull_request.head.sha }}
|
||||
run: |
|
||||
./run-clang-tidy.sh build
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
path: ct-warnings.txt
|
60
thirdparty/capstone/.github/workflows/coverity.yml
vendored
Normal file
60
thirdparty/capstone/.github/workflows/coverity.yml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Coverity Scan
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 01 * *' # On the 1st every month at midnight UTC
|
||||
|
||||
|
||||
# Automatically cancel any previous workflow on new push.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
latest:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Determine current repository
|
||||
id: "determine-repo"
|
||||
run: echo "repo=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- name: Download Coverity Build Tool
|
||||
run: |
|
||||
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=capstone-next" -O cov-analysis-linux64.tar.gz
|
||||
mkdir cov-analysis-linux64
|
||||
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
|
||||
env:
|
||||
TOKEN: ${{ secrets.COVERITY_TOKEN }}
|
||||
|
||||
- name: Installing build dependencies
|
||||
run: |
|
||||
sudo apt-get --assume-yes install cmake
|
||||
|
||||
- name: Setup
|
||||
run: |
|
||||
cmake . -B build -DCAPSTONE_BUILD_CSTEST=ON
|
||||
|
||||
- name: Build with cov-build
|
||||
run: |
|
||||
export PATH=`pwd`/cov-analysis-linux64/bin:$PATH
|
||||
cov-build --dir cov-int cmake --build build
|
||||
tar czvf capstone.tgz cov-int
|
||||
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: capstone.tgz
|
||||
|
||||
- name: Submit the result to Coverity Scan
|
||||
run: |
|
||||
curl \
|
||||
--form token=$TOKEN \
|
||||
--form email=capstone.engine@gmail.com \
|
||||
--form file=@capstone.tgz \
|
||||
--form version=trunk \
|
||||
--form description="capstone" \
|
||||
https://scan.coverity.com/builds?project=capstone-next
|
||||
env:
|
||||
TOKEN: ${{ secrets.COVERITY_TOKEN }}
|
||||
if: steps.determine-repo.outputs.repo == 'capstone-engine/capstone'
|
23
thirdparty/capstone/.github/workflows/fuzz.yml
vendored
Normal file
23
thirdparty/capstone/.github/workflows/fuzz.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
name: CIFuzz
|
||||
on: [pull_request]
|
||||
jobs:
|
||||
Fuzzing:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Build Fuzzers
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'capstone'
|
||||
dry-run: false
|
||||
- name: Run Fuzzers
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'capstone'
|
||||
fuzz-seconds: 600
|
||||
dry-run: false
|
||||
- name: Upload Crash
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: artifacts
|
||||
path: ./out/artifacts
|
20
thirdparty/capstone/.github/workflows/labeler.yml
vendored
Normal file
20
thirdparty/capstone/.github/workflows/labeler.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: "Pull Request Labeler"
|
||||
on:
|
||||
- pull_request_target
|
||||
|
||||
# Automatically cancel any previous workflow on new push.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/labeler@v4
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
90
thirdparty/capstone/.github/workflows/python-publish-release.yml
vendored
Normal file
90
thirdparty/capstone/.github/workflows/python-publish-release.yml
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
name: RELEASE BUILD - PyPI 📦 Distribution
|
||||
|
||||
on: [push, pull_request, release, workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
build_wheels:
|
||||
name: Build wheels on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up MSVC x64
|
||||
if: matrix.os == 'windows-latest'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Set up QEMU
|
||||
if: runner.os == 'Linux'
|
||||
uses: docker/setup-qemu-action@v3
|
||||
with:
|
||||
platforms: all
|
||||
|
||||
- name: Build wheels
|
||||
uses: pypa/cibuildwheel@v2.20.0
|
||||
env:
|
||||
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
|
||||
CIBW_ARCHS_LINUX: "x86_64 i686 aarch64" # ppc64le s390x really slow
|
||||
CIBW_ARCHS_WINDOWS: "AMD64" # ARM64 Seems ARM64 will rebuild amd64 wheel for unknow reason.
|
||||
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*"
|
||||
CIBW_SKIP: ""
|
||||
with:
|
||||
package-dir: bindings/python
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: ./wheelhouse/*.whl
|
||||
name: artifacts-${{ matrix.os }}
|
||||
|
||||
- name: Check binaries (Windows)
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: |
|
||||
python3.exe suite/check_wheel_bin_arch.py ./wheelhouse/
|
||||
|
||||
- name: Check binaries (Unix)
|
||||
if: matrix.os != 'windows-latest'
|
||||
run: |
|
||||
./suite/check_wheel_bin_arch.py ./wheelhouse/
|
||||
|
||||
make_sdist:
|
||||
name: Make SDist
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Optional, use if you use setuptools_scm
|
||||
submodules: true # Optional, use if you have submodules
|
||||
|
||||
- name: Build SDist
|
||||
run: |
|
||||
cd bindings/python
|
||||
pipx run build --sdist
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: bindings/python/dist/*.tar.gz
|
||||
|
||||
publish:
|
||||
needs: [build_wheels]
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'release' && github.event.prerelease == false && github.event.action == 'published'
|
||||
permissions:
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
merge-multiple: true
|
||||
path: dist
|
||||
|
||||
- name: Show downloaded artifacts
|
||||
run: ls -laR dist
|
||||
|
||||
- name: Publish distribution 📦 to PyPI
|
||||
if: ${{ success() }}
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
verbose: true
|
||||
user: __token__
|
||||
password: ${{ secrets.pypi_pass }}
|
57
thirdparty/capstone/.github/workflows/python-tests.yml
vendored
Normal file
57
thirdparty/capstone/.github/workflows/python-tests.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: Python Package CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-24.04, windows-2022, macOS-14]
|
||||
python-version: ["3.8", "3.12"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Setup MSVC
|
||||
if: runner.os == 'Windows'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Build and install capstone
|
||||
run: pip install ./bindings/python
|
||||
|
||||
- name: Install cstest_py
|
||||
run: pip install ./bindings/python/cstest_py
|
||||
|
||||
- name: Run legacy tests
|
||||
run: python ./bindings/python/tests/test_all.py
|
||||
|
||||
- name: cstest_py integration tests
|
||||
run: |
|
||||
cd suite/cstest/test/
|
||||
python3 ./integration_tests.py cstest_py
|
||||
cd ../../../
|
||||
|
||||
- name: cstest_py MC
|
||||
run: |
|
||||
cstest_py tests/MC/
|
||||
|
||||
- name: cstest_py details
|
||||
run: |
|
||||
cstest_py tests/details/
|
||||
|
||||
- name: cstest_py issues
|
||||
run: |
|
||||
cstest_py tests/issues/
|
||||
|
||||
- name: cstest_py features
|
||||
run: |
|
||||
cstest_py tests/features/
|
Reference in New Issue
Block a user