Skip to content

Commit

Permalink
Update Patch.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Belonit committed Jul 29, 2023
1 parent 5f529f9 commit 335c628
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Utilities/Patch.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ struct __declspec(novtable) Patch
template <typename T>
static void Apply_TYPED(DWORD offset, std::initializer_list<T> data)
{
Patch patch = { offset, data.size(), const_cast<byte*>(reinterpret_cast<const byte*>(data.begin())) };
Patch patch = { offset, data.size() * sizeof(T), const_cast<byte*>(reinterpret_cast<const byte*>(data.begin())) };
patch.Apply();
};

template <size_t Size>
static inline void Apply_RAW(DWORD offset, const char(&str)[Size])
{
Patch patch = { offset, Size, (byte*)str };
patch.Apply();
};

Expand Down

0 comments on commit 335c628

Please sign in to comment.