Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x86 - missing strings in decompilation #52

Open
enovella opened this issue Nov 6, 2021 · 6 comments
Open

x86 - missing strings in decompilation #52

enovella opened this issue Nov 6, 2021 · 6 comments

Comments

@enovella
Copy link

enovella commented Nov 6, 2021

cat hello.c

#include <unistd.h>
#include <stdio.h>

void  main() {
	unsigned int t = 1;

	while (1) {
		printf("Hi r2con: %d\n", 2019);
		sleep(t);
	}
}

Decompilation

[0x00001130]> pdg

void main(void)

{
    int32_t var_14h;
    int32_t var_10h;
    int32_t var_ch;
    int32_t s;
    
    do {
        sym.imp.printf(0x2000, 0x7e3);
        sym.imp.sleep(1);
    } while( true );
}

Sample

hello_avd_x86.zip

@trufae
Copy link
Contributor

trufae commented Nov 8, 2021

Screenshot 2021-11-08 at 01 01 38

@trufae
Copy link
Contributor

trufae commented Nov 8, 2021

I tried to make r2ghidra collect those low addresses but seems to be filtered somewhere maybe inside ghidra's code, but ill investigate further, for now you can use a high basae address, to ensure those dont overlap with the physical address of the binary

@trufae
Copy link
Contributor

trufae commented Jul 30, 2022

Needs r2ghidra.roprop to be disabled to work, but still it needs to be loaded with a high load address

@enovella
Copy link
Author

enovella commented Aug 1, 2022

Cannot get it to work over here: (with out-the-box flags)

[0x00001060]> s main
[0x00001130]> pdg

void main(void)

{
    uint var_14h;
    uint var_10h;
    uint var_ch;
    uint s;

    do {
        sym.imp.printf(0xffffdfff, 0x7e3);
        sym.imp.sleep(0xffffffff);
    } while( true );
}
[0x00001130]> !r2 -v
radare2 5.7.5 28731 @ darwin-x86-64 git.5.7.4-144-g566227105
commit: 5662271054b5d2eb4f7cad0e26857f381a6959c7 build: 2022-07-31__18:09:25

@GianisTsol
Copy link

any updates?

@trufae
Copy link
Contributor

trufae commented Sep 8, 2022

Did you tried setting different values for the roprop option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants