From bfb874662f6e7da30aed19647fdf2cae21b8f57d Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 14 Aug 2025 19:07:36 +0200 Subject: [PATCH] Cache access in concise mode --- src/analyzer/main.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/analyzer/main.cpp b/src/analyzer/main.cpp index e8878619..3d2afd0c 100644 --- a/src/analyzer/main.cpp +++ b/src/analyzer/main.cpp @@ -471,8 +471,10 @@ namespace if (options.log_foreign_module_access) { + auto module_cache = std::make_shared>(); win_emu->emu().hook_memory_read( - 0, std::numeric_limits::max(), [&](const uint64_t address, const void*, size_t) { + 0, std::numeric_limits::max(), + [&, module_cache](const uint64_t address, const void*, size_t) { const auto rip = win_emu->emu().read_instruction_pointer(); const auto accessor = get_module_if_interesting(win_emu->mod_manager, options.modules, rip); @@ -487,6 +489,15 @@ namespace return; } + if (concise_logging) + { + const auto count = ++(*module_cache)[mod->name]; + if (count > 100 && count % 100000 != 0) + { + return; + } + } + const auto* region_name = get_module_memory_region_name(*mod, address); win_emu->log.print(color::pink, @@ -516,7 +527,7 @@ namespace { static uint64_t count{0}; ++count; - if (count > 100 && count % 100000 != 0) + if (count > 20 && count % 100000 != 0) { return; }