I have two binaries. Both contain the string "precondition failed" (without the quotes).
The corresponding byte sequence 70 72 65 63 6C 65 64 00
is the same for both binaries. However, the bytes before and after the string are different.
Binary 1:
00000000000006E0 00 00 00 00 2F 00 00 00 70 72 65 63 6F 6E 64 69 ..../...precondi
00000000000006F0 74 69 6F 6E 20 66 61 69 6C 65 64 00 FF FF FF FF tion failed.....
0000000000000700 69 6E 76 61 6C 69 64 20 61 72 67 75 6D 65 6E 74 invalid argument
Binary 2:
00000000000006E0 00 00 00 00 FF FF FF FF 70 72 65 63 6F 6E 64 69 ........precondi
00000000000006F0 74 69 6F 6E 20 66 61 69 6C 65 64 00 2F 00 00 00 tion failed./...
0000000000000700 69 6E 76 61 6C 69 64 20 61 72 67 75 6D 65 6E 74 invalid argument
For Binary 1, strings --encoding=S
finds the "precondition failed".
For Binary 2, strings --encoding=S
does not find the "precondition failed".
Why? Does it have to do with the enclosing bytes?
For both binaries, IDA Pro recognises only one version of "precondition failed" and says it is of type "C".
EDIT: I am working with GNU strings (GNU Binutils) 2.39