get-graphics-offsets.h 700 B

12345678910111213141516171819202122232425262728293031
  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. struct dxgi_offsets2 *offsets2);
  21. extern void get_d3d9_offsets(struct d3d9_offsets *offsets);
  22. extern void get_d3d8_offsets(struct d3d8_offsets *offsets);
  23. #ifdef __cplusplus
  24. }
  25. #endif