mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-08-26 08:02:23 +02:00
Improve enumeration support.
This commit is contained in:
@@ -424,8 +424,10 @@ class Enumeration(interfaces.objects.ObjectInterface, int):
|
||||
inverse_choices[v] = k
|
||||
return inverse_choices
|
||||
|
||||
def lookup(self, value: int) -> str:
|
||||
def lookup(self, value: int = None) -> str:
|
||||
"""Looks up an individual value and returns the associated name"""
|
||||
if value is None:
|
||||
return self.lookup(self)
|
||||
if value in self._inverse_choices:
|
||||
return self._inverse_choices[value]
|
||||
raise ValueError("The value of the enumeration is outside the possible choices")
|
||||
|
||||
Reference in New Issue
Block a user