(self, fields)
| 84 | """Descriptor of a structure in a memory.""" |
| 85 | |
| 86 | def __init__(self, fields): |
| 87 | self.fields = fields |
| 88 | self.is_flexible = False |
| 89 | for _, type_or_func in fields: |
| 90 | if isinstance(type_or_func, types.FunctionType): |
| 91 | self.is_flexible = True |
| 92 | break |
| 93 | if not self.is_flexible: |
| 94 | self.ctype = Descriptor._GetCtype(fields) |
| 95 | self.size = ctypes.sizeof(self.ctype) |
| 96 | |
| 97 | def Read(self, memory, offset): |
| 98 | if self.is_flexible: |