From d56ccbfd0b749d8f2ad69764658bf8f3856b8d21 Mon Sep 17 00:00:00 2001 From: Abyss Watcher Date: Fri, 1 Mar 2024 14:18:30 +0100 Subject: [PATCH] allow specifying integers as 0x in ListRequirement --- volatility3/cli/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/volatility3/cli/__init__.py b/volatility3/cli/__init__.py index 3de7d8f8f..a67762a31 100644 --- a/volatility3/cli/__init__.py +++ b/volatility3/cli/__init__.py @@ -827,7 +827,11 @@ class CommandLine: requirement, volatility3.framework.configuration.requirements.ListRequirement, ): - additional["type"] = requirement.element_type + # Allow a list of integers, specified with convenient 0x hexadecimal format + if requirement.element_type == int: + additional["type"] = lambda x: int(x, 0) + else: + additional["type"] = requirement.element_type nargs = "*" if requirement.optional else "+" additional["nargs"] = nargs elif isinstance(