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

[PPC/ARM] Update to Capstone v6/auto-sync #3648

Merged
merged 106 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
972fc8b
[REVERT ME] Add auto-sync Capstone
Rot127 Jun 19, 2023
3ccd09c
Fix ARM identifiers and API changes.
Rot127 Jun 19, 2023
d21314d
Add auto-sync packagefile
Rot127 Jun 19, 2023
18e87c0
Rename registers
Rot127 Jun 19, 2023
e00ac0b
Set option for CS register alias.
Rot127 Jun 21, 2023
0ec0290
Fix: Shift amounts are always decimal.
Rot127 Jun 21, 2023
7a98e4e
Remove code which handles fixed CS issue.
Rot127 Jun 26, 2023
4c6583f
Use mem disp which is a member of the member operand.
Rot127 Jun 26, 2023
d70f2bb
Get register and imm memory disponent.
Rot127 Jun 26, 2023
144c0c7
Remove duplicate extension
Rot127 Jun 29, 2023
c21d0a5
Check for subtracted flag.
Rot127 Jun 29, 2023
846d1e4
Determine post writeback by CS em operand flag.
Rot127 Jul 1, 2023
092ff34
Add VPOP and VPUSH again.
Rot127 Jul 2, 2023
34d746a
Check for subtracted flag if disp is added to PC
Rot127 Jul 3, 2023
24c86e6
Fix hex <-> decimal tests and off by one
Rot127 Jul 3, 2023
62c2f03
Print immediates ins signed form as LLVM does.
Rot127 Jul 3, 2023
31dd8cc
Fix tests wit equivalent results
Rot127 Jul 3, 2023
ed1c500
Revert use of subtracted flag and move it into the macro
Rot127 Jul 4, 2023
807b753
Check for VPT blocks.
Rot127 Jul 4, 2023
6c40cfe
Fix more incorrect usages of mem disponents
Rot127 Jul 5, 2023
39a2b0c
Fix restoring of condition codes.
Rot127 Jul 5, 2023
2ca8cbb
Test for shifting via registers.
Rot127 Jul 5, 2023
2d6a55a
Fix: mem index is no longer its own operand.
Rot127 Jul 5, 2023
ff6003b
Update ids for new ones
Rot127 Jul 5, 2023
a6a6fa4
Fix another memdisp post_index bug
Rot127 Jul 6, 2023
f157c57
Formatting
Rot127 Jul 6, 2023
dc32b61
Another post_index
Rot127 Jul 6, 2023
3a7e928
Fix 8 byte stores.
Rot127 Jul 6, 2023
53c9784
Add flag checking for MOV with shifts.
Rot127 Jul 6, 2023
838ceba
Revert "[REVERT ME] Add auto-sync Capstone"
Rot127 Jul 20, 2023
9b7ff2c
Remove capstone-auto-sync subproject and replace with next
Rot127 Jul 20, 2023
caee23d
Fix rebase mistakes
Rot127 Jul 20, 2023
dcf1061
Check for NEON features.
Rot127 Jul 20, 2023
3074477
Fix tests where ldr was replaced with pop
Rot127 Jul 21, 2023
421b5ef
Fix postindex 8byte store
Rot127 Jul 21, 2023
de3ef5f
Remove unreachable code for ESIL LDR.
Rot127 Jul 21, 2023
2e97994
Fix flag check/set of mov instructions with shift.
Rot127 Jul 21, 2023
28dba41
Check for subtracted flag of mem.disp.
Rot127 Jul 21, 2023
28a248c
Use macro for disp access
Rot127 Jul 22, 2023
1a62ef9
Fix function variable recognition.
Rot127 Jul 22, 2023
4632b0f
Fix json tests
Rot127 Jul 22, 2023
b8106ca
Fix new id
Rot127 Jul 22, 2023
ae21fb8
Fix post-index ldrd esil instructions
Rot127 Jul 22, 2023
595dd31
Fix ARM64 tests by separating their esil condition code.
Rot127 Jul 22, 2023
a2fa523
Fix shift of post index stores
Rot127 Jul 22, 2023
f6d5a28
Fix more post index memory instructions.
Rot127 Jul 22, 2023
cd03ae7
Fix invalid variable recognition.
Rot127 Jul 22, 2023
a3504be
Use https://github.com/capstone-engine/capstone/pull/2122 for better …
Rot127 Jul 23, 2023
f92d0eb
Distinguish between 32 and 64bit cc check.
Rot127 Jul 23, 2023
c00cb89
Check for CS API version >5
Rot127 Jul 23, 2023
e715409
Check for CS_NEXT_VERSION instead of CS_API_MAJOR.
Rot127 Jul 24, 2023
5f8c6a7
Fix VSTn and VLDn instructions to use corrected memory operands.
Rot127 Sep 7, 2023
81e7baa
Fix incorrect tests with missing writeback due to missing post-index …
Rot127 Sep 7, 2023
c85eb8c
[REVERT ME] Add auto-sync-ppc dev branch to build options.
Rot127 Jul 8, 2023
30f1ca1
Exclude multiple instruction alias which are no longer a valid id
Rot127 Jul 20, 2023
583cb34
Use CS_NEXT_VERSION as include guard.
Rot127 Jul 24, 2023
3883cb4
Warp removed instruction alias into include guards.
Rot127 Jul 24, 2023
363c91f
Add CS v6 include guards.
Rot127 Jul 25, 2023
1d6d376
Add CS v6 support to branch conditions for Rzil.
Rot127 Jul 25, 2023
4edad23
Add more CSv6 guards.
Rot127 Jul 25, 2023
f98a03b
Handle PPC_REG_ZERO case
Rot127 Jul 26, 2023
cfe8b74
Fix: Compare instr. do not use the branch predicate.
Rot127 Jul 26, 2023
a8c2ec1
Check for LR def by read_regs
Rot127 Jul 26, 2023
3aa54f3
Fix conditional and ctr checks
Rot127 Jul 26, 2023
0cc7c9f
Handle XNOP
Rot127 Jul 26, 2023
ededae5
Remove old replacement for alias code.
Rot127 Jul 26, 2023
646edda
Fix MTSPR and MFSPR instructions.
Rot127 Jul 26, 2023
61d8fa9
Don't use CS v5 code for every version < 6
Rot127 Jul 27, 2023
96176de
Exclude more branch alias no longer present in v6 from switch cases.
Rot127 Jul 29, 2023
6171c46
Exclude unused functions get_crx_*
Rot127 Jul 29, 2023
a69958b
Fix incorrectly assigned variables.
Rot127 Jul 29, 2023
d7c7dae
Fix condition checks for branches.
Rot127 Jul 29, 2023
a1b8650
Use ITE for condition checks, to prevent not necessary reads of CTR o…
Rot127 Jul 30, 2023
27b3e49
Fix rzil tests with new semantic using register 0
Rot127 Jul 30, 2023
8161c76
Update include guards for Capstone versions to use CS_NEXT_VERSION.
Rot127 Aug 24, 2023
e69678c
Init spr_name to prevent unitialized use.
Rot127 Sep 8, 2023
4831230
Use mem.offset register for CSv6
Rot127 Sep 8, 2023
6459638
Always use real operand details.
Rot127 Sep 8, 2023
83d6929
Use mem operand for DCBZ
Rot127 Sep 8, 2023
765c04c
Fix tests which are semantical identical.
Rot127 Sep 8, 2023
96fdfc5
Handle LI LIS alias
Rot127 Sep 8, 2023
efc3d11
Fix rzil tests (with simplified semantics)
Rot127 Sep 14, 2023
6e4c343
Fix branch alias with new cond test method.
Rot127 Sep 14, 2023
32b654d
Handle clrl. alias
Rot127 Sep 14, 2023
0af402d
Handle SL/SR alias
Rot127 Sep 14, 2023
424afb4
Fix conditional braches in ESIL.
Rot127 Sep 14, 2023
d9fba14
Fix possible multiplication result overflow.
Rot127 Sep 14, 2023
bc3b743
Set capstone-next to newest commit .
Rot127 Sep 20, 2023
2b19e02
Add RZ_NONNULL
Rot127 Sep 20, 2023
84c5ceb
Use Capstone's next branch as default branch
Rot127 Sep 20, 2023
d75e11b
Run clang-format
Rot127 Sep 20, 2023
c12f3c5
Add 0 register
Rot127 Sep 20, 2023
5d4dc79
Handle LIS alias
Rot127 Sep 20, 2023
afa18ac
Fix: Print crX reg name in CS v6
Rot127 Sep 20, 2023
d5625b0
Handle all general branch instructions into a single case statement.
Rot127 Sep 20, 2023
1061887
Fix no semantic issues in tests.
Rot127 Sep 20, 2023
16f1aa0
Add new discovered calls
Rot127 Sep 20, 2023
e843fcb
Move direction check to inline functoin.
Rot127 Sep 21, 2023
f55a264
Add link of root cause for broken test.
Rot127 Sep 21, 2023
c60f9f6
Add QPX support.
Rot127 Sep 21, 2023
a47fea1
Set Capstone next branch to latest commit.
Rot127 Sep 22, 2023
a9c62ab
Run clang-format
Rot127 Sep 22, 2023
dc905df
Fix uninitialized warning.
Rot127 Sep 22, 2023
466f2af
Set CS next branch to newes commit
Rot127 Sep 25, 2023
697de35
Remove CS auto-sync subproject branches.
Rot127 Sep 25, 2023
8bfc691
Set correct commit hash
Rot127 Sep 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions librz/analysis/arch/arm/arm_accessors32.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
// s/index/base|reg/
#define HASMEMINDEX(x) (insn->detail->arm.operands[x].mem.index != ARM_REG_INVALID)
#define ISMEMINDEXSUB(x) insn->detail->arm.operands[x].subtracted
#define MEMDISP(x) insn->detail->arm.operands[x].mem.disp
#define MEMDISP(x) (ISMEMINDEXSUB(x) ? -insn->detail->arm.operands[x].mem.disp : insn->detail->arm.operands[x].mem.disp)
#define MEMDISP_BV(x) (HASMEMINDEX(x) ? REG_VAL(insn->detail->arm.operands[x].mem.index) : U32(MEMDISP(x)))
#define ISIMM(x) (insn->detail->arm.operands[x].type == ARM_OP_IMM || insn->detail->arm.operands[x].type == ARM_OP_FP)
#define ISREG(x) (insn->detail->arm.operands[x].type == ARM_OP_REG)
#define ISPSRFLAGS(x) (insn->detail->arm.operands[x].type == ARM_OP_CPSR || insn->detail->arm.operands[x].type == ARM_OP_SPSR)
#define ISMEM(x) (insn->detail->arm.operands[x].type == ARM_OP_MEM)
#define ISFPIMM(x) (insn->detail->arm.operands[x].type == ARM_OP_FP)

Expand All @@ -38,6 +40,7 @@
SHIFTTYPE(x) == ARM_SFT_RRX_REG)
#define SHIFTVALUE(x) insn->detail->arm.operands[x].shift.value

#define ISWRITEBACK32() insn->detail->arm.writeback
#define ISPREINDEX32() (((OPCOUNT() == 2) && (ISMEM(1)) && (ISWRITEBACK32())) || ((OPCOUNT() == 3) && (ISMEM(2)) && (ISWRITEBACK32())))
#define ISPOSTINDEX32() (((OPCOUNT() == 3) && (ISIMM(2) || ISREG(2)) && (ISWRITEBACK32())) || ((OPCOUNT() == 4) && (ISIMM(3) || ISREG(3)) && (ISWRITEBACK32())))
#define ISPOSTINDEX() insn->detail->arm.post_index
#define ISWRITEBACK32() insn->detail->writeback
#define ISPREINDEX32() (((OPCOUNT() == 2) && (ISMEM(1)) && (ISWRITEBACK32()) && (!ISPOSTINDEX())) || \
((OPCOUNT() == 3) && (ISMEM(2)) && (ISWRITEBACK32()) && (!ISPOSTINDEX())))
5 changes: 4 additions & 1 deletion librz/analysis/arch/arm/arm_cs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
RZ_IPI int rz_arm_cs_analysis_op_32_esil(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8 *buf, int len, csh *handle, cs_insn *insn, bool thumb);
RZ_IPI int rz_arm_cs_analysis_op_64_esil(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8 *buf, int len, csh *handle, cs_insn *insn);

RZ_IPI const char *rz_arm_cs_esil_prefix_cond(RzAnalysisOp *op, int cond_type);
RZ_IPI bool rz_arm_cs_is_group_member(RZ_NONNULL const cs_insn *insn, arm_insn_group feature);

RZ_IPI const char *rz_arm32_cs_esil_prefix_cond(RzAnalysisOp *op, ARMCC_CondCodes cond_type);
RZ_IPI const char *rz_arm64_cs_esil_prefix_cond(RzAnalysisOp *op, arm64_cc cond_type);

RZ_IPI RzILOpEffect *rz_arm_cs_32_il(csh *handle, cs_insn *insn, bool thumb);
RZ_IPI RzAnalysisILConfig *rz_arm_cs_32_il_config(bool big_endian);
Expand Down
Loading
Loading