NAME=pdf dwarf
FILE=bins/elf/analysis/main
CMDS=<<EOF
fs *
fl~str.
EOF
EXPECT=<<EOF
0x004002e1 10 str.libc.so.6
0x004002eb 5 str.puts
0x004002f0 18 str.libc_start_main
0x00400302 15 str.gmon_start
0x00400311 12 str.GLIBC_2.2.5
0x004005c4 12 str.Hello_World
EOF
RUN

NAME=iz (utf-16)
FILE=bins/elf/analysis/hello-utf-16
CMDS=<<EOF
iz~Hello
fl@F:strings
s sym.main
af
pdf~str.Hello
aar
fl@F:strings
EOF
EXPECT=<<EOF
0x000005e8 0x004005e8  11   24 .rodata utf16le Hello World
0x00400319 10 str.libc.so.6
0x00400323 8 str.wprintf
0x0040032b 18 str.libc_start_main
0x0040033d 15 str.gmon_start
0x0040034c 12 str.GLIBC_2.2.5
0x004005e8 24 str.Hello_World
0x00400608 14 str.S
| 0x0040052e      mov   qword [var_10h], str.Hello_World               ; 0x4005e8 ; u"\U0000feffHello World\U0000feff\n"
0x00400319 10 str.libc.so.6
0x00400323 8 str.wprintf
0x0040032b 18 str.libc_start_main
0x0040033d 15 str.gmon_start
0x0040034c 12 str.GLIBC_2.2.5
0x004005e8 24 str.Hello_World
0x00400608 14 str.S
EOF
RUN

NAME=iz (utf-32)
FILE=bins/elf/analysis/hello-utf-32
CMDS=<<EOF
iz~Hello
fl@F:strings
s sym.main
af
pdf~str.Hello
aar
fl@F:strings
EOF
EXPECT=<<EOF
0x000005e8 0x004005e8  11   48 .rodata utf32le Hello World
0x00400319 10 str.libc.so.6
0x00400323 8 str.wprintf
0x0040032b 18 str.libc_start_main
0x0040033d 15 str.gmon_start
0x0040034c 12 str.GLIBC_2.2.5
0x004005e8 48 str.Hello_World
0x00400628 28 str.S
| 0x0040052e      mov   qword [var_10h], str.Hello_World               ; 0x4005e8 ; U"\U0000feffHello World\U0000feff\n"
0x00400319 10 str.libc.so.6
0x00400323 8 str.wprintf
0x0040032b 18 str.libc_start_main
0x0040033d 15 str.gmon_start
0x0040034c 12 str.GLIBC_2.2.5
0x004005e8 48 str.Hello_World
0x00400628 28 str.S
EOF
RUN

NAME=iz (utf-16le)
FILE=bins/elf/analysis/hello-utf-16le
CMDS=<<EOF
iz~Hello
fl@F:strings
s sym.main
af
pdf~str.Hello
aar
fl@F:strings
EOF
EXPECT=<<EOF
0x000005e4 0x004005e4  12   26 .rodata utf16le Hello World\n
0x00400319 10 str.libc.so.6
0x00400323 8 str.wprintf
0x0040032b 18 str.libc_start_main
0x0040033d 15 str.gmon_start
0x0040034c 12 str.GLIBC_2.2.5
0x004005e4 26 str.Hello_World
0x00400600 16 str.S
| 0x0040052e      mov   qword [var_10h], str.Hello_World               ; 0x4005e4 ; u"Hello World\n"
0x00400319 10 str.libc.so.6
0x00400323 8 str.wprintf
0x0040032b 18 str.libc_start_main
0x0040033d 15 str.gmon_start
0x0040034c 12 str.GLIBC_2.2.5
0x004005e4 26 str.Hello_World
0x00400600 16 str.S
EOF
RUN

NAME=iz (utf-32le)
FILE=bins/elf/analysis/hello-utf-32le
CMDS=<<EOF
iz~Hello
fl@F:strings
s sym.main
af
pdf~str.Hello
aar
fl@F:strings
EOF
EXPECT=<<EOF
0x000005e8 0x004005e8  12   52 .rodata utf32le Hello World\n
0x00400319 10 str.libc.so.6
0x00400323 8 str.wprintf
0x0040032b 18 str.libc_start_main
0x0040033d 15 str.gmon_start
0x0040034c 12 str.GLIBC_2.2.5
0x004005e8 52 str.Hello_World
0x00400620 32 str.S
| 0x0040052e      mov   qword [var_10h], str.Hello_World               ; 0x4005e8 ; U"Hello World\n"
0x00400319 10 str.libc.so.6
0x00400323 8 str.wprintf
0x0040032b 18 str.libc_start_main
0x0040033d 15 str.gmon_start
0x0040034c 12 str.GLIBC_2.2.5
0x004005e8 52 str.Hello_World
0x00400620 32 str.S
EOF
RUN
