Skip to content

Commit

Permalink
Merge pull request #1329 from gcmoreira/linux_fix_merge_hidden_modules
Browse files Browse the repository at this point in the history
linux: hidden_modules: Fix mess with merge #1283
  • Loading branch information
ikelos authored Oct 30, 2024
2 parents 0ee0f44 + e183f81 commit a00a59c
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions volatility3/framework/symbols/linux/extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,18 @@ def mod_mem_type(self) -> Dict:
# mod_mem_type and module_memory were added in kernel 6.4 which replaces
# module_layout for storing the information around core_layout etc.
# see commit ac3b43283923440900b4f36ca5f9f0b1ca43b70e for more information
symbol_table_name = self.get_symbol_table_name()
mod_mem_type_symname = symbol_table_name + constants.BANG + "mod_mem_type"
symbol_space = self._context.symbol_space
try:
mod_mem_type = symbol_space.get_enumeration(mod_mem_type_symname).choices
except exceptions.SymbolError:
mod_mem_type = {}
vollog.debug(
"Unable to find mod_mem_type enum. This message can be ignored for kernels < 6.4"
)

if self._mod_mem_type is None:
try:
self._mod_mem_type = self._context.symbol_space.get_enumeration(
self.get_symbol_table_name() + constants.BANG + "mod_mem_type"
).choices
except exceptions.SymbolError:
vollog.debug(
"Unable to find mod_mem_type enum. This message can be ignored for kernels < 6.4"
)
# set to empty dict to show that the enum was not found, and so shouldn't be searched for again
self._mod_mem_type = {}
return self._mod_mem_type
return mod_mem_type

def _get_mem_type(self, mod_mem_type_name):
module_mem_index = self.mod_mem_type.get(mod_mem_type_name)
Expand Down

0 comments on commit a00a59c

Please sign in to comment.