-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPatcher.h
33 lines (26 loc) · 873 Bytes
/
Patcher.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#include <ext/Events.h>
#include <ext/SKSEMessagingEvents.h>
namespace smp
{
class Patcher :
::Events::EventSink<SKSEMessagingEvent>
{
inline static constexpr std::size_t EXPECTED_IMAGE_SIZE = 0x1E4000;
inline static constexpr std::uintptr_t NIOVTaskDeferredMask_VTBL_RVA = 0x17FC10;
inline static constexpr std::uintptr_t NIOVTaskDeferredMask_Run_RVA = 0xDF8B0;
inline static constexpr std::uintptr_t NIOVTaskDeferredMask_Dispose_RVA = 0x3060;
inline static constexpr std::uintptr_t OPERATOR_DELETE_RVA = 0xFE1B0;
public:
[[nodiscard]] inline static constexpr auto& GetSingleton() noexcept
{
return m_Instance;
}
void Sink();
private:
void Run();
HMODULE DllGetHandleAndValidate();
virtual void Receive(const SKSEMessagingEvent& a_evn) override;
static Patcher m_Instance;
};
}