Esempio n. 1
0
	def __getitem__(self, name):
		try:
			member = core.BNGetStructureMemberByName(self.handle, name)
			return StructureMember(Type(core.BNNewTypeReference(member.contents.type), confidence=member.contents.typeConfidence),
					member.contents.name, member.contents.offset)
		finally:
			core.BNFreeStructureMember(member)
Esempio n. 2
0
	def member_at_offset(self, offset):
		try:
			if self._mutable:
				member = core.BNGetStructureBuilderMemberAtOffset(self._handle, offset, None)
			else:
				member = core.BNGetStructureMemberAtOffset(self._handle, offset, None)
			return StructureMember(Type(core.BNNewTypeReference(member.contents.type), confidence=member.contents.typeConfidence),
					member.contents.name, member.contents.offset)
		finally:
			core.BNFreeStructureMember(member)