-
Notifications
You must be signed in to change notification settings - Fork 227
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
Type propagation to DataVariables #4400
Comments
The increased accuracy would easily make it worthwhile to be included as a pre-included workflow at the very least. |
Some recent discussion on Slack brought up how
I asked how 'smart' the current detection methods were, and whether the patterns of usage could be used to 'safely' detect smaller strings:
Which eventually led back to this issue. Just wanted to add a bit more context/keywords to make this easier to find in future. Also crosslinking to this tangentially related issue that was linked from one of the dupes to keep the references in-tact: |
I believe type propagation to data variables is NOT the best solution for detecting small strings -- It only works for those strings used by printf, etc, which we know the type of the argument. For other functions we will still miss it. Also many strings are a target of a pointer data variable (commonly seen in Rust binaries), and we would not see a code xref to it at all Here is my proposal for solving the problem -- when we do the string search, when we see a short string, we keep it and mark it as a short string, instead of discarding it. Then, later on, during analysis, when we see a code or data xref to the string, then we promote it to a true string. Otherwise it will remain to be a short string, and excluded from the stirngs view and bv.strings. I am likely going to carry this change out along with #5548, some at a certain point post stable 4.1 release Still, the issue itself is worth doing -- we definitely want to propagate the type info into data variables, but it is just not motivating the small string issue. |
Binary Ninja could do a better job inferring DataVariable types. The primary reason we don't propagate types from analysis to DataVariables is that the DataVariable could be shared amongst multiple functions. Analysis would have to take into account all function which reference the DataVariable in order to make correct assumptions about a DataVariables type. We'd essentially have to wait until all analysis has settled and then go through references to each of these as a second pass.
The text was updated successfully, but these errors were encountered: