rizin/test/db/cmd/cmd_att
NOT XVilka ba8c170852
Migrate from Capstone to Zydis (x86 architecture) (#5164)
* Added build files [Capstone to Zydis]

* x86 Analysis [Capstone to Zydis]

* Changed x86 RzIL [Capstone to Zydis]

* Changed asm and arch files [Capstone to Zydis]

* Compilation, build error and test fixes [Capstone to Zydis]

* Test changes [Capstone to Zydis]

* Remaining changes [Capstone to Zydis]

* Added BE support [Capstone to Zydis]

---------

Co-authored-by: tushar3q34 <tushar3q34@gmail.com>
2025-05-23 13:03:46 +00:00

130 lines
3.3 KiB
Text

NAME=att subrel
FILE=bins/mach0/mac-ls
CMDS=<<EOF
e asm.syntax=att
e asm.lines.bb=0
e asm.bytes=0
e asm.comments=false
pd 20
EOF
EXPECT=<<EOF
;-- main:
;-- entry0:
;-- func.100001058:
0x100001058 push %rbp
0x100001059 mov %rsp, %rbp
0x10000105c push %r15
0x10000105e push %r14
0x100001060 push %r13
0x100001062 push %r12
0x100001064 push %rbx
0x100001065 sub $0x648, %rsp
0x10000106c mov %rsi, %rbx
0x10000106f mov %edi, %r14d
0x100001072 lea -0x640(%rbp), %rax
0x100001079 movq %rax, -0x648(%rbp)
0x100001080 test %r14d, %r14d
0x100001083 jnle 0x10000108a
0x100001085 call sym.func.100004401
0x10000108a lea section.4.__TEXT.__cstring, %rsi
0x100001091 xor %edi, %edi
0x100001093 call sym.imp.setlocale
0x100001098 mov $0x01, %r13d
0x10000109e mov $0x01, %edi
EOF
RUN
NAME=att varsub
FILE=bins/mach0/mac-ls
CMDS=<<EOF
af
e asm.syntax=att
e asm.var=0
e asm.lines.bb=0
e asm.bytes=0
e asm.comments=false
pd 20
EOF
EXPECT=<<EOF
;-- entry0:
;-- func.100001058:
/ int main(int argc, char **argv, char **envp);
| 0x100001058 push %rbp
| 0x100001059 mov %rsp, %rbp
| 0x10000105c push %r15
| 0x10000105e push %r14
| 0x100001060 push %r13
| 0x100001062 push %r12
| 0x100001064 push %rbx
| 0x100001065 sub $0x648, %rsp
| 0x10000106c mov %rsi, %rbx
| 0x10000106f mov %edi, %r14d
| 0x100001072 lea var_648h, %rax
| 0x100001079 movq %rax, var_650h
| 0x100001080 test %r14d, %r14d
| 0x100001083 jnle 0x10000108a
| 0x100001085 call sym.func.100004401
| 0x10000108a lea section.4.__TEXT.__cstring, %rsi
| 0x100001091 xor %edi, %edi
| 0x100001093 call sym.imp.setlocale
| 0x100001098 mov $0x01, %r13d
| 0x10000109e mov $0x01, %edi
EOF
RUN
NAME=att varsub 2
FILE=bins/elf/varsub
CMDS=<<EOF
aa; s main
e asm.syntax=att
e asm.var=0
e asm.lines.bb=0
e asm.bytes=0
e asm.comments=false
pdf
EOF
EXPECT=<<EOF
/ int main(int argc, char **argv, char **envp);
| 0x004004a6 push %rbp
| 0x004004a7 mov %rsp, %rbp
| 0x004004aa movq var_10h + 0x10, %rax
| 0x004004af movq var_10h, %rax
| 0x004004b4 movq var_10h + 0x10, %rax
| 0x004004b8 movq var_10h, %rax
| 0x004004bc movq arg_10h, %rax
| 0x004004c1 movq var_20h, %rax
| 0x004004c6 movq arg_10h, %rax
| 0x004004ca movq var_20h, %rax
| 0x004004ce leave
\ 0x004004cf ret
EOF
RUN
NAME=att varsub 2 with asm.sub.varonly disabled
FILE=bins/elf/varsub
CMDS=<<EOF
aa; s main
e asm.syntax=att
e asm.var=0
e asm.lines.bb=0
e asm.bytes=0
e asm.comments=false
e asm.sub.varonly=false
pdf
EOF
EXPECT=<<EOF
/ int main(int argc, char **argv, char **envp);
| 0x004004a6 push %rbp
| 0x004004a7 mov %rsp, %rbp
| 0x004004aa movq var_10h + 0x10(%rsp), %rax
| 0x004004af movq var_10h(%rsp), %rax
| 0x004004b4 movq var_10h + 0x10(%rbp), %rax
| 0x004004b8 movq var_10h(%rbp), %rax
| 0x004004bc movq arg_10h(%rsp), %rax
| 0x004004c1 movq var_20h(%rsp), %rax
| 0x004004c6 movq arg_10h(%rbp), %rax
| 0x004004ca movq var_20h(%rbp), %rax
| 0x004004ce leave
\ 0x004004cf ret
EOF
RUN