get-graphics-offsets.h 652 B

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