switch enum.Enum to enum.IntEnum

This commit is contained in:
superponible
2018-08-30 10:57:18 +01:00
committed by ikelos
parent c676f17fc8
commit eb9a426760
@@ -41,7 +41,7 @@ class RegValueTypes(enum.Enum):
except ValueError:
return cls(RegValueTypes.REG_UNKNOWN)
class RegKeyFlags(enum.Enum):
class RegKeyFlags(enum.IntEnum):
KEY_IS_VOLATILE = 0x01
KEY_HIVE_EXIT = 0x02
KEY_HIVE_ENTRY = 0x04
@@ -53,20 +53,6 @@ class RegKeyFlags(enum.Enum):
KEY_VIRT_TARGET = 0x100
KEY_VIRTUAL_STORE= 0x200
def __and__(self, other):
if self.__class__ is other.__class__:
return self.value & other.value
elif issubclass(other.__class__, int):
return self.value & other
return NotImplemented
def __eq__(self, other):
if self.__class__ is other.__class__:
return self.value == other.value
elif issubclass(other.__class__, int):
return self.value == other
return NotImplemented
class _HMAP_ENTRY(objects.Struct):
def get_block_offset(self) -> int:
try: