Is there a way to display only all the string literals in the .rodata section of the elf file?
linux
$objdump-s-j.rodata FILE
Is that so?
readelf
$readelf-p\.rodata ELF
objcopy+string
$objcopy ELF/dev/null --dump-section\.rodata=/dev/stdout|string-n1
Take out only printable characters with the strings command, as the option name --dump-section shows, exactly as it appears in the specified section.However, printable characters are only 7-bit byte characters (ASCII, ISO 8859, etc.), so 8-bit byte characters like UTF-8 will be removed.
$echo 'Hello World Good morning, World' | strings
Hello World
You can also extract 8-bit byte characters for the GNU binutils strings command.
$string --version
GNU strings (GNU Binutils for Ubuntu) 2.27.51.20161220
$ echo 'Hello World, Good Morning, World' | strings -- encoding=S
Hello World Good morning, World
© 2024 OneMinuteCode. All rights reserved.