diff --git a/include/omath/rev_eng/rev_object.hpp b/include/omath/rev_eng/rev_object.hpp new file mode 100644 index 0000000..fe77b13 --- /dev/null +++ b/include/omath/rev_eng/rev_object.hpp @@ -0,0 +1,27 @@ +// +// Created by Vlad on 8/8/2025. +// + +#pragma once +#include +#include + +namespace omath::rev_eng +{ + class ReverseEngineeredObject + { + protected: + template + [[nodiscard]] Type& get_by_offset(const std::ptrdiff_t offset) const + { + return *reinterpret_cast(reinterpret_cast(this) + offset); + } + + template + ReturnType call_virtual_method(auto... arg_list) + { + using Func = ReturnType(__thiscall*)(void*, decltype(arg_list)...); + return (*static_cast(this))[id](this, arg_list...); + } + }; +} // namespace orev