added '-r' switch to the analyzer

command line switch to specify the registry path to use with the analyzer
This commit is contained in:
Elias Bachaalany
2025-01-16 14:00:13 -08:00
parent c4b76640c7
commit 1b712502bd

View File

@@ -11,6 +11,7 @@ namespace
{
bool use_gdb{false};
bool concise_logging{false};
std::string registry_path{"./registry"};
};
void watch_system_objects(windows_emulator& win_emu, const bool cache_logging)
@@ -105,6 +106,7 @@ namespace
emulator_settings settings{
.application = args[0],
.registry_directory = options.registry_path,
.arguments = parse_arguments(args),
.silent_until_main = options.concise_logging,
};
@@ -202,6 +204,16 @@ namespace
{
options.concise_logging = true;
}
else if (arg == "-r")
{
// Make sure there is an argument following "-r"
if (args.size() < 2)
{
throw std::runtime_error("No registry path provided after -r");
}
arg_it = args.erase(arg_it); // Remove the "-r" token from args
options.registry_path = args[0];
}
else
{
break;