mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-12 00:56:16 +00:00
Support silencing the logging until the main function gets executed
This commit is contained in:
@@ -720,9 +720,10 @@ windows_emulator::windows_emulator(const emulator_settings& settings,
|
||||
std::unique_ptr<x64_emulator> emu)
|
||||
: windows_emulator(std::move(emu))
|
||||
{
|
||||
this->silent_until_main = settings.silent_until_main && !settings.disable_logging;
|
||||
this->stdout_callback_ = std::move(settings.stdout_callback);
|
||||
this->use_relative_time_ = settings.use_relative_time;
|
||||
this->logger.disable_output(settings.disable_logging);
|
||||
this->logger.disable_output(settings.disable_logging || this->silent_until_main);
|
||||
this->setup_process(settings);
|
||||
}
|
||||
|
||||
@@ -893,6 +894,12 @@ void windows_emulator::setup_hooks()
|
||||
}
|
||||
else if (address == binary->entry_point)
|
||||
{
|
||||
if (this->silent_until_main && binary == this->process_.executable)
|
||||
{
|
||||
this->silent_until_main = false;
|
||||
this->logger.disable_output(true);
|
||||
}
|
||||
|
||||
logger.print(is_interesting_call ? color::yellow : color::gray,
|
||||
"Executing entry point: %s (0x%llX)\n",
|
||||
binary->name.c_str(),
|
||||
|
||||
@@ -18,6 +18,7 @@ struct emulator_settings
|
||||
std::vector<std::wstring> arguments{};
|
||||
std::function<void(std::string_view)> stdout_callback{};
|
||||
bool disable_logging{false};
|
||||
bool silent_until_main{false};
|
||||
bool use_relative_time{false};
|
||||
};
|
||||
|
||||
@@ -102,6 +103,7 @@ public:
|
||||
bool buffer_stdout{false};
|
||||
bool fuzzing{false};
|
||||
bool switch_thread{false};
|
||||
bool silent_until_main{false};
|
||||
|
||||
void yield_thread();
|
||||
void perform_thread_switch();
|
||||
|
||||
Reference in New Issue
Block a user