添加项目文件。

This commit is contained in:
Huoji's
2023-10-01 02:28:13 +08:00
parent ee12160e20
commit effb823be9
73 changed files with 7735 additions and 0 deletions

19
csgo2/vmt.h Normal file
View File

@@ -0,0 +1,19 @@
#pragma once
#include "pch.h"
#define CALL_VIRTUAL(retType, idx, ...) \
vmt::CallVirtual<retType>(idx, __VA_ARGS__)
namespace vmt {
template <typename T = void*>
inline T GetVMethod(uint32_t uIndex, void* pClass) {
void** pVTable = *static_cast<void***>(pClass);
return reinterpret_cast<T>(pVTable[uIndex]);
}
template <typename T, typename... Args>
inline T CallVirtual(uint32_t uIndex, void* pClass, Args... args) {
auto pFunc = GetVMethod<T(__thiscall*)(void*, Args...)>(uIndex, pClass);
return pFunc(pClass, args...);
}
} // namespace vmt