about summary refs log tree commit diff stats
path: root/miasm2/core/interval.py
diff options
context:
space:
mode:
Diffstat (limited to 'miasm2/core/interval.py')
-rw-r--r--miasm2/core/interval.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/miasm2/core/interval.py b/miasm2/core/interval.py
index 66445674..019764d4 100644
--- a/miasm2/core/interval.py
+++ b/miasm2/core/interval.py
@@ -244,3 +244,11 @@ class interval(object):
 
         if dry_run is False:
             img.show()
+
+    @property
+    def length(self):
+        """
+        Return the cumulated length of intervals
+        """
+        # Do not use __len__ because we may return a value > 32 bits
+        return sum((stop - start + 1) for start, stop in self.intervals)