Added convenience function get_raw_index_from_address

This commit is contained in:
Rob McMullen 2017-05-18 22:12:21 -07:00
parent e74b3b5b34
commit f0c263b588

View File

@ -582,6 +582,12 @@ class DefaultSegment(object):
"""
return self.rawdata.get_raw_index(i)
def get_raw_index_from_address(self, addr):
"""Get index into base array's raw data, given the address of a byte
into this segment
"""
return self.get_raw_index(addr - self.start_addr)
def get_index_from_base_index(self, base_index):
"""Get index into this array's data given the index into the base array
"""