//
// OPENSSL_LH_retrieve from 0xdb3a78 to 0xdb3b78 (256 bytes)
//
// 24 xrefs:
// > SSL_load_client_CA_file @ 0xd3af08
// > SSL_has_matching_session_id @ 0xd3ea2c
// > SSL_CTX_remove_session @ 0xd466a8
// > SSL_CTX_add_session @ 0xd46a70
// > ssl_get_prev_session @ 0xd46f28
// > ERR_lib_error_string @ 0xd9fb28
// > ERR_func_error_string @ 0xd9fbcc
// > ERR_reason_error_string @ 0xd9fc74
// > ERR_reason_error_string @ 0xd9fcc8
// > OBJ_NAME_get @ 0xdc1304
// > OBJ_nid2obj @ 0xdc210c
// > OBJ_nid2sn @ 0xdc21e8
// > OBJ_nid2ln @ 0xdc22cc
// > OBJ_obj2nid @ 0xdc24b4
// > OBJ_ln2nid @ 0xdc28c0
// > OBJ_sn2nid @ 0xdc2950
// > TXT_DB_get_by_index @ 0xde11dc
// > TXT_DB_insert @ 0xde158c
// > _CONF_get_section @ 0xe23004
// > _CONF_get_string @ 0xe23128
// > _CONF_get_string @ 0xe23170
// > engine_table_register @ 0xe5e2ac
// > engine_table_select @ 0xe5e500
// > ??> @ 0x371d0
//
// 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
//
__int64 __fastcall OPENSSL_LH_retrieve(__int64 a1, __int64 a2)
{
__int64 (__fastcall *v5)(__int64); // x1
unsigned __int64 v6; // x21
unsigned __int64 v7; // x1
unsigned __int64 v8; // x3
unsigned __int64 v9; // x2
unsigned int (__fastcall *v10)(__int64, __int64); // x24
__int64 **v11; // x22
__int64 *v12; // x19
__int64 v13; // x3
__int64 v14; // x0
__int64 result; // x0
v5 = *(__int64 (__fastcall **)(__int64))(a1 + 16);
*(_DWORD *)(a1 + 168) = 0;
v6 = v5(a2);
v7 = *(unsigned int *)(a1 + 36);
v8 = *(unsigned int *)(a1 + 32);
++*(_QWORD *)(a1 + 96);
v9 = v6 % v7;
if ( v6 % v7 < v8 )
v9 = v6 % *(unsigned int *)(a1 + 28);
v10 = *(unsigned int (__fastcall **)(__int64, __int64))(a1 + 8);
v11 = (__int64 **)(*(_QWORD *)a1 + 8LL * (int)v9);
v12 = *v11;
if ( !*v11 )
goto LABEL_10;
while ( 1 )
{
v13 = v12[2];
++*(_QWORD *)(a1 + 160);
if ( v6 == v13 )
{
v14 = *v12;
++*(_QWORD *)(a1 + 104);
if ( !v10(v14, a2) )
break;
}
v11 = (__int64 **)(v12 + 1);
v12 = (__int64 *)v12[1];
if ( !v12 )
goto LABEL_10;
}
if ( *v11 )
{
result = **v11;
++*(_QWORD *)(a1 + 144);
}
else
{
LABEL_10:
++*(_QWORD *)(a1 + 152);
return 0;
}
return result;
}