Fix /ai on arm64 movs ##search (#19038)

This commit is contained in:
pancake 2021-08-31 15:08:21 +02:00 committed by GitHub
parent 888ba87878
commit 9c2bd20abf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

View File

@ -3340,6 +3340,9 @@ static void anop64(csh handle, RAnalOp *op, cs_insn *insn) {
case ARM64_INS_BFI:
case ARM64_INS_BFXIL:
op->type = R_ANAL_OP_TYPE_MOV;
if (ISIMM64 (1)) {
op->val = IMM64(1);
}
break;
case ARM64_INS_MRS:
case ARM64_INS_MSR:

View File

@ -79,6 +79,30 @@ EXPECT=<<EOF
EOF
RUN
NAME=/ai arm64 finding immediates
FILE=bins/mach0/BatteryLife.arm_64.1
CMDS=/ai 0x100
EXPECT=<<EOF
0x10000f9cc ff0304d1 sub sp, sp, 0x100
0x100011030 01208072 movk w1, 0x100
0x100011078 01208072 movk w1, 0x100
0x1000110c0 03208072 movk w3, 0x100
0x100011a50 02208072 movk w2, 0x100
0x100011ac4 02208072 movk w2, 0x100
0x100011b38 02208072 movk w2, 0x100
0x100013704 02208072 movk w2, 0x100
0x10006cb40 ff0304d1 sub sp, sp, 0x100
0x100072594 04208072 movk w4, 0x100
0x10007856c ff0304d1 sub sp, sp, 0x100
0x10009b4e8 ff0304d1 sub sp, sp, 0x100
0x1000bfc00 04208072 movk w4, 0x100
0x1000f24d0 ff0304d1 sub sp, sp, 0x100
0x1000f3854 ff0304d1 sub sp, sp, 0x100
0x1000f8efc ff0304d1 sub sp, sp, 0x100
0x1000fbc14 ff0304d1 sub sp, sp, 0x100
EOF
RUN
NAME=/as begin of file
FILE=bins/pe/a.exe
ARGS=-n