added stuff

This commit is contained in:
2026-03-22 16:00:30 +03:00
parent 308f7ed481
commit cc4e01b100
2 changed files with 97 additions and 0 deletions

View File

@@ -116,6 +116,21 @@ namespace omath::rev_eng
return call_method<ReturnType>(vtable[Id], arg_list...);
}
template<std::size_t TableIndex, std::size_t Id, class ReturnType>
ReturnType call_virtual_method(auto... arg_list)
{
const auto vtable = *reinterpret_cast<void***>(
reinterpret_cast<std::uintptr_t>(this) + TableIndex * sizeof(void*));
return call_method<ReturnType>(vtable[Id], arg_list...);
}
template<std::size_t TableIndex, std::size_t Id, class ReturnType>
ReturnType call_virtual_method(auto... arg_list) const
{
const auto vtable = *reinterpret_cast<void* const* const*>(
reinterpret_cast<std::uintptr_t>(this) + TableIndex * sizeof(void*));
return call_method<ReturnType>(vtable[Id], arg_list...);
}
private:
[[nodiscard]]
static const void* resolve_pattern(const std::string_view module_name, const std::string_view pattern)