CommonLibSSE (powerof3)
Relocation.h File Reference
#include "REL/Module.h"
#include "SKSE/Trampoline.h"

Go to the source code of this file.

Classes

struct  REL::detail::meets_length_req< T >
 
struct  REL::detail::meets_function_req< T >
 
struct  REL::detail::meets_member_req< T >
 
struct  REL::detail::is_x64_pod< T, class >
 
struct  REL::detail::is_x64_pod< T, std::enable_if_t< std::is_union_v< T > > >
 
struct  REL::detail::is_x64_pod< T, std::enable_if_t< std::is_class_v< T > > >
 
class  REL::Relocation< T >
 

Namespaces

 REL
 
 REL::detail
 

Macros

#define REL_MAKE_MEMBER_FUNCTION_POD_TYPE_HELPER_IMPL(a_nopropQual, a_propQual, ...)
 
#define REL_MAKE_MEMBER_FUNCTION_POD_TYPE_HELPER(a_qualifer, ...)
 
#define REL_MAKE_MEMBER_FUNCTION_POD_TYPE(...)
 
#define REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE_HELPER_IMPL(a_nopropQual, a_propQual, ...)
 
#define REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE_HELPER(a_qualifer, ...)
 
#define REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE(...)
 

Typedefs

template<class F >
using REL::detail::member_function_pod_type_t = typename member_function_pod_type< F >::type
 
template<class F >
using REL::detail::member_function_non_pod_type_t = typename member_function_non_pod_type< F >::type
 

Functions

 REL::detail::REL_MAKE_MEMBER_FUNCTION_POD_TYPE ()
 
 REL::detail::REL_MAKE_MEMBER_FUNCTION_POD_TYPE (const)
 
 REL::detail::REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE ()
 
 REL::detail::REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE (const)
 
template<class F , class First , class... Rest>
decltype(auto) REL::detail::invoke_member_function_non_pod (F &&a_func, First &&a_first, Rest &&... a_rest) noexcept(std::is_nothrow_invocable_v< F, First, Rest... >)
 
template<class F , class... Args>
std::invoke_result_t< F, Args... > REL::invoke (F &&a_func, Args &&... a_args) noexcept(std::is_nothrow_invocable_v< F, Args... >) requires(std
 
void REL::safe_write (std::uintptr_t a_dst, const void *a_src, std::size_t a_count)
 
template<std::integral T>
void REL::safe_write (std::uintptr_t a_dst, const T &a_data)
 
template<class T >
void REL::safe_write (std::uintptr_t a_dst, std::span< T > a_data)
 
void REL::safe_fill (std::uintptr_t a_dst, std::uint8_t a_value, std::size_t a_count)
 

Variables

template<class T >
constexpr bool REL::detail::is_x64_pod_v = is_x64_pod<T>::value
 
constexpr std::uint8_t REL::NOP = 0x90
 
constexpr std::uint8_t REL::NOP2 [] = { 0x66, 0x90 }
 
constexpr std::uint8_t REL::NOP3 [] = { 0x0F, 0x1F, 0x00 }
 
constexpr std::uint8_t REL::NOP4 [] = { 0x0F, 0x1F, 0x40, 0x00 }
 
constexpr std::uint8_t REL::NOP5 [] = { 0x0F, 0x1F, 0x44, 0x00, 0x00 }
 
constexpr std::uint8_t REL::NOP6 [] = { 0x66, 0x0F, 0x1F, 0x44, 0x00, 0x00 }
 
constexpr std::uint8_t REL::NOP7 [] = { 0x0F, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00 }
 
constexpr std::uint8_t REL::NOP8 [] = { 0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }
 
constexpr std::uint8_t REL::NOP9 [] = { 0x66, 0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }
 
constexpr std::uint8_t REL::JMP8 = 0xEB
 
constexpr std::uint8_t REL::JMP32 = 0xE9
 
constexpr std::uint8_t REL::RET = 0xC3
 
constexpr std::uint8_t REL::INT3 = 0xCC
 

Macro Definition Documentation

◆ REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE

#define REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE (   ...)
Value:
REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE_HELPER(&, ##__VA_ARGS__) \
REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE_HELPER(&&, ##__VA_ARGS__)
#define REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE_HELPER(a_qualifer,...)
Definition: Relocation.h:54

◆ REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE_HELPER

#define REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE_HELPER (   a_qualifer,
  ... 
)
Value:
REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE_HELPER_IMPL(a_qualifer, noexcept, ##__VA_ARGS__)
#define REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE_HELPER_IMPL(a_nopropQual, a_propQual,...)
Definition: Relocation.h:35

◆ REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE_HELPER_IMPL

#define REL_MAKE_MEMBER_FUNCTION_NON_POD_TYPE_HELPER_IMPL (   a_nopropQual,
  a_propQual,
  ... 
)
Value:
template < \
class R, \
class Cls, \
class... Args> \
struct member_function_non_pod_type<R (Cls::*)(Args...) __VA_ARGS__ a_nopropQual a_propQual> \
{ \
using type = R&(__VA_ARGS__ Cls*, void*, Args...)a_propQual; \
}; \
\
template < \
class R, \
class Cls, \
class... Args> \
struct member_function_non_pod_type<R (Cls::*)(Args..., ...) __VA_ARGS__ a_nopropQual a_propQual> \
{ \
using type = R&(__VA_ARGS__ Cls*, void*, Args..., ...)a_propQual; \
};

◆ REL_MAKE_MEMBER_FUNCTION_POD_TYPE

#define REL_MAKE_MEMBER_FUNCTION_POD_TYPE (   ...)
Value:
REL_MAKE_MEMBER_FUNCTION_POD_TYPE_HELPER(&, ##__VA_ARGS__) \
REL_MAKE_MEMBER_FUNCTION_POD_TYPE_HELPER(&&, ##__VA_ARGS__)
#define REL_MAKE_MEMBER_FUNCTION_POD_TYPE_HELPER(a_qualifer,...)
Definition: Relocation.h:26

◆ REL_MAKE_MEMBER_FUNCTION_POD_TYPE_HELPER

#define REL_MAKE_MEMBER_FUNCTION_POD_TYPE_HELPER (   a_qualifer,
  ... 
)
Value:
REL_MAKE_MEMBER_FUNCTION_POD_TYPE_HELPER_IMPL(a_qualifer, , ##__VA_ARGS__) \
REL_MAKE_MEMBER_FUNCTION_POD_TYPE_HELPER_IMPL(a_qualifer, noexcept, ##__VA_ARGS__)
#define REL_MAKE_MEMBER_FUNCTION_POD_TYPE_HELPER_IMPL(a_nopropQual, a_propQual,...)
Definition: Relocation.h:7

◆ REL_MAKE_MEMBER_FUNCTION_POD_TYPE_HELPER_IMPL

#define REL_MAKE_MEMBER_FUNCTION_POD_TYPE_HELPER_IMPL (   a_nopropQual,
  a_propQual,
  ... 
)
Value:
template < \
class R, \
class Cls, \
class... Args> \
struct member_function_pod_type<R (Cls::*)(Args...) __VA_ARGS__ a_nopropQual a_propQual> \
{ \
using type = R(__VA_ARGS__ Cls*, Args...) a_propQual; \
}; \
\
template < \
class R, \
class Cls, \
class... Args> \
struct member_function_pod_type<R (Cls::*)(Args..., ...) __VA_ARGS__ a_nopropQual a_propQual> \
{ \
using type = R(__VA_ARGS__ Cls*, Args..., ...) a_propQual; \
};