BSim: Request for a solution for large binaries on low-memory computers
Is your feature request related to a problem? Please describe. I have an issue with BSim when VT source and target have about 100k functions each and are about 100MB each. This results in ghidra (or the jvm) to run out of memory on both my 16GB and 32GB laptops, despite allocating almost all the memory to it.
Describe the solution you'd like Would it be possible to get around this by splitting one of the domains (either source or target functions) and match against the full second domain, and doing multiple runs to cover the whole split domain? instead of N x M we'd have (N1 x M) U (N2 x M) ... . I'm just not sure if the resulting set is equivalent to N x M, as BSim might need the other functions during the run.
Describe alternatives you've considered I switched to the 32GB laptop from the 16GB one, which let the analysis run almost to completion, but also failed at the end. The solution would be more ram, but It would be great if that wasn't necessary. Another alternative I've attempted was leaving the "discovered non-returning functions" analyzer on, which limited the amount of functions on both binaries, but significantly degraded the quality of the analysis, as some code flow obfuscation techniques easily fool it into not analyzing the code paths (I could provide an example if you'd like to tackle this as a separate issue). The reason the second alternative worked is that a huge amount of thunks didn't get disassembled, which lowered the total amount of functions. So maybe a simpler solution would be to add a threshold for the size (number of instructions or number of bytes) of functions considered by BSim.
Additional context I haven't really looked into the BSim source code to assess the feasibility of the solutions I suggested. I ran BSim with the GUI, so I'm not sure if running the BSim server in headless mode would be any different.
Source: NationalSecurityAgency/ghidra