Skip to content

Commit 9d67420

Browse files
committed
Improve windows intel detection for Windows 11
1 parent ad1da57 commit 9d67420

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

volatility3/framework/automagic/windows.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ def __call__(
153153
# Mask off the page bits of top level page map
154154
page_table_mask = b"\x00\xf0\xff\xff\xff\xff\xff\xff" * 4
155155
page_table = data[
156-
top_pae_page
157-
- data_offset : top_pae_page
156+
top_pae_page - data_offset : top_pae_page
158157
- data_offset
159158
+ (4 * self.ptr_size)
160159
]
@@ -200,7 +199,7 @@ class WindowsIntelStacker(interfaces.automagic.StackerLayerInterface):
200199
(
201200
"Detecting Self-referential pointer for recent windows",
202201
[DtbSelfRef64bit()],
203-
[(0x150000, 0x150000), (0x650000, 0xA0000)],
202+
[(0x150000, 0x150000), (0x550000, 0xA0000)],
204203
),
205204
(
206205
"Older windows fixed location self-referential pointers",
@@ -305,9 +304,20 @@ def get_max_pointer(page_table, test, ptr_size: int):
305304

306305
hits = sorted(list(hits), key=sort_by_tests)
307306

307+
vollog.debug(f"WindowsIntelStacker hits: {hits}")
308+
308309
for test, page_map_offset in hits:
309310
# Turn the page tables into integers and find the largest one
310311
page_table = base_layer.read(page_map_offset, 0x1000)
312+
313+
# Modern windows can have a dummy page table with only about 2 entries, so sanity check
314+
null_count = sum([1 if page_table[x] else 0 for x in page_table])
315+
if null_count > 0xFA0:
316+
vollog.debug(
317+
f"DTB {page_map_offset:x} contains less than 12 valid pointers, ignoring"
318+
)
319+
continue
320+
311321
ptr_size = struct.calcsize(test.ptr_struct)
312322
max_pointer = get_max_pointer(page_table, test, ptr_size)
313323

0 commit comments

Comments
 (0)