// // Created by Vlad on 8/8/2025. // #pragma once #include #include namespace omath::rev_eng { class InternalReverseEngineeredObject { protected: template [[nodiscard]] Type& get_by_offset(const std::ptrdiff_t offset) { return *reinterpret_cast(reinterpret_cast(this) + offset); } template [[nodiscard]] const 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) { #ifdef _MSC_VER using VirtualMethodType = ReturnType(__thiscall*)(void*, decltype(arg_list)...); #else using VirtualMethodType = ReturnType(*)(void*, decltype(arg_list)...); #endif return (*reinterpret_cast(this))[id](this, arg_list...); } }; } // namespace omath::rev_eng