Skip to content

Commit 577747f

Browse files
authored
Merge pull request #1789 from eve-mem/linux_issue_1603
Linux: update extensions used by kallsyms plugin to use utility.pointer_to_string fix issue #1603
2 parents b5c98a0 + 2d80f46 commit 577747f

File tree

1 file changed

+6
-16
lines changed
  • volatility3/framework/symbols/linux/extensions

1 file changed

+6
-16
lines changed

volatility3/framework/symbols/linux/extensions/__init__.py

+6-16
Original file line numberDiff line numberDiff line change
@@ -3065,14 +3065,9 @@ def _do_get_name(self) -> str:
30653065
else:
30663066
raise AttributeError("Unsupported kernel_symbol type implementation")
30673067

3068-
layer = self._context.layers[self.vol.layer_name]
3069-
name_bytes = layer.read(name_offset, linux_constants.KSYM_NAME_LEN)
3070-
3071-
idx = name_bytes.find(b"\x00")
3072-
if idx != -1:
3073-
name_bytes = name_bytes[:idx]
3074-
3075-
return name_bytes.decode("utf-8", errors="ignore")
3068+
return utility.pointer_to_string(
3069+
name_offset, linux_constants.KSYM_NAME_LEN, errors="ignore"
3070+
)
30763071

30773072
def get_name(self) -> Optional[str]:
30783073
try:
@@ -3108,14 +3103,9 @@ def _do_get_namespace(self) -> str:
31083103
else:
31093104
raise AttributeError("Unsupported kernel_symbol type implementation")
31103105

3111-
layer = self._context.layers[self.vol.layer_name]
3112-
namespace_bytes = layer.read(namespace_offset, linux_constants.KSYM_NAME_LEN)
3113-
3114-
idx = namespace_bytes.find(b"\x00")
3115-
if idx != -1:
3116-
namespace_bytes = namespace_bytes[:idx]
3117-
3118-
return namespace_bytes.decode("utf-8", errors="ignore")
3106+
return utility.pointer_to_string(
3107+
namespace_offset, linux_constants.KSYM_NAME_LEN, errors="ignore"
3108+
)
31193109

31203110
def get_namespace(self) -> Optional[str]:
31213111
try:

0 commit comments

Comments
 (0)