iw4x-client/iw4/Components/Materials.cpp

34 lines
560 B
C++
Raw Normal View History

2015-12-23 10:56:02 -05:00
#include "..\STDInclude.hpp"
namespace Components
{
Utils::Hook Materials::ImageVersionCheckHook;
void __declspec(naked) Materials::ImageVersionCheck()
{
__asm
{
cmp eax, 9
je returnSafely
jmp Materials::ImageVersionCheckHook.Original
returnSafely:
mov al, 1
add esp, 18h
retn
}
}
Materials::Materials()
{
// Allow codo images
Materials::ImageVersionCheckHook.Initialize(0x53A456, Materials::ImageVersionCheck, HOOK_CALL)->Install();
}
Materials::~Materials()
{
Materials::ImageVersionCheckHook.Uninstall();
}
}