#pragma once
#include "Utils/MemoryUtils.h"
#include "SDK/Dimension.h"

namespace Hooks {
	class Dimensions {
	private:
		typedef float(__thiscall* GetTimeOfDay_)(Dimension*, void*, void*);
		inline static GetTimeOfDay_ gettimeofday;

		static float callback(Dimension*, void*, void*);
	public:
		inline static int state = -1;
		static void Init() {
			std::thread([&] {
				void* pattern = Utils::Memory::FindPattern(_("44 8B C2 B8 F1"));

				state = Utils::Memory::CreateHook(pattern, (void*)&callback, &gettimeofday);

				if (state == 0)
					MessageBoxA(0, _("The program was terminated due to an error.\nError code: 1-10"), _("Valkyrie"), MB_ICONERROR);
				else
					std::cout << _("Test 1-10... OK\n");
				}).detach();
		}
	};
}
