mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-11 16:46:16 +00:00
Support skipping syscall logging
This commit is contained in:
@@ -472,15 +472,18 @@ namespace
|
||||
}
|
||||
else if (mod->contains(previous_ip))
|
||||
{
|
||||
const auto rsp = emu.read_stack_pointer();
|
||||
if (!c.settings->skip_syscalls)
|
||||
{
|
||||
const auto rsp = emu.read_stack_pointer();
|
||||
|
||||
uint64_t return_address{};
|
||||
emu.try_read_memory(rsp, &return_address, sizeof(return_address));
|
||||
uint64_t return_address{};
|
||||
emu.try_read_memory(rsp, &return_address, sizeof(return_address));
|
||||
|
||||
const auto* caller_mod_name = win_emu.mod_manager.find_name(return_address);
|
||||
const auto* caller_mod_name = win_emu.mod_manager.find_name(return_address);
|
||||
|
||||
win_emu.log.print(color::dark_gray, "Executing syscall: %.*s (0x%X) at 0x%" PRIx64 " via 0x%" PRIx64 " (%s)\n",
|
||||
STR_VIEW_VA(syscall_name), syscall_id, address, return_address, caller_mod_name);
|
||||
win_emu.log.print(color::dark_gray, "Executing syscall: %.*s (0x%X) at 0x%" PRIx64 " via 0x%" PRIx64 " (%s)\n",
|
||||
STR_VIEW_VA(syscall_name), syscall_id, address, return_address, caller_mod_name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@ struct analysis_settings
|
||||
bool silent{false};
|
||||
bool buffer_stdout{false};
|
||||
bool instruction_summary{false};
|
||||
bool skip_syscalls{false};
|
||||
|
||||
string_set modules{};
|
||||
string_set ignored_functions{};
|
||||
|
||||
@@ -650,6 +650,7 @@ namespace
|
||||
printf(" -p, --path <src> <dst> Map Windows path to host path\n");
|
||||
printf(" -r, --registry <path> Set registry path (default: ./registry)\n\n");
|
||||
printf(" -is, --inst-summary Print a summary of executed instructions of the analyzed modules\n");
|
||||
printf(" -ss, --skip-syscalls Skip the logging of regular syscalls\n");
|
||||
printf("Examples:\n");
|
||||
printf(" analyzer -v -e path/to/root myapp.exe\n");
|
||||
printf(" analyzer -e path/to/root -p c:/analysis-sample.exe /path/to/sample.exe c:/analysis-sample.exe\n");
|
||||
@@ -706,6 +707,10 @@ namespace
|
||||
{
|
||||
options.instruction_summary = true;
|
||||
}
|
||||
else if (arg == "-ss" || arg == "--skip-syscalls")
|
||||
{
|
||||
options.skip_syscalls = true;
|
||||
}
|
||||
else if (arg == "-m" || arg == "--module")
|
||||
{
|
||||
if (args.size() < 2)
|
||||
|
||||
Reference in New Issue
Block a user