Skip to content

Commit e7185b2

Browse files
committed
PR comments
1 parent e4aa9af commit e7185b2

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

volatility3/framework/plugins/linux/malware/malfind.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,7 @@ def _list_injections(
6161

6262
proc_layer = self.context.layers[proc_layer_name]
6363

64-
# Allowing a dump_size of 0 (no dump)
65-
dump_size = (
66-
self.config.get("dump-size")
67-
if self.config.get("dump-size") is not None
68-
else 64
69-
)
64+
dump_size = self.config.get("dump-size", None) or 64
7065

7166
# Dumping page defaults to off, as in case a whole r-xp region is dirty
7267
# this would likely dump 1000's of pages which might not always be wise nor necessary

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,10 +1273,20 @@ def get_name(self, context, task) -> Optional[str]:
12731273
except exceptions.InvalidAddressException:
12741274
return None
12751275

1276-
def get_malicious_pages(self, proclayer=None):
1277-
"""
1278-
This function will return a list of all malicious pages inside a given dirty region
1276+
def get_malicious_pages(self, proclayer) -> List[int]:
1277+
"""Identifies and returns a list of potentially malicious memory pages.
1278+
1279+
A page is considered malicious if it is:
1280+
- Executable (protection flags match 'r-x')
1281+
- Dirty (modified since process start, according to proclayer.is_dirty())
1282+
1283+
Args:
1284+
proclayer: The process's memory layer
1285+
1286+
Returns:
1287+
List[int]: A list of virtual addresses for pages flagged as potentially malicious.
12791288
"""
1289+
12801290
malicious_pages = []
12811291
flags_str = self.get_protection()
12821292

0 commit comments

Comments
 (0)