//
// TypeMatchHelper<__FrameHandler3> from 0x1801263f8 to 0x180126535 (317 bytes)
//
// 3 xrefs:
// > FindHandler<__FrameHandler3> @ 0x180125fb8
// > IsInExceptionSpec @ 0x180126dd6
// > ??> @ 0x1802028e8
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 10:54:55 +0000
//
__int64 __fastcall TypeMatchHelper<__FrameHandler3>(__int64 a1, __int64 a2, _BYTE *a3)
{
unsigned int v3; // ebx
__int64 v7; // rsi
__int64 v8; // rcx
__int64 v9; // rsi
__int64 v10; // rcx
__int64 v11; // rsi
__int64 v12; // rcx
__int64 v13; // rsi
__int64 v14; // r8
unsigned __int8 *v15; // rax
__int64 v16; // r8
int v17; // edx
int v18; // ecx
v3 = 0;
if ( !*(_DWORD *)(a1 + 4) )
return 1;
v7 = *(int *)(a1 + 4);
if ( !(v7 + GetImageBase(a1)) )
return 1;
if ( (_DWORD)v7 )
{
v9 = *(int *)(a1 + 4);
v10 = v9 + GetImageBase(v8);
}
else
{
v10 = 0;
LODWORD(v9) = 0;
}
if ( !*(_BYTE *)(v10 + 16) || *(char *)a1 < 0 && (*(_BYTE *)a2 & 0x10) != 0 )
return 1;
if ( (_DWORD)v9 )
v11 = *(int *)(a1 + 4) + GetImageBase(v10);
else
v11 = 0;
v12 = *(int *)(a2 + 4) + GetThrowImageBase(v10);
if ( v11 != v12 )
{
v13 = *(_DWORD *)(a1 + 4) ? *(int *)(a1 + 4) + GetImageBase(v12) : 0LL;
v14 = GetThrowImageBase(v12) + *(int *)(a2 + 4) + 16LL;
v15 = (unsigned __int8 *)(v13 + 16);
v16 = v14 - (v13 + 16);
do
{
v17 = v15[v16];
v18 = *v15 - v17;
if ( v18 )
break;
++v15;
}
while ( v17 );
if ( v18 )
return 0;
}
if ( ((*(_BYTE *)a2 & 2) == 0 || (*(_BYTE *)a1 & 8) != 0)
&& ((*a3 & 1) == 0 || (*(_BYTE *)a1 & 1) != 0)
&& ((*a3 & 4) == 0 || (*(_BYTE *)a1 & 4) != 0)
&& ((*a3 & 2) == 0 || (*(_BYTE *)a1 & 2) != 0) )
{
return 1;
}
return v3;
}