You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ python3 vol.py -c lsass.json windows.pedump -h
Volatility 3 Framework 2.11.0
usage: volatility windows.pedump.PEDump [-h] [--pid [PID [PID ...]]] --base BASE [--kernel-module]
optional arguments:
-h, --help show this help message and exit
--pid [PID [PID ...]]
Process IDs to include (all other processes are excluded)
--base BASE Base address to reconstruct a PE file
--kernel-module Extract from kernel address space.
The output message when the command is incorrect shows "kernel_module":
$ python3 vol.py -c lsass.json windows.pedump --base 0xe685141b2080
Volatility 3 Framework 2.11.0
Progress: 100.00 PDB scanning finished
PID Process File output
ERROR volatility3.plugins.windows.pedump: --kernel_module or --pid must be set
vollog.error("Only --kernel_module or --pid should be set. Not both")
All argparse arguments are converted from _ to - because you can't have variables with - in the middle (because of the confusion with minus) done here in the current codebase. The error messages probably should be updated not to assume command line parameters (because there ARE other UIs for the volatility library, even though everyone forgets about them). So ideally, the error messages would say Only config options kernel_module or pid should be set, not both and then it's up to the user to translate that into something for their UI. If we wanted, we could have a ConfigOptionException that gets caught by the UI and the options in it translated for the UI, but it'd be opening up a (somewhat small) can of worms to try and do all that.
So the issue at the heart of this is "config options and UI options don't necessarily match up perfectly, so requirements on config options will throw errors that might not map perfectly to the UI". Happy for suggestions of how best to fix it, but those suggestions need to be UI independent. The CLI is not special, and shouldn't get special treatment.
Describe the bug
The error messages in pedump don't match the expected arguments because of the hyphen vs underscore in kernel-module. @ikelos not sure if the error message should just be updated or the "kernel_module" argument should be changed to "kernel-module" at https://github.com/volatilityfoundation/volatility3/blob/develop/volatility3/framework/plugins/windows/pedump.py#L47, but that could affect any code that's expecting the underscore
To Reproduce
Steps to reproduce the behavior:
Help shows "kernel-module"
The output message when the command is incorrect shows "kernel_module":
But if a user tried to run that way it would fail
As the actual argument is "kernel-module" even though the code is "kernel_module".
The text was updated successfully, but these errors were encountered: