orhun / binsider

Analyze ELF binaries like a boss 😼🕵️‍♂️
https://binsider.dev/
Apache License 2.0
2.76k stars 61 forks source link

feat(static): make symbols sortable by name or address #99

Open XXMA16 opened 1 week ago

XXMA16 commented 1 week ago

Description of change

Made the Symbols from Static Analysis sortable by name and address. The sorting modes can be cycled with S.

Concerns

Should I make a Sort trait in order to have less repeated code? Should info_index be bound to Static Analysis instead of State? The option to sort is shown for Dynamic and Relocations too, even though it doesn't do anything.

partially closes #22

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 0% with 58 lines in your changes missing coverage. Please review.

Project coverage is 3.25%. Comparing base (09137d2) to head (311261d).

Files with missing lines Patch % Lines
src/elf/symbols.rs 0.00% 49 Missing :warning:
src/tui/state.rs 0.00% 8 Missing :warning:
src/tui/command.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #99 +/- ## ======================================== - Coverage 3.30% 3.25% -0.04% ======================================== Files 19 19 Lines 2426 2462 +36 ======================================== Hits 80 80 - Misses 2346 2382 +36 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

orhun commented 1 week ago

Looks good to me! Thanks for implementing! <3

Can we also use lowercase s for the sort?

Should I make a Sort trait in order to have less repeated code?

Sounds good. I'm curious how a trait would look like though. What is in your mind?

Should info_index be bound to Static Analysis instead of State?

Yup, sounds good. Feel free to make the refactor.

The option to sort is shown for Dynamic and Relocations too, even though it doesn't do anything.

Would be nice to disable that somehow.