Skip to content

Commit b04a498

Browse files
committed
ThrdScan: Fix process filtering
This check was both causing an `InvalidAddressException` due to the member access, while at the same time not being a useful check, since it prevents VADs from being mapped in children of the `System` process.
1 parent 537efa6 commit b04a498

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

volatility3/framework/plugins/windows/thrdscan.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -111,24 +111,23 @@ def gather_thread_info(
111111
return None
112112

113113
# don't look for VADs in kernel threads, just let them get reported with empty paths
114-
if (
115-
owner_proc_pid != 4
116-
and owner_proc.InheritedFromUniqueProcessId != 4
117-
and vads_cache is not None
118-
):
114+
if owner_proc_pid != 4 and vads_cache is not None:
119115
vads = pe_symbols.PESymbols.get_vads_for_process_cache(
120116
vads_cache, owner_proc
121117
)
122-
123-
start_path = pe_symbols.PESymbols.filepath_for_address(
124-
vads, thread_start_addr
125-
)
126-
win32start_path = pe_symbols.PESymbols.filepath_for_address(
127-
vads, thread_win32start_addr
128-
)
129118
else:
130-
start_path = None
131-
win32start_path = None
119+
vads = None
120+
121+
start_path = (
122+
pe_symbols.PESymbols.filepath_for_address(vads, thread_start_addr)
123+
if vads
124+
else None
125+
)
126+
win32start_path = (
127+
pe_symbols.PESymbols.filepath_for_address(vads, thread_win32start_addr)
128+
if vads
129+
else None
130+
)
132131

133132
return (
134133
format_hints.Hex(thread_offset),

0 commit comments

Comments
 (0)