Skip to content

Commit c89c7c3

Browse files
committed
rollback to 635237b to prevent circular import
1 parent 5d50ad2 commit c89c7c3

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

volatility3/framework/symbols/linux/utilities/module_extract.py

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010
Dict,
1111
)
1212

13-
import volatility3.framework.symbols.linux.utilities.modules as linux_utilities_modules
1413
from volatility3 import framework
1514
from volatility3.framework import (
1615
interfaces,
1716
exceptions,
1817
symbols,
1918
)
20-
from volatility3.framework.configuration import requirements
2119
from volatility3.framework.constants import linux as linux_constants
2220
from volatility3.framework.symbols.linux import extensions
2321

@@ -40,21 +38,11 @@
4038
class ModuleExtract(interfaces.configuration.VersionableInterface):
4139
"""Extracts Linux kernel module structures into an analyzable ELF file"""
4240

43-
_version = (1, 0, 2)
41+
_version = (1, 0, 1)
4442
_required_framework_version = (2, 25, 0)
4543

4644
framework.require_interface_version(*_required_framework_version)
4745

48-
@classmethod
49-
def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]:
50-
return [
51-
requirements.VersionRequirement(
52-
name="linux_utilities_modules",
53-
component=linux_utilities_modules.Modules,
54-
version=(3, 0, 2),
55-
),
56-
]
57-
5846
@classmethod
5947
def _find_section(
6048
cls, section_lookups: List[Tuple[str, int, int, int]], sym_address: int
@@ -249,32 +237,17 @@ def _parse_sections(
249237
The data of .strtab is read directly off the module structure and not its section
250238
as the section from the original module has no meaning after loading as the kernel does not reference it.
251239
"""
252-
kernel = context.modules[vmlinux_name]
253-
kernel_layer = context.layers[kernel.layer_name]
254-
modules_addr_min, modules_addr_max = (
255-
linux_utilities_modules.Modules.get_modules_memory_boundaries(
256-
context, vmlinux_name
257-
)
258-
)
259-
modules_addr_min &= kernel_layer.address_mask
260-
modules_addr_max &= kernel_layer.address_mask
261-
262240
original_sections = {}
263241
for index, section in enumerate(module.get_sections()):
264-
# Extra sanity check, to prevent OOM on heavily smeared samples at line
265-
# "size = next_address - address"
266-
if not (
267-
modules_addr_min
268-
<= section.address & kernel_layer.address_mask
269-
< modules_addr_max
270-
):
271-
continue
272242
name = section.get_name()
273243
original_sections[section.address] = name
274244

275245
if not original_sections:
276246
return None
277247

248+
kernel = context.modules[vmlinux_name]
249+
kernel_layer = context.layers[kernel.layer_name]
250+
278251
if symbols.symbol_table_is_64bit(context, kernel.symbol_table_name):
279252
sym_type = "Elf64_Sym"
280253
elf_hdr_type = "Elf64_Ehdr"

0 commit comments

Comments
 (0)