Skip to content
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

Analysing take long time #8

Open
gl4nce opened this issue Jan 30, 2025 · 4 comments · May be fixed by #9
Open

Analysing take long time #8

gl4nce opened this issue Jan 30, 2025 · 4 comments · May be fixed by #9

Comments

@gl4nce
Copy link

gl4nce commented Jan 30, 2025

Is it normal, adding an IPA analyse time take over 24h? I've added an IPA yesterday and the analyzing process is still running. In the log I can see a lot of UPDATE queries and the sqlite database is increasing (atm 144MB).

[...]
Jan. 30, 2025 6:35:40 PM com.lauriewired.malimite.decompile.GhidraProject decompileMacho
INFORMATION: Storing decompilation for Global::FUN_10049b95c
Jan. 30, 2025 6:35:40 PM com.lauriewired.malimite.database.SQLiteDBHandler updateFunctionDecompilation
INFORMATION: Database update for FUN_10049b95c affected 1 rows
Jan. 30, 2025 6:35:40 PM com.lauriewired.malimite.decompile.GhidraProject decompileMacho
INFORMATION: Storing decompilation for Global::FUN_10049b960
Jan. 30, 2025 6:35:42 PM com.lauriewired.malimite.database.SQLiteDBHandler updateFunctionDecompilation
INFORMATION: Database update for FUN_10049b960 affected 1 rows
Jan. 30, 2025 6:35:42 PM com.lauriewired.malimite.decompile.GhidraProject decompileMacho
INFORMATION: Storing decompilation for Global::FUN_10049b9d4
Jan. 30, 2025 6:35:53 PM com.lauriewired.malimite.database.SQLiteDBHandler updateFunctionDecompilation
INFORMATION: Database update for FUN_10049b9d4 affected 1 rows
Jan. 30, 2025 6:35:53 PM com.lauriewired.malimite.decompile.GhidraProject decompileMacho
INFORMATION: Storing decompilation for Global::FUN_10049bbe0
@LaurieWired
Copy link
Owner

Wow! What's the size of the IPA / mach-o you're analyzing? Or if you can share the file, I can do some testing to see.

If the executable has a ton of libraries inside, that might take a really long time to decompile. To speed up and reduce analysis, you can also try excluding libraries by class name and they'll be ignored. File -> Configure Libraries, then you can add names or partial names of library classes you want to skip before you start analysis.

I may also start thinking of some optimizations for handling large files since IPAs can be pretty chunky.

@leonewton253
Copy link

Wow! What's the size of the IPA / mach-o you're analyzing? Or if you can share the file, I can do some testing to see.

If the executable has a ton of libraries inside, that might take a really long time to decompile. To speed up and reduce analysis, you can also try excluding libraries by class name and they'll be ignored. File -> Configure Libraries, then you can add names or partial names of library classes you want to skip before you start analysis.

I may also start thinking of some optimizations for handling large files since IPAs can be pretty chunky.

Im analyzing one thats 21 MB. I'll try and download the smallest one I can find and see how long it takes.

@kirand777
Copy link

The same is for me. I waited for 1-2 hours, analysis info shown a lot of errors and I decided force quit it. The app idea is good, but functionality is still very raw.

Repository owner deleted a comment Feb 3, 2025
@sleeyax
Copy link

sleeyax commented Feb 15, 2025

I'm also experiencing an extremely long analysis time.

After investigating I noticed that this function is taking ~20s / operation on average to complete:

dbHandler.updateFunctionDecompilation(functionName, className, decompiledCode, targetMacho.getMachoExecutableName());

(or see for yourself how long the Storing decompilation for ... part takes in your output log)

I have over 5000 functions to analyse in a relatively big 85MB+ IPA, so at this speed that part alone would take about 27+ hours to complete!

Debugging this further, it seems like the database is the actual bottleneck here. I spent some time refactoring the database handler to use a shared connection and SQL transactions and managed to bring it down to ~5 operations / s. That's a 100x improvement in speed! I'll create a PR soon.

I should add that I store my data on an average quality HDD. Perhaps this issue isn't as noticable to people on fast Apple hardware with SSD?

@sleeyax sleeyax linked a pull request Feb 15, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants