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

Different behavior when opening local vs remote files. #123

Open
sleirsgoevy opened this issue Sep 16, 2023 · 3 comments
Open

Different behavior when opening local vs remote files. #123

sleirsgoevy opened this issue Sep 16, 2023 · 3 comments

Comments

@sleirsgoevy
Copy link

With this file (repro.elf.gz) I see different behavior when running the decompiler locally or via RAP.

When running directly on a file, the string literal gets recognized:

$ r2 repro.elf
[0x00001000]> ss sym.main
[0x00001050]> af
[0x00001050]> pdg

ulong sym.main(void)

{
    sym.puts_plt("Hello, world!");
    return 0;
}

However, when running via RAP it is not:

$ r2 -nn repro.elf rap://:9999/ &
$ r2 rap://127.0.0.1:9999/
[0x00001000]> ss sym.main
[0x00001050]> af
[0x00001050]> pdg

ulong sym.main(void)

{
    sym.puts_plt(0x2004);
    return 0;
}

Possibly related to #52.

@trufae
Copy link
Contributor

trufae commented Sep 16, 2023

If you do -nn no strings or symbols are parsed so its expected

@sleirsgoevy
Copy link
Author

As you can see, the "main" symbol does get recognized on the second set of commands. My guess is that the second r2 sees the ELF magic within the remote memory and does its own processing of the ELF format, including symbols, but for some reason the string literal is not recognized.

@sleirsgoevy
Copy link
Author

I've run some tests, and it seems that the direct r2 (as in the first set of commands) only recognizes the string if the size of the .data section is no more than 10 MiB. If the section is larger, the string is not recognized in either way.

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

2 participants