added more callbacks

This commit is contained in:
Elias Bachaalany
2025-02-10 11:25:04 -08:00
parent 760bb9318f
commit 1d7f841ee4
10 changed files with 35 additions and 16 deletions

View File

@@ -95,6 +95,7 @@ mapped_module* module_manager::map_local_module(const std::filesystem::path& fil
const auto image_base = mod.image_base;
const auto entry = this->modules_.try_emplace(image_base, std::move(mod));
this->on_module_load(entry.first->second);
return &entry.first->second;
}
catch (const std::exception& e)
@@ -146,6 +147,7 @@ bool module_manager::unmap(const uint64_t address, const logger& logger)
logger.log("Unmapping %s (0x%" PRIx64 ")\n", mod->second.path.generic_string().c_str(), mod->second.image_base);
this->on_module_unload(mod->second);
unmap_module(*this->memory_, mod->second);
this->modules_.erase(mod);