#pragma once

namespace Utils {
    class Memory {
    public:
        static auto getHandle() -> HANDLE;
        static auto FindPattern(const char*) -> void*;


        template <typename P, typename T, typename R>
        static bool CreateHook(P* pTarget, T pDetour, R ppOriginal) {
            if (MH_CreateHook(reinterpret_cast<void*>(pTarget), pDetour, reinterpret_cast<LPVOID*>(ppOriginal)) == MH_OK) {
                if (MH_EnableHook(reinterpret_cast<void*>(pTarget)) == MH_OK) {
                    return true;
                }
            }

            return false;
        }
    };
}
