mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-26 03:24:50 +02:00
Convert to using a BANG variable for the symbol name delimiter.
Whilst it's easy to do now (because we don't yet use it many places) convert the ! delimiter into a variable.
This commit is contained in:
@@ -6,3 +6,4 @@ This includes default scanning block sizes, etc."""
|
||||
import os.path
|
||||
|
||||
PLUGINS_PATH = [os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "plugins"))]
|
||||
BANG = "!"
|
||||
|
||||
@@ -4,13 +4,15 @@ Created on 4 May 2013
|
||||
@author: mike
|
||||
"""
|
||||
|
||||
from volatility.framework import validity, exceptions
|
||||
from volatility.framework import validity, exceptions, constants
|
||||
from volatility.framework.interfaces import configuration
|
||||
|
||||
|
||||
class Symbol(validity.ValidityRoutines):
|
||||
def __init__(self, name, offset, type_name = None):
|
||||
self._name = self._check_type(name, str)
|
||||
if constants.BANG in self._name:
|
||||
raise ValueError("Symbol names cannot contain the symbol differentiator (" + constants.BANG + ")")
|
||||
self._location = None
|
||||
self._offset = self._check_type(offset, int)
|
||||
if type_name is None:
|
||||
|
||||
@@ -8,7 +8,7 @@ import collections
|
||||
import collections.abc
|
||||
import warnings
|
||||
|
||||
from volatility.framework import objects, interfaces, exceptions
|
||||
from volatility.framework import objects, interfaces, exceptions, constants
|
||||
from volatility.framework.symbols import native, vtypes, windows
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ class SymbolSpace(collections.abc.Mapping):
|
||||
else:
|
||||
raise ValueError("Weak_resolve called without a proper SymbolType.")
|
||||
|
||||
name_array = name.split("!")
|
||||
name_array = name.split(constants.BANG)
|
||||
if len(name_array) == 2:
|
||||
table_name = name_array[0]
|
||||
component_name = name_array[1]
|
||||
|
||||
@@ -6,7 +6,7 @@ Created on 10 Apr 2013
|
||||
|
||||
import copy
|
||||
|
||||
from volatility.framework import exceptions, objects, interfaces
|
||||
from volatility.framework import exceptions, objects, interfaces, constants
|
||||
|
||||
|
||||
# ## TODO
|
||||
@@ -86,7 +86,7 @@ class VTypeSymbolTable(interfaces.symbols.SymbolTableInterface):
|
||||
if len(dictionary) > 1:
|
||||
raise exceptions.SymbolSpaceError("Unknown vtype format: " + repr(dictionary))
|
||||
|
||||
return objects.templates.ReferenceTemplate(type_name = self.name + "!" + type_name)
|
||||
return objects.templates.ReferenceTemplate(type_name = self.name + constants.BANG + type_name)
|
||||
|
||||
@property
|
||||
def types(self):
|
||||
@@ -104,7 +104,7 @@ class VTypeSymbolTable(interfaces.symbols.SymbolTableInterface):
|
||||
member = (relative_offset, self._vtypedict_to_template(vtypedict))
|
||||
members[member_name] = member
|
||||
object_class = self.get_type_class(type_name)
|
||||
return objects.templates.ObjectTemplate(type_name = self.name + "!" + type_name,
|
||||
return objects.templates.ObjectTemplate(type_name = self.name + constants.BANG + type_name,
|
||||
object_class = object_class,
|
||||
size = size,
|
||||
members = members)
|
||||
|
||||
Reference in New Issue
Block a user