mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-29 21:14:55 +02:00
Linux: update extensions used by kallsyms plugin to use utility.pointer_to_string
This commit is contained in:
@@ -3065,14 +3065,7 @@ class kernel_symbol(objects.StructType):
|
||||
else:
|
||||
raise AttributeError("Unsupported kernel_symbol type implementation")
|
||||
|
||||
layer = self._context.layers[self.vol.layer_name]
|
||||
name_bytes = layer.read(name_offset, linux_constants.KSYM_NAME_LEN)
|
||||
|
||||
idx = name_bytes.find(b"\x00")
|
||||
if idx != -1:
|
||||
name_bytes = name_bytes[:idx]
|
||||
|
||||
return name_bytes.decode("utf-8", errors="ignore")
|
||||
return utility.pointer_to_string(name_offset, linux_constants.KSYM_NAME_LEN)
|
||||
|
||||
def get_name(self) -> Optional[str]:
|
||||
try:
|
||||
@@ -3108,14 +3101,9 @@ class kernel_symbol(objects.StructType):
|
||||
else:
|
||||
raise AttributeError("Unsupported kernel_symbol type implementation")
|
||||
|
||||
layer = self._context.layers[self.vol.layer_name]
|
||||
namespace_bytes = layer.read(namespace_offset, linux_constants.KSYM_NAME_LEN)
|
||||
|
||||
idx = namespace_bytes.find(b"\x00")
|
||||
if idx != -1:
|
||||
namespace_bytes = namespace_bytes[:idx]
|
||||
|
||||
return namespace_bytes.decode("utf-8", errors="ignore")
|
||||
return utility.pointer_to_string(
|
||||
namespace_offset, linux_constants.KSYM_NAME_LEN
|
||||
)
|
||||
|
||||
def get_namespace(self) -> Optional[str]:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user