Permalink
Browse files

Removed repeated calls and added counter

  • Loading branch information...
botherder committed Nov 17, 2011
1 parent 70b393b commit eff751605a3621c7c65082dfafc1aa19f5c1712a
Showing with 10 additions and 1 deletion.
  1. +10 −1 cuckoo/processing/analysislog.py
@@ -83,10 +83,19 @@ def _parse(self, row):
call["status"] = status_value
call["return"] = self._encode(return_value)
call["arguments"] = arguments
+ call["repeated"] = 0
- # Add the current API call to the complete calls list.
+ # Check if the current API call is a repetition of the previous one.
+ if len(self.calls) > 0:
+ if self.calls[-1]["api"] == call["api"] and self.calls[-1]["status"] == call["status"] and self.calls[-1]["arguments"] == call["arguments"] and self.calls[-1]["return"] == call["return"]:
+ self.calls[-1]["repeated"] += 1
+ return True
+
+ # If it's a new one, add it to the list.
self.calls.append(call)
+ return True
+
def extract(self):
if not os.path.exists(self._log_path):
return False

0 comments on commit eff7516

Please sign in to comment.