Please tell me how in a binary file using the gdb debugger to find a string or a reference to it? There are no options to use as the file is truncated and there are no sources. And is there such an opportunity in this debugger?

    1 answer 1

    As I understand it gdb is not able to. The only thing that can be done is to manually wool the data sections using the command x/Ns <address> where N is the number of output blocks, and <adress> is the starting address from which N blocks are counted. For example, x/10s 0x00415fc8 .

    The easiest and fastest way that I found is to use the readelf utility with the -x flag, the value needed to read the section (in my case it was .rodata ) and the name of the program itself.
    Looks like that:
    readelf -x .rodata sell
    From there we get the address of the required line and in the debugger we set a breakpoint at the given address (if necessary).