I want to see the strings that are printed by the puts() function in the output of radare2's pdf, but it doesn't work. I have a similar problem as mentioned here, but I think it's somehow related to the way the binary is compiled. I have this small C-program called test.c:

#include <stdio.h>

int main(void){

    int input;
    scanf("%d", &input);
    if(input == 0){
    } else {
    return 0;

When I print the strings of the program with iz, I get all the strings. Now if I seek to the main function and hit pdf, then I see the string depending on the way I compile the programme. If I do it like this gcc -m32 -o test test.c, then I do not see any strings in the output, but if I compile without the 32-bit flag, I do see the strings. (Compiler: GCC: (Debian 10.2.1-6) 10.2.1 20210110)

With -m32:

enter image description here

Without -m32:

enter image description here

I tried to display the strings in the 32-bit version with the command pdf @e:emu.str=true @ main as @Eli suggested in the related post, but if I execute pdf again afterwards, the output gets really messy and I cannot change that by setting emu.str to false again:

enter image description here

Here is my question: Does anyone know how to print the strings in pdf for 32-bit binaries? Or how to turn off the messy output if you use emu.str?

  • I don't know if you tried these or you are seeking some other specific answer. here is how I search for strings on radare2 iz for strings on the data section or izz on the whole binary
    – zed-zahir
    Jul 30 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.