1 #pragma once 2 3 #include <stdint.h> 4 #include <stdbool.h> 5 #include "../graphics-hook-info.h" 6 7 #define DUMMY_WNDCLASS "get_addrs_wndclass" 8 9 #ifdef __cplusplus 10 extern "C" { 11 #else 12 #if defined(_MSC_VER) && !defined(inline) 13 #define inline __inline 14 #endif 15 #endif 16 vtable_offset(HMODULE module,void * cls,unsigned int offset)17static inline uint32_t vtable_offset(HMODULE module, void *cls, 18 unsigned int offset) 19 { 20 uintptr_t *vtable = *(uintptr_t **)cls; 21 return (uint32_t)(vtable[offset] - (uintptr_t)module); 22 } 23 24 extern void get_dxgi_offsets(struct dxgi_offsets *offsets, 25 struct dxgi_offsets2 *offsets2); 26 extern void get_d3d9_offsets(struct d3d9_offsets *offsets); 27 extern void get_d3d8_offsets(struct d3d8_offsets *offsets); 28 29 #ifdef __cplusplus 30 } 31 #endif 32