CommonLibSSE NG
IAT.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace SKSE
4 {
5  [[nodiscard]] std::uintptr_t GetIATAddr(std::string_view a_dll, std::string_view a_function);
6  [[nodiscard]] std::uintptr_t GetIATAddr(REX::W32::HMODULE a_module, std::string_view a_dll, std::string_view a_function);
7 
8  [[nodiscard]] void* GetIATPtr(std::string_view a_dll, std::string_view a_function);
9 
10  template <class T>
11  [[nodiscard]] inline T* GetIATPtr(std::string_view a_dll, std::string_view a_function)
12  {
13  return static_cast<T*>(GetIATPtr(std::move(a_dll), std::move(a_function)));
14  }
15 
16  [[nodiscard]] void* GetIATPtr(REX::W32::HMODULE a_module, std::string_view a_dll, std::string_view a_function);
17 
18  template <class T>
19  [[nodiscard]] inline T* GetIATPtr(REX::W32::HMODULE a_module, std::string_view a_dll, std::string_view a_function)
20  {
21  return static_cast<T*>(GetIATPtr(a_module, std::move(a_dll), std::move(a_function)));
22  }
23 
24  std::uintptr_t PatchIAT(std::uintptr_t a_newFunc, std::string_view a_dll, std::string_view a_function);
25 
26  template <class F>
27  inline std::uintptr_t PatchIAT(F a_newFunc, std::string_view a_dll, std::string_view a_function)
28  {
29  return PatchIAT(stl::unrestricted_cast<std::uintptr_t>(a_newFunc), a_dll, a_function);
30  }
31 }
HINSTANCE HMODULE
Definition: BASE.h:24
Definition: API.h:14
void * GetIATPtr(std::string_view a_dll, std::string_view a_function)
Definition: IAT.h:11
std::uintptr_t GetIATAddr(std::string_view a_dll, std::string_view a_function)
std::uintptr_t PatchIAT(std::uintptr_t a_newFunc, std::string_view a_dll, std::string_view a_function)