Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions hooks/xact_3dapply.cpp

This file was deleted.

2 changes: 2 additions & 0 deletions hooks/xact_3dapply.hook
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0x004D9B21:
call fix__XACTApplyFailed
82 changes: 5 additions & 77 deletions section/xact_3d_fix.cpp
Original file line number Diff line number Diff line change
@@ -1,83 +1,11 @@
void xact_3d_apply()
#include "global.h"

void __cdecl fix__XACTApplyFailed(const char *fmt, const char *reason)
{
static bool once = true;
asm(
"push ebx;"
"push edi;"
"mov ebx,ecx;"
"mov edi,eax;"
"mov eax,dword ptr [ebx];"
"cmp dword ptr [eax+0x34],0x0;"
"je L0xABEL_0x004D9B2A;"
"push esi;"
"push 0x64;"
"lea esi,dword ptr [eax+0xAC];"
"push 0x0;"
"push esi;"
"call 0xA89110;"
"xorps xmm0,xmm0;"
"mov dword ptr [esi+0x3C],0x1;"
"mov dword ptr [esi],0x0;"
"fld dword ptr [edi];"
"fstp dword ptr [esi+0x1C];"
"fld dword ptr [edi+0x4];"
"fstp dword ptr [esi+0x20];"
"fld dword ptr [edi+0x8];"
"movss dword ptr [esi+0x28],xmm0;"
"movss dword ptr [esi+0x2C],xmm0;"
"fstp dword ptr [esi+0x24];"
"movss dword ptr [esi+0x30],xmm0;"
"movss xmm0,dword ptr [0xDFEC20];"
"movss dword ptr [esi+0x5C],xmm0;"
"movss dword ptr [esi+0xC],xmm0;"
"movss dword ptr [esi+0x14],xmm0;"
"mov ecx,dword ptr [ebx];"
"lea edi,dword ptr [ecx+0x7C];"
"lea eax,dword ptr [ecx+0xAC];"
"lea edx,dword ptr [ecx+0x38];"
"add ecx,0x110;"
"push ecx;"
"call 0x4D81E0;"
"add esp,0x10;"
"test eax,eax;"
"jge L0xABEL_0x004D9B04;"
"call 0x4D8A50;"

"push eax;"
"push 0xE0B410;"
"call 0x937D30;"
"add esp,0x8;"

"pop esi;"
"pop edi;"
"pop ebx;"
"ret 0x4;"
"L0xABEL_0x004D9B04:;"
"mov ebx,dword ptr [ebx];"
"mov esi,dword ptr [esp+0x10];"
"lea edi,dword ptr [ebx+0x7C];"
"call 0x4D82A0;"
"test eax,eax;"
"jge L0xABEL_0x004D9B29;"
"call 0x4D8A50;"
);
if(once)
if (once)
{
asm(
"push eax;"
"push 0xE0B430;"
"call 0x937D30;"
"add esp,0x8;"
);
WarningF(fmt, reason);
once = false;
}

asm(
"L0xABEL_0x004D9B29:;"
"pop esi;"
"L0xABEL_0x004D9B2A:;"
"pop edi;"
"pop ebx;"
"ret 0x4;"
);
}