//
// sub_8424C8 from 0x8424c8 to 0x8426a4 (476 bytes)
//
// 2 xrefs:
// > sub_843DE0 @ 0x844b24
// > X509_verify_cert @ 0x845390
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
bool __fastcall sub_8424C8(int a1)
{
_DWORD *v1; // r5
int v3; // r6
int v4; // r0
int v5; // r7
void *v6; // r0
unsigned int v7; // r4
int v8; // r0
int v9; // r1
int v10; // r1
int v12; // r1
int v13; // r1
int v14; // r1
v1 = *(_DWORD **)(a1 + 16);
v3 = *(_DWORD *)(a1 + 4);
v4 = v1[9];
if ( v4 )
{
v5 = OPENSSL_sk_num(v4);
v6 = (void *)v1[11];
if ( v6 )
{
CRYPTO_free(v6, (int)"crypto/x509/x509_vfy.c", 686);
v1[11] = 0;
}
if ( v5 <= 0 )
{
if ( v5 )
{
LABEL_18:
v13 = *(_DWORD *)(a1 + 4);
*(_DWORD *)(a1 + 92) = 0;
if ( !v13 )
v13 = OPENSSL_sk_value(*(_DWORD **)(a1 + 80), 0);
*(_DWORD *)(a1 + 100) = v13;
*(_DWORD *)(a1 + 96) = 62;
if ( !(*(int (__fastcall **)(_DWORD, int))(a1 + 28))(0, a1) )
return 0;
}
}
else
{
v7 = 0;
while ( 1 )
{
v8 = OPENSSL_sk_value((_DWORD *)v1[9], v7++);
if ( X509_check_host(v3, v8, 0, v1[10], v1 + 11) > 0 )
break;
if ( v7 == v5 )
goto LABEL_18;
}
}
}
v9 = v1[12];
if ( v9 && X509_check_email(v3, v9, v1[13], 0) <= 0 )
{
v14 = *(_DWORD *)(a1 + 4);
*(_DWORD *)(a1 + 92) = 0;
if ( !v14 )
v14 = OPENSSL_sk_value(*(_DWORD **)(a1 + 80), 0);
*(_DWORD *)(a1 + 100) = v14;
*(_DWORD *)(a1 + 96) = 63;
if ( !(*(int (__fastcall **)(_DWORD, int))(a1 + 28))(0, a1) )
return 0;
}
v10 = v1[14];
if ( !v10 || X509_check_ip(v3, v10, v1[15], 0) > 0 )
return 1;
v12 = *(_DWORD *)(a1 + 4);
*(_DWORD *)(a1 + 92) = 0;
if ( !v12 )
v12 = OPENSSL_sk_value(*(_DWORD **)(a1 + 80), 0);
*(_DWORD *)(a1 + 100) = v12;
*(_DWORD *)(a1 + 96) = 64;
return (*(int (__fastcall **)(_DWORD, int))(a1 + 28))(0, a1) != 0;
}