//
// sub_7A7B94 from 0x7a7b94 to 0x7a7e1c (648 bytes)
//
// 1 xrefs:
// > tls_process_client_key_exchange @ 0x7ab128
//
// 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_7A7B94(int a1, unsigned __int8 **a2, _DWORD *a3)
{
unsigned int v3; // r3
unsigned __int8 *v6; // r0
unsigned int v7; // r3
unsigned int v8; // r5
unsigned __int8 *v9; // r8
int v10; // r9
int v11; // r4
unsigned int v12; // r0
unsigned int v13; // r4
int v14; // r9
int v15; // r3
_BYTE v17[260]; // [sp+8h] [bp-104h] BYREF
v3 = (unsigned int)a2[1];
v6 = *a2;
if ( v3 <= 1 || (v7 = v3 - 2, v8 = v6[1] | (*v6 << 8), v9 = v6 + 2, v8 > v7) )
{
*a3 = 50;
ERR_put_error(20, 414, 159, "ssl/statem/statem_srvr.c", 2062);
return 0;
}
else
{
*a2 = &v9[v8];
a2[1] = (unsigned __int8 *)(v7 - v8);
if ( v8 > 0x80 )
{
*a3 = 50;
ERR_put_error(20, 414, 146, "ssl/statem/statem_srvr.c", 2067);
return 0;
}
else if ( *(_DWORD *)(a1 + 272) )
{
v10 = *(_DWORD *)(a1 + 240);
CRYPTO_free(*(_DWORD *)(v10 + 132), "ssl/statem/../packet_locl.h", 405);
v11 = CRYPTO_strndup(v9, v8, "ssl/statem/../packet_locl.h", 408);
*(_DWORD *)(v10 + 132) = v11;
if ( v11 )
{
v12 = (*(int (__fastcall **)(int, _DWORD, _BYTE *, int))(a1 + 272))(
a1,
*(_DWORD *)(*(_DWORD *)(a1 + 240) + 132),
v17,
256);
v13 = v12;
if ( v12 > 0x100 )
{
*a3 = 80;
ERR_put_error(20, 414, 68, "ssl/statem/statem_srvr.c", 2087);
return 0;
}
else if ( v12 )
{
CRYPTO_free(*(_DWORD *)(*(_DWORD *)(a1 + 104) + 608), "ssl/statem/statem_srvr.c", 2099);
v14 = *(_DWORD *)(a1 + 104);
*(_DWORD *)(v14 + 608) = CRYPTO_memdup(v17, v13, "ssl/statem/statem_srvr.c", 2100);
OPENSSL_cleanse(v17, v13);
v15 = *(_DWORD *)(a1 + 104);
if ( *(_DWORD *)(v15 + 608) )
{
*(_DWORD *)(v15 + 612) = v13;
return 1;
}
else
{
*a3 = 80;
ERR_put_error(20, 414, 65, "ssl/statem/statem_srvr.c", 2105);
return 0;
}
}
else
{
*a3 = 115;
ERR_put_error(20, 414, 223, "ssl/statem/statem_srvr.c", 2095);
return v13;
}
}
else
{
*a3 = 80;
ERR_put_error(20, 414, 68, "ssl/statem/statem_srvr.c", 2078);
return 0;
}
}
else
{
*a3 = 80;
ERR_put_error(20, 414, 225, "ssl/statem/statem_srvr.c", 2072);
return 0;
}
}
}