From 1b712502bd654bcf83214f27ed3290163b1cf770 Mon Sep 17 00:00:00 2001 From: Elias Bachaalany Date: Thu, 16 Jan 2025 14:00:13 -0800 Subject: [PATCH 1/2] added '-r' switch to the analyzer command line switch to specify the registry path to use with the analyzer --- src/analyzer/main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/analyzer/main.cpp b/src/analyzer/main.cpp index 18fdba01..2b9a49b5 100644 --- a/src/analyzer/main.cpp +++ b/src/analyzer/main.cpp @@ -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; From 493388beb1e16862c6a88bc83cbf8ac2d81e6b01 Mon Sep 17 00:00:00 2001 From: Elias Bachaalany Date: Fri, 17 Jan 2025 06:33:09 -0800 Subject: [PATCH 2/2] minor mods --- src/analyzer/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/analyzer/main.cpp b/src/analyzer/main.cpp index 2b9a49b5..d33d82ea 100644 --- a/src/analyzer/main.cpp +++ b/src/analyzer/main.cpp @@ -206,12 +206,11 @@ namespace } 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 + arg_it = args.erase(arg_it); options.registry_path = args[0]; } else