summaryrefslogtreecommitdiff
path: root/tf2/VFunc.h
blob: f5e09af3184d3e14dc585d2557453fd97b5cf2ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#pragma once
#include <inttypes.h>
#include <intrin.h>

template < typename Fn > __forceinline Fn call_vfunc( void* classbase, int index ) {
	if ( !classbase ) return Fn{ };
	return ( Fn )( ( uintptr_t* )*( uintptr_t** )classbase )[ index ];
}

template < typename T > __forceinline T get_ebp( ) {
	__asm mov eax, ebp
}