-
Notifications
You must be signed in to change notification settings - Fork 213
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
On-Demand Function Analysis is Triggering Time and Update Count Limits #6171
Comments
Also see 0x8091b80 in |
capa stack trace:
And the Python script that works:
|
I checked the analysis skip reason for the function is But it still does NOT look right, because the analysis of that function takes like 2 seconds, there is no way the 20 seconds default time can be exceeded. Update: I printed the analysis time and it is indeed questionable:
The analysis time of the two skipped functions are all very short For comparison, I wrote a small script that iterates over all functions and retrieve the MLIL of each function. It took roughly 0.7 seconds to generate the MLIL for function 0x8082d40 |
I made some interesting discovery in mandiant/capa#2402 (comment). However, that still does not explain why the analysis could time-out on a not-so-challenging function at all |
OK so I finally figured out what is happening here. So we are only resetting the function analysis time if the analysis is a user update. If it is always auto-update, then we never reset the timer and the time just gets added up, eventually exceeding the 20 seconds threshold. Here is a brief explanation of what happens:
I understand we are probably only resetting the total analysis time on user updates for a good reason, and this cached-related repetitive generation of the IL is probably never encountered before |
@xusheng6 thanks for discovering this and providing the details. The issue required a slightly different fix, and I added a unit test for this scenario as well. Fixed in |
I verify the fix works for capa, thx for fixing in so fast! |
While working on mandiant/capa#2406 (comment), I noticed that the MLIL of function 0x467464 can normally be retrieved after a few seconds. But when binja was used in capa, it cannot retrieve the IL, thus leading to a crash.
Normal run:
It does take
func.mlil
a few seconds to run, but everything works as expected. We need to see why it is not working in the case of capaRelated to #6170
The text was updated successfully, but these errors were encountered: