//
// ssl_cipher_get_cert_index from 0x79565c to 0x7956a8 (76 bytes)
//
// 4 xrefs:
// > ssl_get_server_send_pkey @ 0x798ed8
// > ssl_get_server_cert_serverinfo @ 0x799090
// > tls_process_server_certificate @ 0x7a1640
// > ??> @ 0x5b70c
//
// 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 ssl_cipher_get_cert_index(int a1)
{
int v1; // r3
int result; // r0
v1 = *(_DWORD *)(a1 + 16);
if ( (v1 & 8) != 0 )
return 3;
result = *(_DWORD *)(a1 + 16) & 2;
if ( (v1 & 2) != 0 )
return 2;
if ( (v1 & 1) == 0 )
{
if ( (v1 & 0x80) != 0 )
{
return 8;
}
else if ( (v1 & 0x20) != 0 )
{
return 4;
}
else
{
return -1;
}
}
return result;
}