mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-23 18:14:51 +02:00
Fix up long standing bugs in enumeration usage.
This commit is contained in:
@@ -388,7 +388,7 @@ class Version1Format(ISFormatTable):
|
||||
lookup = self._json_object['enums'].get(name, None)
|
||||
if not lookup:
|
||||
raise exceptions.SymbolSpaceError("Unknown enumeration: {}".format(name))
|
||||
result = {"choices": copy.deepcopy(lookup['constants']), "base_type": self.natives.get_type(lookup['base'])}
|
||||
result = {"choices": copy.deepcopy(lookup['constants']), "base_type": self.natives.get_type(lookup['type'])}
|
||||
return result
|
||||
|
||||
def get_enumeration(self, enum_name: str) -> interfaces.objects.Template:
|
||||
|
||||
@@ -72,10 +72,10 @@ class NativeTable(interfaces.symbols.NativeTableInterface):
|
||||
additional = {"count": 0, "subtype": self.get_type('void')}
|
||||
elif type_name == 'enum':
|
||||
obj = objects.Enumeration
|
||||
additional = {"base_type": self.get_type('int'), "choices": {}}
|
||||
additional = {"base_type": self.get_type('void'), "choices": {}}
|
||||
elif type_name == 'bitfield':
|
||||
obj = objects.BitField
|
||||
additional = {"start_bit": 0, "end_bit": 0, "base_type": self.get_type('int')}
|
||||
additional = {"start_bit": 0, "end_bit": 0, "base_type": self.get_type('void')}
|
||||
elif type_name == 'string':
|
||||
obj = objects.String
|
||||
additional = {"max_length": 0}
|
||||
|
||||
Reference in New Issue
Block a user