//
// ssl_fill_hello_random from 0x78ed68 to 0x78ede0 (120 bytes)
//
// 3 xrefs:
// > tls_construct_client_hello @ 0x7a0798
// > tls_process_client_hello @ 0x7a9214
// > ??> @ 0x5addc
//
// 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_fill_hello_random(int a1, int a2, _BYTE *a3, int a4)
{
unsigned int v4; // r12
unsigned int v5; // r12
time_t v8; // r0
if ( a4 <= 3 )
return 0;
v4 = *(_DWORD *)(a1 + 304);
if ( a2 )
v5 = v4 >> 6;
else
v5 = v4 >> 5;
if ( (v5 & 1) == 0 )
return RAND_bytes(a3, a4);
v8 = time(nullptr);
a3[3] = v8;
*a3 = HIBYTE(v8);
a3[1] = BYTE2(v8);
a3[2] = BYTE1(v8);
return RAND_bytes(a3 + 4, a4 - 4);
}