about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFlorent Monjalet <florent.monjalet@gmail.com>2015-12-15 16:50:58 +0100
committerFlorent Monjalet <florent.monjalet@gmail.com>2016-01-18 14:02:32 +0100
commitf5f920ce597d0c4e03d0b79aa9b20a70e325cef9 (patch)
tree554b4266252e4c3ec90babc2cefd4b89c11717ac
parent03b3a84e0dd4d4d01b471f1767d4aec68b9a90ad (diff)
downloadmiasm-f5f920ce597d0c4e03d0b79aa9b20a70e325cef9.tar.gz
miasm-f5f920ce597d0c4e03d0b79aa9b20a70e325cef9.zip
Types: MemStruct.get_offset() shorthand for @serpi
-rw-r--r--miasm2/core/types.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/miasm2/core/types.py b/miasm2/core/types.py
index 4bab3bde..b6eaf0e4 100644
--- a/miasm2/core/types.py
+++ b/miasm2/core/types.py
@@ -1362,6 +1362,10 @@ class MemStruct(MemType):
             offset = 0
         return self._addr + offset
 
+    def get_offset(self, field_name):
+        """Shorthand for self.get_type().get_offset(field_name)."""
+        return self._type.get_offset(field_name)
+
     def get_field(self, name):
         """Get a field value by name.