css-linux-cheat/include/cstrike/Utilities/Virtuals.h

9 lines
273 B
C
Raw Normal View History

#pragma once
inline void**& GetVirtualTable(void* baseclass) {
return *reinterpret_cast<void***>(baseclass);
}
template <typename Fn = void*> inline Fn GetVirtualFunction(void* baseclass, size_t index) {
return reinterpret_cast<Fn>(GetVirtualTable(baseclass)[index]);
}