MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / __int__

Method __int__

python/binaryview.py:10807–10820  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

10805 return f"<StructuredDataValue type:{self.type} value:{self}>"
10806
10807 def __int__(self):
10808 if self.type.width == 1:
10809 code = "B"
10810 elif self.type.width == 2:
10811 code = "H"
10812 elif self.type.width == 4:
10813 code = "I"
10814 elif self.type.width == 8:
10815 code = "Q"
10816 else:
10817 raise Exception("Could not convert to integer with width {}".format(self.type.width))
10818
10819 endian = "<" if self.endian == Endianness.LittleEndian else ">"
10820 return struct.unpack(f"{endian}{code}", self.value)[0]
10821
10822 @property
10823 def str(self) -> str:

Callers

nothing calls this directly

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected