mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-01 04:39:03 +02:00
Merge pull request #720 from volatilityfoundation/issues/issue719
Symbols: Catch bad JSON files without metadata
This commit is contained in:
@@ -11,13 +11,13 @@ import os
|
||||
import pathlib
|
||||
import zipfile
|
||||
from abc import ABCMeta
|
||||
from typing import Any, Dict, Generator, Iterable, List, Optional, Type, Tuple, Mapping
|
||||
from typing import Any, Dict, Generator, Iterable, List, Mapping, Optional, Tuple, Type
|
||||
|
||||
from volatility3 import schemas, symbols
|
||||
from volatility3.framework import class_subclasses, constants, exceptions, interfaces, objects
|
||||
from volatility3.framework.configuration import requirements
|
||||
from volatility3.framework.layers import resources
|
||||
from volatility3.framework.symbols import native, metadata
|
||||
from volatility3.framework.symbols import metadata, native
|
||||
|
||||
vollog = logging.getLogger(__name__)
|
||||
|
||||
@@ -113,6 +113,9 @@ class IntermediateSymbolTable(interfaces.symbols.SymbolTableInterface):
|
||||
|
||||
metadata = json_object.get('metadata', None)
|
||||
|
||||
if not metadata:
|
||||
raise exceptions.SymbolSpaceError(f"Invalid ISF file attempted to be parsed: {isf_url}")
|
||||
|
||||
# Determine the delegate or throw an exception
|
||||
self._delegate = self._closest_version(metadata.get('format', "0.0.0"),
|
||||
self._versions)(context, config_path, name, json_object, native_types,
|
||||
@@ -540,7 +543,8 @@ class Version3Format(Version2Format):
|
||||
if 'type' in symbol:
|
||||
symbol_type = self._interdict_to_template(symbol['type'])
|
||||
|
||||
self._symbol_cache[name] = interfaces.symbols.SymbolInterface(name = name, address = address, type = symbol_type)
|
||||
self._symbol_cache[name] = interfaces.symbols.SymbolInterface(name = name, address = address,
|
||||
type = symbol_type)
|
||||
return self._symbol_cache[name]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user