def dynamic_array_entry_generator(self, offset): ''' Iterate over the dynamic array entries. It will automatically seek() via the reads. We do an infinite loop since we don't know where DT_NULL will be found. @type offset: Integer @param offset: Offset to where the dynamic array can be found ''' while 1: self.elf.seek(offset, 0) offset = offset + CPU_WORD_SIZE * 2 if CPU_WORD_SIZE == 4: yield Elf.Elf32Dynamic(self.elf.read(CPU_WORD_SIZE * 2)) elif CPU_WORD_SIZE == 8: yield Elf.Elf64Dynamic(self.elf.read(CPU_WORD_SIZE * 2))