logo

utils-std

Collection of commonly available Unix tools
commit: 9528d4c259687a5cf9d1afb51638f9d057a299a9
parent 67e7c2de053047dee2d2447b1abfa19eb15e152b
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu,  1 Aug 2024 07:22:59 +0200

test-cmd/strings.sh: Replace true blob with custom made length file

Diffstat:

Atest-cmd/inputs/strings/length0
Atest-cmd/inputs/strings/length.sh8++++++++
Dtest-cmd/inputs/strings/true0
Atest-cmd/outputs/strings/length_8_td2++
Atest-cmd/outputs/strings/length_8_to2++
Atest-cmd/outputs/strings/length_8_tx2++
Atest-cmd/outputs/strings/length_td6++++++
Atest-cmd/outputs/strings/length_to6++++++
Atest-cmd/outputs/strings/length_tx6++++++
Dtest-cmd/outputs/strings/true91-------------------------------------------------------------------------------
Dtest-cmd/outputs/strings/true_865-----------------------------------------------------------------
Dtest-cmd/outputs/strings/true_8_td65-----------------------------------------------------------------
Dtest-cmd/outputs/strings/true_8_to65-----------------------------------------------------------------
Dtest-cmd/outputs/strings/true_8_tx65-----------------------------------------------------------------
Dtest-cmd/outputs/strings/true_td91-------------------------------------------------------------------------------
Dtest-cmd/outputs/strings/true_to91-------------------------------------------------------------------------------
Dtest-cmd/outputs/strings/true_tx91-------------------------------------------------------------------------------
Mtest-cmd/strings.sh29+++++++++++++++++++----------
18 files changed, 51 insertions(+), 634 deletions(-)

diff --git a/test-cmd/inputs/strings/length b/test-cmd/inputs/strings/length Binary files differ. diff --git a/test-cmd/inputs/strings/length.sh b/test-cmd/inputs/strings/length.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me> +# SPDX-License-Identifier: MPL-2.0 + +for i in $(seq 1 9) +do + printf '%*s\0' "$i" "$i" | tr ' ' '_' +done > "${0%.sh}" diff --git a/test-cmd/inputs/strings/true b/test-cmd/inputs/strings/true Binary files differ. diff --git a/test-cmd/outputs/strings/length_8_td b/test-cmd/outputs/strings/length_8_td @@ -0,0 +1,2 @@ +35 _______8 +44 ________9 diff --git a/test-cmd/outputs/strings/length_8_to b/test-cmd/outputs/strings/length_8_to @@ -0,0 +1,2 @@ +43 _______8 +54 ________9 diff --git a/test-cmd/outputs/strings/length_8_tx b/test-cmd/outputs/strings/length_8_tx @@ -0,0 +1,2 @@ +23 _______8 +2c ________9 diff --git a/test-cmd/outputs/strings/length_td b/test-cmd/outputs/strings/length_td @@ -0,0 +1,6 @@ +9 ___4 +14 ____5 +20 _____6 +27 ______7 +35 _______8 +44 ________9 diff --git a/test-cmd/outputs/strings/length_to b/test-cmd/outputs/strings/length_to @@ -0,0 +1,6 @@ +11 ___4 +16 ____5 +24 _____6 +33 ______7 +43 _______8 +54 ________9 diff --git a/test-cmd/outputs/strings/length_tx b/test-cmd/outputs/strings/length_tx @@ -0,0 +1,6 @@ +9 ___4 +e ____5 +14 _____6 +1b ______7 +23 _______8 +2c ________9 diff --git a/test-cmd/outputs/strings/true b/test-cmd/outputs/strings/true @@ -1,91 +0,0 @@ -/lib64/ld-linux-x86-64.so.2 -__cxa_finalize -__libc_start_main -libc.so.6 -GLIBC_2.2.5 -_ITM_deregisterTMCloneTable -__gmon_start__ -_ITM_registerTMCloneTable -AUATI -[]A\A]A^A_ -;*3$" -GCC: (Gentoo Hardened 10.3.0-r2 p3) 10.3.0 -GCC: (Gentoo Hardened 11.2.0 p1) 11.2.0 -/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/include -elf-init.c -stddef.h -f.... -GNU C99 11.2.0 -mtune=generic -march=x86-64 -g -O2 -std=c99 -main -long long int -GNU C11 10.3.0 -march=znver1 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -msse4a -mcx16 -msahf -mmovbe -maes -msha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mmwaitx -mclzero -mno-pku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-avx512vpopcntdq -mno-movdiri -mno-movdir64b -mno-waitpkg -mno-cldemote -mno-ptwrite -mno-avx512bf16 -mno-enqcmd -mno-avx512vp2intersect --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=512 -mtune=znver1 -m64 -ggdb -ggdb -O2 -O2 -std=gnu11 -fgnu89-inline -fmerge-all-constants -frounding-math -fstack-protector-strong -fmath-errno -fno-stack-protector -fPIC -fstack-protector-strong -ftls-model=initial-exec -size_t -__init_array_start -/var/tmp/portage/sys-libs/glibc-2.33-r7/work/glibc-2.33/csu -envp -elf-init.c -long unsigned int -__libc_csu_fini -char -argc -size -__libc_csu_init -argv -long double -__init_array_end -true.c -/home/haelwenn/Sources/git/hacktivis.me/git/utils/bin -true.c -elf-init.c -__init_array_end -_DYNAMIC -__init_array_start -__GNU_EH_FRAME_HDR -_GLOBAL_OFFSET_TABLE_ -__libc_csu_fini -_ITM_deregisterTMCloneTable -_edata -__libc_start_main@GLIBC_2.2.5 -__data_start -__gmon_start__ -__dso_handle -_IO_stdin_used -__libc_csu_init -__bss_start -main -__TMC_END__ -_ITM_registerTMCloneTable -__cxa_finalize@GLIBC_2.2.5 -.symtab -.strtab -.shstrtab -.interp -.note.ABI-tag -.gnu.hash -.dynsym -.dynstr -.gnu.version -.gnu.version_r -.rela.dyn -.init -.plt -.plt.got -.text -.fini -.rodata -.eh_frame_hdr -.eh_frame -.init_array -.fini_array -.dynamic -.data -.bss -.comment -.debug_aranges -.debug_info -.debug_abbrev -.debug_line -.debug_str -.debug_loc -.debug_line_str -.debug_rnglists diff --git a/test-cmd/outputs/strings/true_8 b/test-cmd/outputs/strings/true_8 @@ -1,65 +0,0 @@ -/lib64/ld-linux-x86-64.so.2 -__cxa_finalize -__libc_start_main -libc.so.6 -GLIBC_2.2.5 -_ITM_deregisterTMCloneTable -__gmon_start__ -_ITM_registerTMCloneTable -[]A\A]A^A_ -GCC: (Gentoo Hardened 10.3.0-r2 p3) 10.3.0 -GCC: (Gentoo Hardened 11.2.0 p1) 11.2.0 -/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/include -elf-init.c -stddef.h -GNU C99 11.2.0 -mtune=generic -march=x86-64 -g -O2 -std=c99 -long long int -GNU C11 10.3.0 -march=znver1 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -msse4a -mcx16 -msahf -mmovbe -maes -msha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mmwaitx -mclzero -mno-pku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-avx512vpopcntdq -mno-movdiri -mno-movdir64b -mno-waitpkg -mno-cldemote -mno-ptwrite -mno-avx512bf16 -mno-enqcmd -mno-avx512vp2intersect --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=512 -mtune=znver1 -m64 -ggdb -ggdb -O2 -O2 -std=gnu11 -fgnu89-inline -fmerge-all-constants -frounding-math -fstack-protector-strong -fmath-errno -fno-stack-protector -fPIC -fstack-protector-strong -ftls-model=initial-exec -__init_array_start -/var/tmp/portage/sys-libs/glibc-2.33-r7/work/glibc-2.33/csu -elf-init.c -long unsigned int -__libc_csu_fini -__libc_csu_init -long double -__init_array_end -/home/haelwenn/Sources/git/hacktivis.me/git/utils/bin -elf-init.c -__init_array_end -_DYNAMIC -__init_array_start -__GNU_EH_FRAME_HDR -_GLOBAL_OFFSET_TABLE_ -__libc_csu_fini -_ITM_deregisterTMCloneTable -__libc_start_main@GLIBC_2.2.5 -__data_start -__gmon_start__ -__dso_handle -_IO_stdin_used -__libc_csu_init -__bss_start -__TMC_END__ -_ITM_registerTMCloneTable -__cxa_finalize@GLIBC_2.2.5 -.shstrtab -.note.ABI-tag -.gnu.hash -.gnu.version -.gnu.version_r -.rela.dyn -.plt.got -.eh_frame_hdr -.eh_frame -.init_array -.fini_array -.dynamic -.comment -.debug_aranges -.debug_info -.debug_abbrev -.debug_line -.debug_str -.debug_loc -.debug_line_str -.debug_rnglists diff --git a/test-cmd/outputs/strings/true_8_td b/test-cmd/outputs/strings/true_8_td @@ -1,65 +0,0 @@ -680 /lib64/ld-linux-x86-64.so.2 -929 __cxa_finalize -944 __libc_start_main -962 libc.so.6 -972 GLIBC_2.2.5 -984 _ITM_deregisterTMCloneTable -1012 __gmon_start__ -1027 _ITM_registerTMCloneTable -4553 []A\A]A^A_ -12304 GCC: (Gentoo Hardened 10.3.0-r2 p3) 10.3.0 -12347 GCC: (Gentoo Hardened 11.2.0 p1) 11.2.0 -13435 /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/include -13484 elf-init.c -13498 stddef.h -13655 GNU C99 11.2.0 -mtune=generic -march=x86-64 -g -O2 -std=c99 -13720 long long int -13734 GNU C11 10.3.0 -march=znver1 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -msse4a -mcx16 -msahf -mmovbe -maes -msha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mmwaitx -mclzero -mno-pku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-avx512vpopcntdq -mno-movdiri -mno-movdir64b -mno-waitpkg -mno-cldemote -mno-ptwrite -mno-avx512bf16 -mno-enqcmd -mno-avx512vp2intersect --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=512 -mtune=znver1 -m64 -ggdb -ggdb -O2 -O2 -std=gnu11 -fgnu89-inline -fmerge-all-constants -frounding-math -fstack-protector-strong -fmath-errno -fno-stack-protector -fPIC -fstack-protector-strong -ftls-model=initial-exec -14905 __init_array_start -14924 /var/tmp/portage/sys-libs/glibc-2.33-r7/work/glibc-2.33/csu -14989 elf-init.c -15000 long unsigned int -15018 __libc_csu_fini -15049 __libc_csu_init -15070 long double -15082 __init_array_end -15473 /home/haelwenn/Sources/git/hacktivis.me/git/utils/bin -16232 elf-init.c -16243 __init_array_end -16260 _DYNAMIC -16269 __init_array_start -16288 __GNU_EH_FRAME_HDR -16307 _GLOBAL_OFFSET_TABLE_ -16329 __libc_csu_fini -16345 _ITM_deregisterTMCloneTable -16380 __libc_start_main@GLIBC_2.2.5 -16410 __data_start -16423 __gmon_start__ -16438 __dso_handle -16451 _IO_stdin_used -16466 __libc_csu_init -16482 __bss_start -16499 __TMC_END__ -16511 _ITM_registerTMCloneTable -16537 __cxa_finalize@GLIBC_2.2.5 -16581 .shstrtab -16599 .note.ABI-tag -16613 .gnu.hash -16639 .gnu.version -16652 .gnu.version_r -16667 .rela.dyn -16688 .plt.got -16717 .eh_frame_hdr -16731 .eh_frame -16741 .init_array -16753 .fini_array -16765 .dynamic -16785 .comment -16794 .debug_aranges -16809 .debug_info -16821 .debug_abbrev -16835 .debug_line -16847 .debug_str -16858 .debug_loc -16869 .debug_line_str -16885 .debug_rnglists diff --git a/test-cmd/outputs/strings/true_8_to b/test-cmd/outputs/strings/true_8_to @@ -1,65 +0,0 @@ -1250 /lib64/ld-linux-x86-64.so.2 -1641 __cxa_finalize -1660 __libc_start_main -1702 libc.so.6 -1714 GLIBC_2.2.5 -1730 _ITM_deregisterTMCloneTable -1764 __gmon_start__ -2003 _ITM_registerTMCloneTable -10711 []A\A]A^A_ -30020 GCC: (Gentoo Hardened 10.3.0-r2 p3) 10.3.0 -30073 GCC: (Gentoo Hardened 11.2.0 p1) 11.2.0 -32173 /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/include -32254 elf-init.c -32272 stddef.h -32527 GNU C99 11.2.0 -mtune=generic -march=x86-64 -g -O2 -std=c99 -32630 long long int -32646 GNU C11 10.3.0 -march=znver1 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -msse4a -mcx16 -msahf -mmovbe -maes -msha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mmwaitx -mclzero -mno-pku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-avx512vpopcntdq -mno-movdiri -mno-movdir64b -mno-waitpkg -mno-cldemote -mno-ptwrite -mno-avx512bf16 -mno-enqcmd -mno-avx512vp2intersect --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=512 -mtune=znver1 -m64 -ggdb -ggdb -O2 -O2 -std=gnu11 -fgnu89-inline -fmerge-all-constants -frounding-math -fstack-protector-strong -fmath-errno -fno-stack-protector -fPIC -fstack-protector-strong -ftls-model=initial-exec -35071 __init_array_start -35114 /var/tmp/portage/sys-libs/glibc-2.33-r7/work/glibc-2.33/csu -35215 elf-init.c -35230 long unsigned int -35252 __libc_csu_fini -35311 __libc_csu_init -35336 long double -35352 __init_array_end -36161 /home/haelwenn/Sources/git/hacktivis.me/git/utils/bin -37550 elf-init.c -37563 __init_array_end -37604 _DYNAMIC -37615 __init_array_start -37640 __GNU_EH_FRAME_HDR -37663 _GLOBAL_OFFSET_TABLE_ -37711 __libc_csu_fini -37731 _ITM_deregisterTMCloneTable -37774 __libc_start_main@GLIBC_2.2.5 -40032 __data_start -40047 __gmon_start__ -40066 __dso_handle -40103 _IO_stdin_used -40122 __libc_csu_init -40142 __bss_start -40163 __TMC_END__ -40177 _ITM_registerTMCloneTable -40231 __cxa_finalize@GLIBC_2.2.5 -40305 .shstrtab -40327 .note.ABI-tag -40345 .gnu.hash -40377 .gnu.version -40414 .gnu.version_r -40433 .rela.dyn -40460 .plt.got -40515 .eh_frame_hdr -40533 .eh_frame -40545 .init_array -40561 .fini_array -40575 .dynamic -40621 .comment -40632 .debug_aranges -40651 .debug_info -40665 .debug_abbrev -40703 .debug_line -40717 .debug_str -40732 .debug_loc -40745 .debug_line_str -40765 .debug_rnglists diff --git a/test-cmd/outputs/strings/true_8_tx b/test-cmd/outputs/strings/true_8_tx @@ -1,65 +0,0 @@ -2a8 /lib64/ld-linux-x86-64.so.2 -3a1 __cxa_finalize -3b0 __libc_start_main -3c2 libc.so.6 -3cc GLIBC_2.2.5 -3d8 _ITM_deregisterTMCloneTable -3f4 __gmon_start__ -403 _ITM_registerTMCloneTable -11c9 []A\A]A^A_ -3010 GCC: (Gentoo Hardened 10.3.0-r2 p3) 10.3.0 -303b GCC: (Gentoo Hardened 11.2.0 p1) 11.2.0 -347b /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/include -34ac elf-init.c -34ba stddef.h -3557 GNU C99 11.2.0 -mtune=generic -march=x86-64 -g -O2 -std=c99 -3598 long long int -35a6 GNU C11 10.3.0 -march=znver1 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -msse4a -mcx16 -msahf -mmovbe -maes -msha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mmwaitx -mclzero -mno-pku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-avx512vpopcntdq -mno-movdiri -mno-movdir64b -mno-waitpkg -mno-cldemote -mno-ptwrite -mno-avx512bf16 -mno-enqcmd -mno-avx512vp2intersect --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=512 -mtune=znver1 -m64 -ggdb -ggdb -O2 -O2 -std=gnu11 -fgnu89-inline -fmerge-all-constants -frounding-math -fstack-protector-strong -fmath-errno -fno-stack-protector -fPIC -fstack-protector-strong -ftls-model=initial-exec -3a39 __init_array_start -3a4c /var/tmp/portage/sys-libs/glibc-2.33-r7/work/glibc-2.33/csu -3a8d elf-init.c -3a98 long unsigned int -3aaa __libc_csu_fini -3ac9 __libc_csu_init -3ade long double -3aea __init_array_end -3c71 /home/haelwenn/Sources/git/hacktivis.me/git/utils/bin -3f68 elf-init.c -3f73 __init_array_end -3f84 _DYNAMIC -3f8d __init_array_start -3fa0 __GNU_EH_FRAME_HDR -3fb3 _GLOBAL_OFFSET_TABLE_ -3fc9 __libc_csu_fini -3fd9 _ITM_deregisterTMCloneTable -3ffc __libc_start_main@GLIBC_2.2.5 -401a __data_start -4027 __gmon_start__ -4036 __dso_handle -4043 _IO_stdin_used -4052 __libc_csu_init -4062 __bss_start -4073 __TMC_END__ -407f _ITM_registerTMCloneTable -4099 __cxa_finalize@GLIBC_2.2.5 -40c5 .shstrtab -40d7 .note.ABI-tag -40e5 .gnu.hash -40ff .gnu.version -410c .gnu.version_r -411b .rela.dyn -4130 .plt.got -414d .eh_frame_hdr -415b .eh_frame -4165 .init_array -4171 .fini_array -417d .dynamic -4191 .comment -419a .debug_aranges -41a9 .debug_info -41b5 .debug_abbrev -41c3 .debug_line -41cf .debug_str -41da .debug_loc -41e5 .debug_line_str -41f5 .debug_rnglists diff --git a/test-cmd/outputs/strings/true_td b/test-cmd/outputs/strings/true_td @@ -1,91 +0,0 @@ -680 /lib64/ld-linux-x86-64.so.2 -929 __cxa_finalize -944 __libc_start_main -962 libc.so.6 -972 GLIBC_2.2.5 -984 _ITM_deregisterTMCloneTable -1012 __gmon_start__ -1027 _ITM_registerTMCloneTable -4478 AUATI -4553 []A\A]A^A_ -8359 ;*3$" -12304 GCC: (Gentoo Hardened 10.3.0-r2 p3) 10.3.0 -12347 GCC: (Gentoo Hardened 11.2.0 p1) 11.2.0 -13435 /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/include -13484 elf-init.c -13498 stddef.h -13640 f.... -13655 GNU C99 11.2.0 -mtune=generic -march=x86-64 -g -O2 -std=c99 -13715 main -13720 long long int -13734 GNU C11 10.3.0 -march=znver1 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -msse4a -mcx16 -msahf -mmovbe -maes -msha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mmwaitx -mclzero -mno-pku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-avx512vpopcntdq -mno-movdiri -mno-movdir64b -mno-waitpkg -mno-cldemote -mno-ptwrite -mno-avx512bf16 -mno-enqcmd -mno-avx512vp2intersect --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=512 -mtune=znver1 -m64 -ggdb -ggdb -O2 -O2 -std=gnu11 -fgnu89-inline -fmerge-all-constants -frounding-math -fstack-protector-strong -fmath-errno -fno-stack-protector -fPIC -fstack-protector-strong -ftls-model=initial-exec -14898 size_t -14905 __init_array_start -14924 /var/tmp/portage/sys-libs/glibc-2.33-r7/work/glibc-2.33/csu -14984 envp -14989 elf-init.c -15000 long unsigned int -15018 __libc_csu_fini -15034 char -15039 argc -15044 size -15049 __libc_csu_init -15065 argv -15070 long double -15082 __init_array_end -15466 true.c -15473 /home/haelwenn/Sources/git/hacktivis.me/git/utils/bin -16225 true.c -16232 elf-init.c -16243 __init_array_end -16260 _DYNAMIC -16269 __init_array_start -16288 __GNU_EH_FRAME_HDR -16307 _GLOBAL_OFFSET_TABLE_ -16329 __libc_csu_fini -16345 _ITM_deregisterTMCloneTable -16373 _edata -16380 __libc_start_main@GLIBC_2.2.5 -16410 __data_start -16423 __gmon_start__ -16438 __dso_handle -16451 _IO_stdin_used -16466 __libc_csu_init -16482 __bss_start -16494 main -16499 __TMC_END__ -16511 _ITM_registerTMCloneTable -16537 __cxa_finalize@GLIBC_2.2.5 -16565 .symtab -16573 .strtab -16581 .shstrtab -16591 .interp -16599 .note.ABI-tag -16613 .gnu.hash -16623 .dynsym -16631 .dynstr -16639 .gnu.version -16652 .gnu.version_r -16667 .rela.dyn -16677 .init -16683 .plt -16688 .plt.got -16697 .text -16703 .fini -16709 .rodata -16717 .eh_frame_hdr -16731 .eh_frame -16741 .init_array -16753 .fini_array -16765 .dynamic -16774 .data -16780 .bss -16785 .comment -16794 .debug_aranges -16809 .debug_info -16821 .debug_abbrev -16835 .debug_line -16847 .debug_str -16858 .debug_loc -16869 .debug_line_str -16885 .debug_rnglists diff --git a/test-cmd/outputs/strings/true_to b/test-cmd/outputs/strings/true_to @@ -1,91 +0,0 @@ -1250 /lib64/ld-linux-x86-64.so.2 -1641 __cxa_finalize -1660 __libc_start_main -1702 libc.so.6 -1714 GLIBC_2.2.5 -1730 _ITM_deregisterTMCloneTable -1764 __gmon_start__ -2003 _ITM_registerTMCloneTable -10576 AUATI -10711 []A\A]A^A_ -20247 ;*3$" -30020 GCC: (Gentoo Hardened 10.3.0-r2 p3) 10.3.0 -30073 GCC: (Gentoo Hardened 11.2.0 p1) 11.2.0 -32173 /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/include -32254 elf-init.c -32272 stddef.h -32510 f.... -32527 GNU C99 11.2.0 -mtune=generic -march=x86-64 -g -O2 -std=c99 -32623 main -32630 long long int -32646 GNU C11 10.3.0 -march=znver1 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -msse4a -mcx16 -msahf -mmovbe -maes -msha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mmwaitx -mclzero -mno-pku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-avx512vpopcntdq -mno-movdiri -mno-movdir64b -mno-waitpkg -mno-cldemote -mno-ptwrite -mno-avx512bf16 -mno-enqcmd -mno-avx512vp2intersect --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=512 -mtune=znver1 -m64 -ggdb -ggdb -O2 -O2 -std=gnu11 -fgnu89-inline -fmerge-all-constants -frounding-math -fstack-protector-strong -fmath-errno -fno-stack-protector -fPIC -fstack-protector-strong -ftls-model=initial-exec -35062 size_t -35071 __init_array_start -35114 /var/tmp/portage/sys-libs/glibc-2.33-r7/work/glibc-2.33/csu -35210 envp -35215 elf-init.c -35230 long unsigned int -35252 __libc_csu_fini -35272 char -35277 argc -35304 size -35311 __libc_csu_init -35331 argv -35336 long double -35352 __init_array_end -36152 true.c -36161 /home/haelwenn/Sources/git/hacktivis.me/git/utils/bin -37541 true.c -37550 elf-init.c -37563 __init_array_end -37604 _DYNAMIC -37615 __init_array_start -37640 __GNU_EH_FRAME_HDR -37663 _GLOBAL_OFFSET_TABLE_ -37711 __libc_csu_fini -37731 _ITM_deregisterTMCloneTable -37765 _edata -37774 __libc_start_main@GLIBC_2.2.5 -40032 __data_start -40047 __gmon_start__ -40066 __dso_handle -40103 _IO_stdin_used -40122 __libc_csu_init -40142 __bss_start -40156 main -40163 __TMC_END__ -40177 _ITM_registerTMCloneTable -40231 __cxa_finalize@GLIBC_2.2.5 -40265 .symtab -40275 .strtab -40305 .shstrtab -40317 .interp -40327 .note.ABI-tag -40345 .gnu.hash -40357 .dynsym -40367 .dynstr -40377 .gnu.version -40414 .gnu.version_r -40433 .rela.dyn -40445 .init -40453 .plt -40460 .plt.got -40471 .text -40477 .fini -40505 .rodata -40515 .eh_frame_hdr -40533 .eh_frame -40545 .init_array -40561 .fini_array -40575 .dynamic -40606 .data -40614 .bss -40621 .comment -40632 .debug_aranges -40651 .debug_info -40665 .debug_abbrev -40703 .debug_line -40717 .debug_str -40732 .debug_loc -40745 .debug_line_str -40765 .debug_rnglists diff --git a/test-cmd/outputs/strings/true_tx b/test-cmd/outputs/strings/true_tx @@ -1,91 +0,0 @@ -2a8 /lib64/ld-linux-x86-64.so.2 -3a1 __cxa_finalize -3b0 __libc_start_main -3c2 libc.so.6 -3cc GLIBC_2.2.5 -3d8 _ITM_deregisterTMCloneTable -3f4 __gmon_start__ -403 _ITM_registerTMCloneTable -117e AUATI -11c9 []A\A]A^A_ -20a7 ;*3$" -3010 GCC: (Gentoo Hardened 10.3.0-r2 p3) 10.3.0 -303b GCC: (Gentoo Hardened 11.2.0 p1) 11.2.0 -347b /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/include -34ac elf-init.c -34ba stddef.h -3548 f.... -3557 GNU C99 11.2.0 -mtune=generic -march=x86-64 -g -O2 -std=c99 -3593 main -3598 long long int -35a6 GNU C11 10.3.0 -march=znver1 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -msse4a -mcx16 -msahf -mmovbe -maes -msha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mmwaitx -mclzero -mno-pku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-avx512vpopcntdq -mno-movdiri -mno-movdir64b -mno-waitpkg -mno-cldemote -mno-ptwrite -mno-avx512bf16 -mno-enqcmd -mno-avx512vp2intersect --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=512 -mtune=znver1 -m64 -ggdb -ggdb -O2 -O2 -std=gnu11 -fgnu89-inline -fmerge-all-constants -frounding-math -fstack-protector-strong -fmath-errno -fno-stack-protector -fPIC -fstack-protector-strong -ftls-model=initial-exec -3a32 size_t -3a39 __init_array_start -3a4c /var/tmp/portage/sys-libs/glibc-2.33-r7/work/glibc-2.33/csu -3a88 envp -3a8d elf-init.c -3a98 long unsigned int -3aaa __libc_csu_fini -3aba char -3abf argc -3ac4 size -3ac9 __libc_csu_init -3ad9 argv -3ade long double -3aea __init_array_end -3c6a true.c -3c71 /home/haelwenn/Sources/git/hacktivis.me/git/utils/bin -3f61 true.c -3f68 elf-init.c -3f73 __init_array_end -3f84 _DYNAMIC -3f8d __init_array_start -3fa0 __GNU_EH_FRAME_HDR -3fb3 _GLOBAL_OFFSET_TABLE_ -3fc9 __libc_csu_fini -3fd9 _ITM_deregisterTMCloneTable -3ff5 _edata -3ffc __libc_start_main@GLIBC_2.2.5 -401a __data_start -4027 __gmon_start__ -4036 __dso_handle -4043 _IO_stdin_used -4052 __libc_csu_init -4062 __bss_start -406e main -4073 __TMC_END__ -407f _ITM_registerTMCloneTable -4099 __cxa_finalize@GLIBC_2.2.5 -40b5 .symtab -40bd .strtab -40c5 .shstrtab -40cf .interp -40d7 .note.ABI-tag -40e5 .gnu.hash -40ef .dynsym -40f7 .dynstr -40ff .gnu.version -410c .gnu.version_r -411b .rela.dyn -4125 .init -412b .plt -4130 .plt.got -4139 .text -413f .fini -4145 .rodata -414d .eh_frame_hdr -415b .eh_frame -4165 .init_array -4171 .fini_array -417d .dynamic -4186 .data -418c .bss -4191 .comment -419a .debug_aranges -41a9 .debug_info -41b5 .debug_abbrev -41c3 .debug_line -41cf .debug_str -41da .debug_loc -41e5 .debug_line_str -41f5 .debug_rnglists diff --git a/test-cmd/strings.sh b/test-cmd/strings.sh @@ -16,8 +16,17 @@ t devnull /dev/null '' t_file all_bytes "$WD/inputs/all_bytes" "$WD/outputs/strings/all_bytes" -t_file trueelf "$WD/inputs/strings/true" "$WD/outputs/strings/true" -t_file true8elf "-n 8 $WD/inputs/strings/true" "$WD/outputs/strings/true_8" +t default "${WD}/inputs/strings/length" '___4 +____5 +_____6 +______7 +_______8 +________9 +' + +t n8 "-n 8 ${WD}/inputs/strings/length" '_______8 +________9 +' #atf_test_case noperm cleanup #noperm_body() { @@ -33,25 +42,25 @@ t_file true8elf "-n 8 $WD/inputs/strings/true" "$WD/outputs/strings/true_8" t octal:devnull '-to /dev/null' '' t_file octal:all_bytes "-to $WD/inputs/all_bytes" "$WD/outputs/strings/all_bytes_to" -t_file octal:trueelf "-to $WD/inputs/strings/true" "$WD/outputs/strings/true_to" -t_file octal:true8elf "-to -n 8 $WD/inputs/strings/true" "$WD/outputs/strings/true_8_to" +t_file octal:lengthelf "-to $WD/inputs/strings/length" "$WD/outputs/strings/length_to" +t_file octal:length8elf "-to -n 8 $WD/inputs/strings/length" "$WD/outputs/strings/length_8_to" t hex:devnull '-tx /dev/null' '' t_file hex:all_bytes "-tx $WD/inputs/all_bytes" "$WD/outputs/strings/all_bytes_tx" -t_file hex:trueelf "-tx $WD/inputs/strings/true" "$WD/outputs/strings/true_tx" -t_file hex:true8elf "-tx -n 8 $WD/inputs/strings/true" "$WD/outputs/strings/true_8_tx" +t_file hex:lengthelf "-tx $WD/inputs/strings/length" "$WD/outputs/strings/length_tx" +t_file hex:length8elf "-tx -n 8 $WD/inputs/strings/length" "$WD/outputs/strings/length_8_tx" t dec:devnull '-td /dev/null' '' t_file dec:all_bytes "-td $WD/inputs/all_bytes" "$WD/outputs/strings/all_bytes_td" -t_file dec:trueelf "-td $WD/inputs/strings/true" "$WD/outputs/strings/true_td" -t_file dec:true8elf "-td -n 8 $WD/inputs/strings/true" "$WD/outputs/strings/true_8_td" +t_file dec:lengthelf "-td $WD/inputs/strings/length" "$WD/outputs/strings/length_td" +t_file dec:length8elf "-td -n 8 $WD/inputs/strings/length" "$WD/outputs/strings/length_8_td" fmt_t="strings: Unknown format: t ${usage}" t --exit=1 fmt_t:devnull '-tt /dev/null' "${fmt_t}" t --exit=1 fmt_t:all_bytes "-tt $WD/inputs/all_bytes" "${fmt_t}" -t --exit=1 fmt_t:trueelf "-tt $WD/inputs/strings/true" "${fmt_t}" -t --exit=1 fmt_t:true8elf "-tt -n 8 $WD/inputs/strings/true" "${fmt_t}" +t --exit=1 fmt_t:lengthelf "-tt $WD/inputs/strings/length" "${fmt_t}" +t --exit=1 fmt_t:length8elf "-tt -n 8 $WD/inputs/strings/length" "${fmt_t}" t --exit=1 erange_n:0 "-n 0 $WD/inputs/all_bytes" "strings: Option \`-n 0\` is too small ${usage}"