-
Notifications
You must be signed in to change notification settings - Fork 150
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
Trying to add more filtering in IDA; Results seem counterintuivite #47
Comments
Hi there! Thank you for this comprehensive write-up. Couple of points: The re 2): I agree that putting the filtering code inside of
Hmm, yes. Ideally, you'd be able to just continue working in IDA while BinDiff does it's thing in the background. As for providing a status window: We don't know up front how long it will take, but we can at least provide an indeterminate status window that at least allows the IDA main UI thread to update so users know it's still active. And finally, for the two processes with only one being active, this is due to BinDiff being inherently single-threaded. It's not clear how one would parallelize the core BinDiff algorithm as the various steps refine the results and depend on each other. |
Hi, thanks for reading!
I think you mistyped; it is backwards, however, that is what i am already doing, e.g. skip_sub boolean from gui is passed only to
Also might be a nice idea to allow to filter out nullsubs/empty functions, but i dont think matching them takes any significant amount of time.
Its fine tbh; i dont care about them being there as long as i find my target ones.
I will test it more, it seems counter intuitive that just a simple 150k string prefix comparisons take a significant amount of time, maybe i make a logic mistake somewhere; because Read is basically the same iteration count, and there it takes almost no time. About the progress bar: I dont mind it being blocking; my request is to just indicate that something is going on. Just because, you know, seeing a hanged (because it hangs if you click it) dialog window in a process with 2 running threads taking 0.1% cpu does not really indicate that something is going on :) progress_test += absl::StrCat("\nExported primary in",
HumanReadableDuration(diff_timer.elapsed()));
wait_box.ReplaceText(progress_test);
diff_timer.restart();
....
progress_test += absl::StrCat("\nExported secondary in",
HumanReadableDuration(diff_timer.elapsed()));
wait_box.ReplaceText(progress_test);
diff_timer.restart();
....
progress_test += absl::StrCat("\nTwo read and context ctor in",
HumanReadableDuration(diff_timer.elapsed()));
wait_box.ReplaceText(progress_test);
diff_timer.restart();
....
progress_test += absl::StrCat("\nFilter funcs (source) in",
HumanReadableDuration(diff_timer.elapsed()));
wait_box.ReplaceText(progress_test);
diff_timer.restart();
....
For Diff(...) function - maybe have an std::atomic counter inside for loop and periodically update wait box text with e.g. "processed x out of y matching steps" in a thread? Also, see https://github.com/nihilus/IDA_WaitBoxEx - idk if its up to date, but seems like a nice thing to test! |
In advance: pardon my ignorance and noobishness.
Is your feature request related to a problem? Please describe.
Bindiff takes a lot of time to process binaries with large number of functions (currently, working with bins with 150k+ functions). Filtering by address might not always help.
Also, consider my use case: I am trying to preserve my work between patches in the program; alas, i am not really interested in what exactly has changed between patches;
I have names 20 functions that i'm interested in; and my goal in using bindiff (for the lack of more lightweight tool) is to identify those 20 functions in the new, patched binary: see if they are present, offsets have moved, etc etc.
Describe the solution you'd like
More filtering to be added to diff database filtered option of ida plugin.
Describe alternatives you've considered
I have tried to implement more filtering myself, and it almost works, but a little bit confusing with results.
differ.cc->SetupGraphsFromProto
:skip sub func parameter is passed from a gui checkbox added to diff database filtered dialog.
Reasoning: i have named 20 out of 150k functions, which means most of the functions i dont care about still have original ida naming (which is sub_address), so i try to skip those in the secondary (pre-patch) binary to not do unnecessary comparisons.
Adding this matches all 20 target functions correctly, while taking in total 4.5 minutes instead of 1.5 hours as usual.
What is confusing:
main_plugin.cc
) gives 0 performance gain. (I havent tested for full 1.5 hours, but after 10 minutes of seeing "Performing Diff" window, i got tired of waiting):(I assumed that FilterFunctions would be more appropriate place to add the filtering).
Additional context
It would be nice to add some progress indication to performing diff wait_box, or maybe even a progress bar. In 1.5hr waiting timespan I start to question my sanity and think if its even doing anything (considering I also see only 2 running threads in IDA process at the time and taking 0.01% cpu i think it doesnt; but after 1.5hr automagically result always appears :D)
The text was updated successfully, but these errors were encountered: