//
// ssl_fill_hello_random from 0xd38480 to 0xd38514 (148 bytes)
//
// 3 xrefs:
// > tls_construct_client_hello @ 0xd48e74
// > tls_process_client_hello @ 0xd50eb0
// > ??> @ 0x2b398
//
// 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 ssl_fill_hello_random(__int64 a1, int a2, _BYTE *a3, int a4)
{
unsigned __int64 v4; // x0
int v7; // w0
if ( a4 <= 3 )
return 0;
v4 = *(unsigned int *)(a1 + 488);
if ( !a2 )
{
if ( ((v4 >> 5) & 1) == 0 )
return RAND_bytes(a3, (unsigned int)a4);
LABEL_7:
v7 = time(nullptr);
a3[3] = v7;
*a3 = HIBYTE(v7);
a3[1] = BYTE2(v7);
a3[2] = BYTE1(v7);
return RAND_bytes(a3 + 4, (unsigned int)(a4 - 4));
}
if ( ((v4 >> 6) & 1) != 0 )
goto LABEL_7;
return RAND_bytes(a3, (unsigned int)a4);
}