Fully fix material exploit
This commit is contained in:
parent
3000a11785
commit
556a8594af
@ -20,10 +20,36 @@ namespace Components
|
||||
}
|
||||
}
|
||||
|
||||
Game::Material* Materials::VerifyMaterial(Game::Material* material)
|
||||
{
|
||||
if (!IsBadReadPtr(material, 4) && !IsBadReadPtr(material->name, 1))
|
||||
{
|
||||
return material;
|
||||
}
|
||||
|
||||
return Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_MATERIAL, "default").material;
|
||||
}
|
||||
|
||||
void __declspec(naked) Materials::DrawMaterialStub()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push eax
|
||||
call Materials::VerifyMaterial
|
||||
add esp, 4h
|
||||
|
||||
mov edx, 5310F0h
|
||||
jmp edx
|
||||
}
|
||||
}
|
||||
|
||||
Materials::Materials()
|
||||
{
|
||||
// Allow codo images
|
||||
Materials::ImageVersionCheckHook.Initialize(0x53A456, Materials::ImageVersionCheck, HOOK_CALL)->Install();
|
||||
|
||||
// Fix material pointer exploit
|
||||
Utils::Hook(0x534E0C, Materials::DrawMaterialStub, HOOK_CALL).Install()->Quick();
|
||||
}
|
||||
|
||||
Materials::~Materials()
|
||||
|
@ -10,5 +10,8 @@ namespace Components
|
||||
private:
|
||||
static Utils::Hook ImageVersionCheckHook;
|
||||
static void ImageVersionCheck();
|
||||
|
||||
static Game::Material* VerifyMaterial(Game::Material* material);
|
||||
static void DrawMaterialStub();
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user