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