mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-06 17:57:38 +02:00
Refactor symbol.offset to symbol.address.
This commit is contained in:
@@ -9,12 +9,12 @@ from volatility.framework import constants, exceptions, validity
|
||||
|
||||
|
||||
class Symbol(validity.ValidityRoutines):
|
||||
def __init__(self, name, offset, type_name = None):
|
||||
def __init__(self, name, address, 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)
|
||||
self._address = self._check_type(address, int)
|
||||
if type_name is None:
|
||||
type_name = name
|
||||
self._type_name = self._check_type(type_name, str)
|
||||
@@ -31,9 +31,9 @@ class Symbol(validity.ValidityRoutines):
|
||||
return self._type_name
|
||||
|
||||
@property
|
||||
def offset(self):
|
||||
"""Returns the relative offset of the symbol within the compilation unit"""
|
||||
return self._offset
|
||||
def address(self):
|
||||
"""Returns the relative address of the symbol within the compilation unit"""
|
||||
return self._address
|
||||
|
||||
|
||||
class SymbolTableInterface(validity.ValidityRoutines):
|
||||
|
||||
@@ -39,8 +39,8 @@ class SymbolSpace(collections.abc.Mapping):
|
||||
for symbol_name in self._dict[table].get_symbols_by_type(type_name):
|
||||
yield table + constants.BANG + symbol_name
|
||||
|
||||
def get_symbols_by_location(self, offset, table_name = None):
|
||||
"""Returns all symbols that exist at a specific relative offset"""
|
||||
def get_symbols_by_location(self, address, table_name = None):
|
||||
"""Returns all symbols that exist at a specific relative address"""
|
||||
table_list = self._dict.values()
|
||||
if table_name is not None:
|
||||
if table_name in self._dict:
|
||||
@@ -48,7 +48,7 @@ class SymbolSpace(collections.abc.Mapping):
|
||||
else:
|
||||
table_list = []
|
||||
for table in table_list:
|
||||
for symbol_name in self._dict[table].get_symbols_by_location(offset = offset):
|
||||
for symbol_name in self._dict[table].get_symbols_by_location(address = address):
|
||||
yield table + constants.BANG + symbol_name
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user