NAME=aac on non executable sections
# BROKEN=1
FILE=bins/elf/analysis/calls_x64
CMDS=<<EOF
af
e anal.in=bin.sections.x
aac
pdf
EOF
EXPECT=<<EOF
            ;-- section..text:
            ;-- _start:
/ 41: entry0 (int64_t arg3, void *stack_end);
|           ; arg int64_t arg3 @ rdx
|           ; arg void *stack_end @ xmm0
|           0x00400410      31ed           xor ebp, ebp                ; [13] -r-x section size 498 named .text
|           0x00400412      4989d1         mov r9, rdx                 ; arg3
|           0x00400415      5e             pop rsi
|           0x00400416      4889e2         mov rdx, rsp
|           0x00400419      4883e4f0       and rsp, 0xfffffffffffffff0
|           0x0040041d      50             push rax
|           0x0040041e      54             push rsp
|           0x0040041f      49c7c00006..   mov r8, sym.__libc_csu_fini ; 0x400600
|           0x00400426      48c7c19005..   mov rcx, sym.__libc_csu_init ; 0x400590 ; "AWA\x89\xffAVI\x89\xf6AUI\x89\xd5ATL\x8d%p\x01 "
|           0x0040042d      48c7c77405..   mov rdi, main               ; 0x400574 ; "U\xff\x14%X\t`"
\           0x00400434      e8b7ffffff     call sym.imp.__libc_start_main ; int __libc_start_main(func main, int argc, char **ubp_av, func init, func fini, func rtld_fini, void *stack_end)
EOF
RUN

NAME=aac on non executable sections (defaults)
FILE=bins/elf/analysis/calls_x64
CMDS=<<EOF
af
aac
pdf
EOF
EXPECT=<<EOF
            ;-- section..text:
            ;-- _start:
/ 41: entry0 (int64_t arg3, void *stack_end);
|           ; arg int64_t arg3 @ rdx
|           ; arg void *stack_end @ xmm0
|           0x00400410      31ed           xor ebp, ebp                ; [13] -r-x section size 498 named .text
|           0x00400412      4989d1         mov r9, rdx                 ; arg3
|           0x00400415      5e             pop rsi
|           0x00400416      4889e2         mov rdx, rsp
|           0x00400419      4883e4f0       and rsp, 0xfffffffffffffff0
|           0x0040041d      50             push rax
|           0x0040041e      54             push rsp
|           0x0040041f      49c7c00006..   mov r8, sym.__libc_csu_fini ; 0x400600
|           0x00400426      48c7c19005..   mov rcx, sym.__libc_csu_init ; 0x400590 ; "AWA\x89\xffAVI\x89\xf6AUI\x89\xd5ATL\x8d%p\x01 "
|           0x0040042d      48c7c77405..   mov rdi, main               ; 0x400574 ; "U\xff\x14%X\t`"
\           0x00400434      e8b7ffffff     call sym.imp.__libc_start_main ; int __libc_start_main(func main, int argc, char **ubp_av, func init, func fini, func rtld_fini, void *stack_end)
EOF
RUN

NAME=aac on non executable sections (bug)
FILE=bins/elf/analysis/calls_x64
CMDS=<<EOF
e anal.in=io.maps.x
af
aac
pdf
EOF
EXPECT=<<EOF
            ;-- section..text:
            ;-- _start:
/ 34: entry0 (int64_t arg3, void *stack_end);
|           ; arg int64_t arg3 @ rdx
|           ; arg void *stack_end @ xmm0
|           0x00400410      31ed           xor ebp, ebp                ; [13] -r-x section size 498 named .text
|           0x00400412      4989d1         mov r9, rdx                 ; arg3
|           0x00400415      5e             pop rsi
|           0x00400416      4889e2         mov rdx, rsp
|           0x00400419      4883e4f0       and rsp, 0xfffffffffffffff0
|           0x0040041d      50             push rax
|           0x0040041e      54             push rsp
|           0x0040041f      49c7c00006..   mov r8, sym.__libc_csu_fini ; 0x400600
|           0x00400426      48c7c19005..   mov rcx, sym.__libc_csu_init ; 0x400590 ; "AWA\x89\xffAVI\x89\xf6AUI\x89\xd5ATL\x8d%p\x01 "
|           0x0040042d      48             invalid                     ; 0x400574 ; "U\xff\x14%X\t`"
..
EOF
RUN
