Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM opcode & operand encoding information (based on auto-sync) #2045

Closed
wants to merge 2,260 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2260 commits
Select commit Hold shift + click to select a range
3260d43
ST SUB SYSCALL XOR XNOR
imbillow Mar 23, 2023
abf826a
update `TriCore*.inc`
imbillow Mar 23, 2023
655a8ba
add FPU Instructions
imbillow Mar 23, 2023
c776b8c
fix build
imbillow Mar 23, 2023
bdeb9ee
`Decode*Instruction`
imbillow Mar 24, 2023
29d57ee
fix `DecodeInstruction`
imbillow Mar 24, 2023
b8ede53
add `tricore` to `cstool`
imbillow Mar 24, 2023
d522758
add `tricore` to `cstest`
imbillow Mar 24, 2023
cfea930
fix
imbillow Mar 24, 2023
ede95ff
fix
imbillow Mar 25, 2023
8fc6ecc
- add `tricore` to python binding
imbillow Mar 25, 2023
b6b2777
add more `tricore` cstest
imbillow Mar 25, 2023
c63f41d
add `sign_ext` `zero_ext`
imbillow Mar 25, 2023
47ccaaf
fix
imbillow Mar 25, 2023
8a3ba2d
fix `DecodeRegisterClass`
imbillow Mar 26, 2023
f069589
fix `DecodeRegisterClass`
imbillow Mar 26, 2023
fbc85a0
fix `BO` `BOL`
imbillow Mar 26, 2023
e69b18b
fix `SRRS`
imbillow Mar 26, 2023
9fb9765
fix
imbillow Mar 26, 2023
fccf575
fix `RRPW`
imbillow Mar 26, 2023
1ccb9a6
fix `INSERT_rrpw`
imbillow Mar 26, 2023
cba2891
fix `RR`
imbillow Mar 26, 2023
18954aa
fix
imbillow Mar 26, 2023
eefd54f
fix `mov.a` `mov.d`
imbillow Mar 26, 2023
a5ce9b6
fix `imask`
imbillow Mar 26, 2023
e456240
Whether to call `a10` a `sp`
imbillow Mar 26, 2023
7eff029
add `MTCR`
imbillow Mar 26, 2023
f657e1a
add `BO`
imbillow Mar 26, 2023
2ace396
docs: Refactor project structure and remove unnecessary file.
imbillow Mar 27, 2023
9fff040
fix: TriCore architecture disassembly codes
imbillow Mar 27, 2023
7fccdd2
fix: TriCore instruction decoding and printing.
imbillow Mar 27, 2023
8eee760
fix: decode error
imbillow Mar 28, 2023
8b4f448
Fix: TriCore instruction operations and decoding.
imbillow Mar 28, 2023
d2f4d19
fix: TriCore Instruction Formats and Printing
imbillow Mar 28, 2023
38da82c
refactor: Refactor TriCore instructions and operands
imbillow Mar 29, 2023
22feb62
feat: Fix bugs and update instructions for TriCore architecture.
imbillow Mar 29, 2023
ffa7c98
fix: decode `j` `call` `loop`
imbillow Mar 29, 2023
bb86641
unique tests
imbillow Mar 29, 2023
2d74f34
fix: `disp` print and fill
imbillow Mar 31, 2023
1474f1e
just add TriCoreISA enum
imbillow Mar 31, 2023
f0ca9dc
add tricore Predicates
imbillow Apr 1, 2023
40031c4
cleanup
imbillow Apr 1, 2023
b1f77e4
add some tricore v1.1 inst
imbillow Apr 1, 2023
e48168a
fix `cachea`
imbillow Apr 1, 2023
27c31c1
refactor: Refactor TriCore register names.
imbillow Apr 1, 2023
a8153b4
refactor: Improve TriCore instruction handling.
imbillow Apr 2, 2023
a75e4db
refactor: Add support for new TriCore instructions and constraints.
imbillow Apr 2, 2023
117c9eb
refactor: Update TriCore instruction requirements
imbillow Apr 3, 2023
29ced4e
refactor: Refactor TriCore instruction decoding and register definition.
imbillow Apr 3, 2023
0aeed24
add `tricore_feature` support
imbillow Apr 4, 2023
072b70f
feat: Add and remove TriCore instructions.
imbillow Apr 4, 2023
88d5027
refactor: Add new TriCore instructions and remove deprecated ones.
imbillow Apr 5, 2023
50483a2
refactor: Refactor TriCore instruction definitions and mappings
imbillow Apr 6, 2023
963b7ad
refactor: Improve Architecture Instruction Information.
imbillow Apr 6, 2023
f035d04
refactor: Refactor TriCore instruction classes and operands
imbillow Apr 6, 2023
abf1b46
Optimize TriCore instruction information.
imbillow Apr 6, 2023
e579032
Optimize TriCore instruction information.
imbillow Apr 6, 2023
bdc4aa4
refactor: Improve TriCore instruction definitions in architecture file
imbillow Apr 6, 2023
d3163a6
refactor: Improve instruction handling for TriCore architecture
imbillow Apr 6, 2023
4409b29
Add support for TriCore V162 and new instructions/operands.
imbillow Apr 6, 2023
4b3f284
Refactor: Optimize TriCore instruction information.
imbillow Apr 6, 2023
443af68
refactor: Improve TriCore floating-point operations in instruction set
imbillow Apr 7, 2023
d59e012
refactor: Optimize TriCore instructions in arch/TriCore/TriCoreInstrI…
imbillow Apr 7, 2023
b9151fb
fix
imbillow Apr 7, 2023
7c56b54
feat: Add support for TriCore feature bits and new architectures
imbillow Apr 7, 2023
98c1a24
feat: Refactor and improve triCore platform support
imbillow Apr 7, 2023
7200d39
feat: Update TriCore processor support and architecture modes
imbillow Apr 7, 2023
463a8df
fix
imbillow Apr 7, 2023
587279f
add some tc162 tests
imbillow Apr 7, 2023
c1c4137
fix TriCoreDisassembler.c from tests
imbillow Apr 8, 2023
bd8b7da
fix tricore tests
imbillow Apr 8, 2023
b4820f2
feat: Update Tricore assembly code and disassembler logic.
imbillow Apr 8, 2023
73810e1
add tc110 tests and fix tricore decode
imbillow Apr 8, 2023
3b11b2d
fix `CADD` `CSUB`
imbillow Apr 8, 2023
9939c86
fix tc110 test and fix decode
imbillow Apr 8, 2023
8dd3ae1
fix `RCR` printer
imbillow Apr 8, 2023
95ffda7
fix
imbillow Apr 8, 2023
ff0c69f
fix
imbillow Apr 8, 2023
f0cfb4d
fix
imbillow Apr 8, 2023
42ce4f2
fix tc1.1 tests
imbillow Apr 8, 2023
a93ace5
fix tc1.6.2 tests
imbillow Apr 8, 2023
9c982d3
fix tc1.6.2 tests
imbillow Apr 8, 2023
4d9d539
add tests
imbillow Apr 8, 2023
9bf0041
Update TriCore instructions in TriCoreInstrInfo.td
imbillow Apr 8, 2023
5417985
fix tests
imbillow Apr 9, 2023
6b334f8
fix tests
imbillow Apr 9, 2023
2814baa
fix tests
imbillow Apr 9, 2023
5af4475
fix `TRICORE_GENERIC` inst
imbillow Apr 9, 2023
2de47c4
fix tests
imbillow Apr 9, 2023
f8ad73b
fix `TriCore_getRegisterName`
imbillow Apr 9, 2023
cb8e351
cleanup
imbillow Apr 9, 2023
80ce512
fix `TRICORE_OP_MEM`
imbillow Apr 9, 2023
a7581ac
fix `TriCoreGenCSMappingInsnName.inc`
imbillow Apr 10, 2023
5260fbe
Update tricore `.inc`
imbillow Apr 10, 2023
4033ff0
fix `test_corpus.py`
imbillow Apr 10, 2023
926714c
fix fuzz
imbillow Apr 10, 2023
37647a2
fix fuzz
imbillow Apr 10, 2023
4ebad28
update TriCoreGenAsmWriter.inc
imbillow Apr 13, 2023
878883a
add TriCore in README
imbillow Apr 14, 2023
d9f13fe
fix tricore endian
imbillow Apr 17, 2023
f3a3018
Add handling of prefix `NOTRACK`
junghee Apr 19, 2023
9c5449f
Merge pull request #1 from junghee/junghee/notrack
junghee Apr 19, 2023
37bc4e8
fix: support for TriCore call group mapping
imbillow Apr 20, 2023
d88124b
fix all tricore compile warnings
imbillow Apr 20, 2023
331103b
fix: compile error missing file cstool msvc/visual studio
raigorx Apr 20, 2023
3e80060
Merge pull request #2000 from raigorx/patch-1
kabeor Apr 20, 2023
58bce36
Format all .(c|h) code
imbillow Apr 20, 2023
9c468ea
Merge pull request #2002 from junghee/next
kabeor Apr 22, 2023
18f82fc
Fix format error
imbillow Apr 23, 2023
4bc115f
Fix `print_insn_detail_tricore` and disp fill
imbillow Apr 23, 2023
9e15c96
Fix tricore python binding
imbillow Apr 24, 2023
010acad
Fix HACK.TXT
imbillow Apr 24, 2023
1ed507b
Fix tricore.h and remove `inc` folder
imbillow Apr 25, 2023
9f68cf9
Fix make builds with SH support
radare Apr 25, 2023
4d693da
Fix tricore.h
imbillow Apr 26, 2023
68e2707
Merge pull request #2006 from trufae/make-sh
kabeor Apr 27, 2023
620f0d0
Merge branch 'next' into tricore
imbillow Apr 27, 2023
985b6fc
Upper all `inc` and fix
imbillow May 1, 2023
588a3e1
Upper tricore_const.py
imbillow May 1, 2023
a1c3b63
Update suite/test_corpus3.py
imbillow May 1, 2023
0b1e82a
RISCV: add more instruction groups
peace-maker May 1, 2023
d1cd5ae
Add missing architectures in the readme and sort them (#2008)
trufae May 2, 2023
a658d37
Merge branch 'next' into tricore
imbillow May 2, 2023
98f1155
Merge pull request #1973 from imbillow/tricore
kabeor May 3, 2023
3aff954
Update README.md
aquynh May 3, 2023
5e2edea
Fix compilation warnings related to TriCore. (#2012)
imbillow May 9, 2023
747c9b6
Fix SH build warnings.
Rot127 May 11, 2023
806047f
Update indentation
Rot127 May 11, 2023
7d1ebc1
Merge pull request #2016 from Rot127/fix_sh_warnings
kabeor May 12, 2023
460d119
Fix tricore disp24 print
imbillow May 12, 2023
08a816b
Fix warnings about unhandled switch cases by adding defaults.
Rot127 May 12, 2023
b02d471
Fix tricore disp print
imbillow May 12, 2023
8e2d2d5
Refactor TriCoreInstPrinter.c
imbillow May 12, 2023
932bd3b
Update arch/TriCore/TriCoreInstPrinter.c
imbillow May 12, 2023
52f39ef
Update arch/TriCore/TriCoreInstPrinter.c
imbillow May 12, 2023
9961410
Update arch/TriCore/TriCoreInstPrinter.c
imbillow May 12, 2023
3e06196
Merge pull request #2018 from imbillow/tricore-fix-disp
kabeor May 13, 2023
8738f01
Initialize rw
Rot127 May 13, 2023
20bdadb
Fix ctest build
imbillow May 13, 2023
681dd11
Fix disp fill
imbillow May 13, 2023
7a3dc32
Merge pull request #2017 from Rot127/fix_sh_warnings
kabeor May 16, 2023
798f814
Merge pull request #2019 from imbillow/tricore-fix-disp
kabeor May 16, 2023
07e5ee8
Fix register accesses & operands of multiple PAC instructions
stevielavern May 16, 2023
9d2922b
Fix disassemble of `xor`
imbillow May 17, 2023
605e116
Merge pull request #2023 from imbillow/tricore_fix
kabeor May 18, 2023
42c0157
Add missing arm64 to Darwin LIBARCHS and remove dependencies tracking…
gdbinit May 19, 2023
f923221
Fix if indent
gdbinit May 19, 2023
790065a
Merge pull request #2022 from stevielavern/fix_pac
kabeor May 20, 2023
3d92995
Merge pull request #2024 from gdbinit/fat_fix
kabeor May 20, 2023
586a7d1
Fix compile warning
imbillow May 20, 2023
dc69f00
Merge pull request #2027 from imbillow/tc-fix
kabeor May 20, 2023
d3fc2da
Set mnemonic in PPC_printInst().
Rot127 May 21, 2023
80ede42
Merge pull request #2028 from Rot127/set_cr0_fix
kabeor May 22, 2023
6b50d1d
Replace strncpy with memcpy because we copy from larger to smaller bu…
Rot127 May 27, 2023
7674d88
Merge pull request #2033 from Rot127/set_cr0_fix
kabeor May 28, 2023
b0e7417
Pull auto-sync's changes from https://github.com/capstone-engine/caps…
Rot127 May 30, 2023
f40f097
Fix compile warnings under `CMake -Wall`
imbillow May 28, 2023
9d6c489
Add `.clang-format` and format
imbillow May 30, 2023
6c3a899
Add operands access support for TriCore
imbillow May 30, 2023
7729902
Merge pull request #2034 from imbillow/tc-reg-rw
kabeor May 30, 2023
ad632d1
Add ctest regression tests
peace-maker May 30, 2023
654512f
Merge branch 'next' into riscv_insn_groups
peace-maker May 30, 2023
1c0c185
Hotfix for -DCAPSTONE_DIET build.
Rot127 May 30, 2023
a026fc4
Merge pull request #2038 from Rot127/fix_diet_build
kabeor May 31, 2023
d17307e
Fix Python Bindings after changes to cs_detail
peace-maker Jun 5, 2023
dc7d2be
Fix TriCore Python bindings
peace-maker Jun 5, 2023
1da1cbf
Fix RISCV Python bindings
peace-maker Jun 5, 2023
ec48262
Merge pull request #2041 from peace-maker/fix_python_bindings
kabeor Jun 9, 2023
e9fd6f4
Merge pull request #2007 from peace-maker/riscv_insn_groups
kabeor Jun 10, 2023
ac1d85e
capstone.pc.in: re-add capstone include subdirectory via Cflags.
orlitzky Jun 16, 2023
2042a81
capstone.pc.in: use https in the URL.
orlitzky Jun 16, 2023
140b85b
Merge pull request #2046 from orlitzky/pkgconfig-includes
kabeor Jun 16, 2023
5c3171a
update ChangeLog to 5.0.0-rc3
kabeor Jun 17, 2023
ea62eda
Merge branch 'next' of https://github.com/kabeor/capstone into next
kabeor Jun 17, 2023
045171f
Merge pull request #2047 from kabeor/next
kabeor Jun 17, 2023
ba4df3a
Fix TriCore test
hamarituc Jun 17, 2023
f05e4f6
Merge pull request #2049 from hamarituc/tricore-test
kabeor Jun 18, 2023
d6bd312
[workflows] update python-publish
kabeor Jun 18, 2023
434ce5e
Merge branch 'capstone-engine:next' into next
kabeor Jun 18, 2023
c0e5649
[workflows] update python-publish
kabeor Jun 18, 2023
63f70a9
Merge branch 'next' of https://github.com/kabeor/capstone into next
kabeor Jun 18, 2023
ef44d9e
[bindings] fix twine issue when publish
kabeor Jun 18, 2023
5eb935d
[bindings] fix twine issue when publish
kabeor Jun 18, 2023
052c904
[workflows] update actions version
kabeor Jun 18, 2023
3892be2
[workflows] remove manual publish
kabeor Jun 18, 2023
8784a6e
[bindings] Adapt python2 for setup.py
kabeor Jun 18, 2023
58e7ec8
Merge pull request #2050 from kabeor/next
kabeor Jun 18, 2023
acfd58a
Update version tag
kabeor Jun 18, 2023
2bc6610
Merge branch 'capstone-engine:next' into next
kabeor Jun 18, 2023
f5e3ecd
Merge pull request #2052 from kabeor/next
kabeor Jun 18, 2023
f66d2cb
bindings: update binding consts
aquynh Jun 18, 2023
d0ef8ab
README: use https
aquynh Jun 18, 2023
e445f4f
[workflows] Remove deprecated image versions
kabeor Jun 23, 2023
1c5f398
[workflows] Adjust matrix version
kabeor Jun 23, 2023
b9e76dd
Fix capstone_test.c
imbillow Jun 23, 2023
49adaac
Fix const_generator.py and tricore_const.py
imbillow Jun 23, 2023
ef4fff6
Merge pull request #2057 from kabeor/next
kabeor Jun 23, 2023
30bfce3
fix msvc static lib build error
arkup Jun 23, 2023
5be5aa7
fix compile error capstone_dll unresolved external symbol _insn_find
arkup Jun 23, 2023
b39fac7
Fix tricore.h
imbillow Jun 23, 2023
14ea1ae
Update all *_const.py
imbillow Jun 23, 2023
1b1812c
fix static lib to compile with has_tricore
arkup Jun 24, 2023
69e524e
fix msvc dll to compile with has_tricore, plus added CRT_SECURE_NO_WA…
arkup Jun 24, 2023
d971234
Merge pull request #2060 from imbillow/fix-capstone-test
kabeor Jun 24, 2023
34aa92d
Support repz prefix on X86 ret instructions
adamjseitz Jun 24, 2023
24ef1bd
Merge pull request #2063 from adamjseitz/repz-ret
kabeor Jun 25, 2023
9a4cd0d
Merge pull request #2061 from arkup/next
kabeor Jun 25, 2023
3341c1a
use calloc for cs_insn instead of malloc (#1972)
ConnorRigby Jun 26, 2023
0f305ce
Fix access bug for TEST op (#1511)
melynx Jun 26, 2023
752c47b
Update ChangeLog to Version 5.0.0
kabeor Jun 27, 2023
03528d1
Convert Tricore to Intel register syntax
XVilka Jun 28, 2023
eecf95b
Convert Tricore tests to Intel register syntax
XVilka Jun 28, 2023
47f3692
Normalize rc4 version string
peace-maker Jun 28, 2023
19a6093
Search for correct versioned lib .5 suffix
peace-maker Jun 28, 2023
38e03cd
Add CS_GRP_BRANCH_RELATIVE to python bindings
peace-maker Jun 28, 2023
c9964b0
Update Cython bindings
peace-maker Jun 28, 2023
3ba8e54
Merge pull request #2068 from peace-maker/cython_bindings
kabeor Jun 29, 2023
f8f50f0
Merge pull request #2067 from XVilka/tricore-intel-syntax
kabeor Jun 30, 2023
e4d333b
Add `#` prefix to tricore imm operand
imbillow Jul 1, 2023
88c23bc
Update tests and inc files
imbillow Jul 1, 2023
5621567
Merge pull request #2070 from imbillow/tricore-fix
kabeor Jul 1, 2023
1995ddf
Revert "Mark cs_* as thread local to avoid race condition in multithr…
oleavr Jul 1, 2023
53e6814
Update ChangeLog to Version 5.0.0
kabeor Jul 3, 2023
35bc3c0
bindings: update Java consts for Arm64
aquynh Jul 5, 2023
437cd1d
ChangeLog
aquynh Jul 5, 2023
a4effe8
update pkgconfig.mk for 5.0
aquynh Jul 5, 2023
17a1ecb
Remove outdated and irrelevant TODO
XVilka Jul 5, 2023
fe43f08
Replace strncpy with memcpy to fix compiler warning.
Rot127 Jul 5, 2023
abbb723
Merge pull request #2075 from Rot127/sparc-strncpy
kabeor Jul 5, 2023
7fa8eb0
Merge pull request #2074 from XVilka/remove-todo
kabeor Jul 5, 2023
650e85d
Update ChangeLog v5.0 Final
kabeor Jul 5, 2023
f2ffa75
5.0-post1
aquynh Jul 5, 2023
8ae8f68
python: update binding README
aquynh Jul 5, 2023
a7a9a86
[SuperH]: fix IMM format specifier in test (#2080)
XVilka Jul 18, 2023
674abbe
Architecture updater (auto-sync) - Updating ARM (#1949)
Rot127 Jul 19, 2023
7572681
Run clang-format (#2093)
Rot127 Jul 19, 2023
e897c6c
Bumb manylinux version to 2014 (x86) and 2_28 (x86_64) repectivly.
Rot127 Jul 19, 2023
57de96f
Merge pull request #2092 from Rot127/fix-build
kabeor Jul 20, 2023
05124d7
ci: use proper job syntax for Windows
XVilka Jul 20, 2023
2bd076d
Merge pull request #2098 from XVilka/fix-windows-python-ci
kabeor Jul 20, 2023
cd3bc79
Added opcode and operand encoding info for ARM
AngelDev06 May 30, 2023
7dccc50
Added memory operand format for ARM
AngelDev06 Jul 13, 2023
d7a5481
Fixed bug with include order
AngelDev06 Jul 21, 2023
199a7a3
Fixed small bug in reglist encoding
AngelDev06 Jul 21, 2023
04947b6
Replaced numbers with enum values
AngelDev06 Jul 22, 2023
9a371d2
Generated new tables to make operand encoding indexes based on ISA
AngelDev06 Aug 6, 2023
f67fd4d
Made `ARMMapping.c` comply with latest changes
AngelDev06 Aug 6, 2023
4777c9c
Removed outdated part of encoding docstring
AngelDev06 Aug 6, 2023
bfe335b
Removed tmp from `insn_map`
AngelDev06 Aug 6, 2023
56c2a66
Made the encoding of base & offset for post indexed intructions to be…
AngelDev06 Aug 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 4.0-{build}

os:
- Visual Studio 2015

before_build:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

build_script:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=RELEASE -G "NMake Makefiles" ..
- nmake

120 changes: 120 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# SPDX-License-Identifier: GPL-2.0
#
# clang-format configuration file. Intended for clang-format >= 11.
#
# For more information, see:
#
# Documentation/process/clang-format.rst
# https://clang.llvm.org/docs/ClangFormat.html
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
---
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: true
AlignTrailingComments:
Kind: Always
OverEmptyLines: 2
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false

IncludeBlocks: Preserve
IncludeCategories:
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentGotoLabels: false
IndentPPDirectives: None
IndentWidth: 8
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 8
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true

# Taken from git's rules
PenaltyBreakAssignment: 10
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 10
PenaltyExcessCharacter: 100
PenaltyReturnTypeOnItsOwnLine: 60

PointerAlignment: Right
ReflowComments: false
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatementsExceptForEachMacros
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp03
TabWidth: 8
UseTab: Always
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.{py,pyx,pxd}]
indent_style = space
indent_size = 4

# Follow Linux kernel coding style
[*.{c,h,cpp,hpp,inc}]
indent_style = tab
indent_size = 8

# OCaml bindings
[*.ml]
indent_style = tab
indent_size = 4

[Makefile]
indent_style = tab
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/arch/**/*.inc linguist-language=C
149 changes: 149 additions & 0 deletions .github/workflows/CITest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
name: Run Test
on:
push:
paths-ignore:
- ".gitignore"
- "docs/**"
- "ChangeLog"
- "CREDITS.TXT"
- "COMPILE.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-20.04 x64 python3.6 cmake',
os: ubuntu-20.04,
arch: x64,
python-arch: x64,
python-version: '3.6',
build-system: 'cmake',
}
- {
name: 'ubuntu-22.04 x64 python3.9 make',
os: ubuntu-22.04,
arch: x64,
python-arch: x64,
python-version: '3.9',
build-system: 'make',
}
- {
name: 'ubuntu-22.04 x64 python3.9 cmake',
os: ubuntu-22.04,
arch: x64,
python-arch: x64,
python-version: '3.9',
build-system: 'cmake',
}
- {
name: 'ubuntu-22.04 x64 python3.11 cmake',
os: ubuntu-22.04,
arch: x64,
python-arch: x64,
python-version: '3.11',
build-system: 'cmake',
}

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config.python-version }}

- name: prepare
shell: 'script -q -e -c "bash {0}"'
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
git clone https://git.cryptomilk.org/projects/cmocka.git suite/cstest/cmocka
chmod +x suite/cstest/build_cstest.sh

- name: make
if: startsWith(matrix.config.build-system, 'make')
shell: 'script -q -e -c "bash {0}"'
run: |
./make.sh;
make check;
cp libcapstone.so.5 libcapstone.so.5.0
# sudo make install

- name: cmake
if: startsWith(matrix.config.build-system, 'cmake')
shell: 'script -q -e -c "bash {0}"'
run: |
mkdir build && cd build;
cmake -DCAPSTONE_INSTALL=1 -DBUILD_SHARED_LIBS=1 ..;
cmake --build . --config Release;
cp libcapstone.* ../;
# sudo make install;

- name: build python binding
shell: 'script -q -e -c "bash {0}"'
run: |
mkdir -p bindings/python/capstone/lib && cp libcapstone.so.5.* bindings/python/capstone/lib/libcapstone.so;
cd bindings/python;
make && make check ;
cd ../..;

- name: cstest
shell: 'script -q -e -c "bash {0}"'
run: |
cd suite/cstest && ./build_cstest.sh;
python cstest_report.py -D -t build/cstest -d ../MC;
python cstest_report.py -D -t build/cstest -f issues.cs; cd ..;

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
50 changes: 50 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -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
Loading