-
-
Notifications
You must be signed in to change notification settings - Fork 499
Add color support to no-name symbols #4823 #5741
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
base: dev
Are you sure you want to change the base?
Conversation
wargio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned, maybe is worth checking all the bin plugins for these usecases in symbols and maybe is worth adding a configurable "prefix" variable to RzBin which can then be reused also here
@notxvilka what do you think?
librz/core/cmd/cmd_api.c
Outdated
| } else if (table_value_is_flags(column)) { | ||
| return ctx->pal.flag; | ||
| } else if (table_value_is_name(column)) { | ||
| if (value && rz_str_startswith(value, "unknown_")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably is worth checking what the bin plugins do when these symbols are "empty" and create a function which normalizes this.
|
(ah, the changes are ok) |
What if there is a symbol called |
Just a suggestion, as in some debugger tools like IDA the symbols naming is done like And yes we can come up with a better method instead of just string comparison. |
true, but if you check the address where that symbol is located, you will notice it might clash with others. the logic should be like: is it a valid vaddr? if not maybe just use an index value |
yeah, I will go through other bin plugins as well for the mentioned usecase and add a function. |
|
Sorry for my inactivity due to some unavoidable circumstances. For Similar is the case with other plugins too. Shall I proceed with handling the |
|
create an RzBin function to normalize this and we could allow to have https://github.com/rizinorg/rizin/blob/dev/librz/bin/bobj_process_symbol.c#L101 |
|
@wargio I have made the changes, kindly review them. Also, in And, names are getting generated (as you suggested) |
|
@wargio according to your convenience, please review the changes. |
| // SPDX-License-Identifier: LGPL-3.0-only | ||
| #include <rz_bin.h> | ||
| #include "i/private.h" | ||
| #include <rz_core.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sl4y3r-07 RzBin should not have dependency on RzCore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I have fixed that. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the line is still here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant I have fixed it locally, will push it with other changes.
| } else if (table_value_is_flags(column)) { | ||
| return ctx->pal.flag; | ||
| } else if (table_value_is_name(column)) { | ||
| RzBinSymbol *sym = rz_core_bin_get_symbol_by_name(core, value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would prefer to use rz_str_startswith
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used this since we discussed for a better approach instead of direct string comparison. So it fetches the symbol and check whether is_auto_generated true. If rz_str_startswith is to be used, then initial change is good enough ig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I continue with this change?
|
@notxvilka what do you think? |
notxvilka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the idea is good, but I don't like that it searches symbol by name for every entry. Probably it's better to rethink logic of the flow a bit to reduce costly operations.
| // SPDX-License-Identifier: LGPL-3.0-only | ||
| #include <rz_bin.h> | ||
| #include "i/private.h" | ||
| #include <rz_core.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sl4y3r-07 RzBin should not have dependency on RzCore
Okay, I'll go through it and try to optimise it. Thanks. |
Your checklist for this pull request
RZ_APIfunction and struct this PR changes.RZ_API).Detailed description
This minor change is done to resolve the issue.
...
...