From b06306f8848dcdab884e58757d18b7bf23a35374 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Sat, 27 Feb 2016 01:50:38 +0000 Subject: [PATCH] Fix reducing the tuple mid sorting. --- volatility/framework/automagic/windows.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/volatility/framework/automagic/windows.py b/volatility/framework/automagic/windows.py index 77007c77f..a2c40f628 100644 --- a/volatility/framework/automagic/windows.py +++ b/volatility/framework/automagic/windows.py @@ -25,7 +25,10 @@ def scan(ctx, layer_name, tests): for test in tests: val = test.run(offset, ctx, layer_name) if val: - hits[test.layer_type] = [x for _, x in sorted(hits.get(test.layer_type, []) + [val])] + hits[test.layer_type] = sorted(hits.get(test.layer_type, []) + [val]) + # Don't reduce the tuple until after all the sorting's complete + for test in tests: + hits[test.layer_type] = [x for _, x in hits.get(test.layer_type, [])] return hits