|
8 | 8 | import collections.abc |
9 | 9 | import contextlib |
10 | 10 | import logging |
11 | | -from typing import Any, Dict, List, Mapping, Optional |
| 11 | +from typing import Any, List, Mapping, Optional |
12 | 12 |
|
13 | 13 | from volatility3.framework import constants, interfaces |
14 | 14 |
|
@@ -127,8 +127,11 @@ def __init__( |
127 | 127 | mask = context.layers[object_info.layer_name].address_mask |
128 | 128 | normalized_offset = object_info.offset & mask |
129 | 129 |
|
| 130 | + vol = kwargs |
130 | 131 | vol_info_dict = {"type_name": type_name, "offset": normalized_offset} |
131 | | - self._vol = collections.ChainMap({}, vol_info_dict, object_info, kwargs) |
| 132 | + vol.update(object_info) |
| 133 | + vol.update(vol_info_dict) |
| 134 | + self._vol = collections.ChainMap({}, vol) |
132 | 135 | self._context = context |
133 | 136 |
|
134 | 137 | def __getattr__(self, attr: str) -> Any: |
@@ -309,10 +312,9 @@ def __init__(self, type_name: str, **arguments) -> None: |
309 | 312 | """Stores the keyword arguments for later object creation.""" |
310 | 313 | # Allow the updating of template arguments whilst still in template form |
311 | 314 | super().__init__() |
312 | | - empty_dict: Dict[str, Any] = {} |
313 | | - self._vol = collections.ChainMap( |
314 | | - empty_dict, arguments, {"type_name": type_name} |
315 | | - ) |
| 315 | + vol = {"type_name": type_name} |
| 316 | + vol.update(arguments) |
| 317 | + self._vol = collections.ChainMap({}, vol) |
316 | 318 |
|
317 | 319 | @property |
318 | 320 | def vol(self) -> ReadOnlyMapping: |
|
0 commit comments