//
// sub_85BD08 from 0x85bd08 to 0x85bee8 (480 bytes)
//
// 1 xrefs:
// > ??> @ 0xa39794
//
// 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
//
int *__fastcall sub_85BD08(int a1, int a2, _DWORD *a3)
{
int *v4; // r7
signed int i; // r4
unsigned int v6; // r10
int v7; // r2
int v8; // r3
int v9; // r0
int v10; // r5
int v11; // r0
const char *v12; // r11
_DWORD *v13; // r5
char *v15; // [sp+1Ch] [bp-8h] BYREF
v4 = OPENSSL_sk_new_null();
if ( v4 )
{
for ( i = 0; ; ++i )
{
if ( i >= OPENSSL_sk_num((int)a3) )
return v4;
v11 = OPENSSL_sk_value(a3, i);
v12 = *(const char **)(v11 + 8);
v13 = (_DWORD *)v11;
if ( !v12 )
v12 = *(const char **)(v11 + 4);
if ( !strcasecmp(v12, "status_request") )
break;
if ( !strcasecmp(v12, "status_request_v2") )
{
v6 = unk_A39748;
LABEL_18:
v9 = ASN1_INTEGER_new();
v10 = v9;
if ( !v9 )
{
LABEL_19:
ERR_put_error(34, 165, 65, (int)"crypto/x509v3/v3_tlsf.c", 126);
LABEL_21:
OPENSSL_sk_pop_free((int)v4, (void (__fastcall *)(int))ASN1_INTEGER_free);
return nullptr;
}
goto LABEL_12;
}
v6 = strtol(v12, &v15, 10);
v7 = (unsigned __int8)*v15;
if ( *v15 )
v7 = 1;
if ( v12 == v15 )
v8 = v7 | 1;
else
v8 = v7;
if ( v8 || v6 > 0xFFFF )
{
ERR_put_error(34, 165, 143, (int)"crypto/x509v3/v3_tlsf.c", 118);
ERR_add_error_data(6, "section:", *v13, ",name:", v13[1], ",value:", v13[2]);
goto LABEL_21;
}
v9 = ASN1_INTEGER_new();
v10 = v9;
if ( !v9 )
goto LABEL_19;
LABEL_12:
ASN1_INTEGER_set(v9, v6);
OPENSSL_sk_push(v4, v10);
}
v6 = unk_A39740;
goto LABEL_18;
}
ERR_put_error(34, 165, 65, (int)"crypto/x509v3/v3_tlsf.c", 98);
return v4;
}