Radare2: RFE: Completion limit should be dynamic (not 4096)

Created on 7 Apr 2019  Â·  9Comments  Â·  Source: radareorg/radare2

Work environment

| Questions | Answers
|------------------------------------------------------|--------------------
| OS/arch/bits (mandatory) | Fedora x86_64
| File format of the file you reverse (mandatory) | PE
| Architecture/bits of the file (mandatory) | x86/32
| r2 -v full output, not truncated (mandatory) | radare2 3.5.0-git 21672 @ linux-x86-64 git.3.4.1-32-g44eb2e26e commit: 44eb2e26e4fef1dd15a877019f417ea0922ea13b build: 2019-04-07__18:59:00

Expected behavior

When loading multiple PE binaries via oba, i would like to walk through the symbols using the shell completion.

The problem is that the completion miss some of the symbols

Actual behavior

The completion is missing some of the symbols

Look at the asciinema video I recorded.
I want to complete all the symbols which start by sym.nt (ntoskrnl or ntdll), and r2 immediately completes by sym.ntdllxxxx

Steps to reproduce the behavior

Additional Logs, screenshots, source-code, configuration dump, ...

I can share the binaries if necessary.

Thanks !

bug

All 9 comments

maybe this is because there are too many symbols, and the current code in libr/core/core.c uses #define TMP_ARGV_SZ 512 to limit that and avoid hell to happen when the user presses tab with milions of autocompletion options. can you try increasing this? how many flags you have f~?

maybe 4096 is a reasonable number too, but i want to know your specific behaviour in here, or maybe do something smarter and warn when that limit is bypassed

On 7 Apr 2019, at 19:11, Mathieu Tarral notifications@github.com wrote:

Work environment

Questions Answers
OS/arch/bits (mandatory) Fedora x86_64
File format of the file you reverse (mandatory) PE
Architecture/bits of the file (mandatory) x86/32
r2 -v full output, not truncated (mandatory) radare2 3.5.0-git 21672 @ linux-x86-64 git.3.4.1-32-g44eb2e26e commit: 44eb2e2 https://github.com/radare/radare2/commit/44eb2e26e4fef1dd15a877019f417ea0922ea13b build: 2019-04-07__18:59:00
Expected behavior

When loading multiple PE binaries via oba, i would like to walk through the symbols using the shell completion.

The problem is that the completion miss some of the symbols

Actual behavior

The completion is missing some of the symbols

Look at the asciinema video I recorded.
I want to complete all the symbols which start by sym.nt (ntoskrnl or ntdll), and r2 immediately completes by sym.ntdllxxxx

Steps to reproduce the behavior

asciinema https://asciinema.org/a/YWMwi7hBkkXSNuYFYvolYBeAT
Additional Logs, screenshots, source-code, configuration dump, ...

I can share the binaries if necessary.

Thanks !

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/radare/radare2/issues/13651, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3-lgDc3vwbRXrsPKrErLgPVCfivXY6ks5veiargaJpZM4cg4dl.

I have 3750 symbols:
~
[0x005d8c3c]> fs
474 * imports
82 * relocs
13 * resources
21 * sections
0 * segments
410 * strings
3760 * symbols
~

I confirm that manually increasing the limit to 4096 works.

But this should be dynamically allocated, not a statically defined, arbitrary value

can you make a PR adding a config var and making this option change RCore->maxtab instead of being a define?

and we can probably make it 4096 by default

can you make a PR adding a config var and making this option change RCore->maxtab instead of being a define?

I can report issues here and there, but i don't want to get involved in radare2 development at the moment.
I'd rather wait on a radare2 dev to look at this issue.

Thanks

ok will do that when i finish another pr im working on its just 5min

On 8 Apr 2019, at 15:28, Mathieu Tarral notifications@github.com wrote:

can you make a PR adding a config var and making this option change RCore->maxtab instead of being a define?

I can report issues here and there, but i don't want to get involved in radare2 development at the moment.
I'd rather wait on a radare2 dev to look at this issue.

Thanks

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/radare/radare2/issues/13651#issuecomment-480831362, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3-ln-FeF6RZwSDZg-bhCJivD62ZAPCks5ve0PvgaJpZM4cg4dl.

should be fine now. ill rename the issue to improve that . thanks!

another thing we can do is eprintf a warning message when the options to autocomplete are larger than the limit, so at least the user knows whats going on

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eagleoflqj picture eagleoflqj  Â·  7Comments

0ki picture 0ki  Â·  6Comments

S01den picture S01den  Â·  4Comments

YugoCode picture YugoCode  Â·  6Comments

NotAFile picture NotAFile  Â·  6Comments