//
// ossl_statem_client_pre_work from 0x7a04f8 to 0x7a0594 (156 bytes)
//
// 4 xrefs:
// > sub_79ED8C @ 0x79ef28
// > ??> @ 0x5ce2c
// > sub_79ED8C @ 0x79ee8c
// > ??> @ 0xab8504
//
// 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 ossl_statem_client_pre_work(_DWORD *a1, int a2, int a3, int a4)
{
int v4; // r3
int v6; // r3
v4 = a1[16];
switch ( v4 )
{
case 12:
v6 = *(_DWORD *)(a1[1] + 100);
a1[10] = 0;
if ( (*(_DWORD *)(v6 + 52) & 8) == 0 || ssl3_init_finished_mac(a1) )
return 2;
ossl_statem_set_error((int)a1);
return 0;
case 16:
if ( (*(_DWORD *)(*(_DWORD *)(a1[1] + 100) + 52) & 8) == 0 || !a1[30] )
return 2;
a1[21] = 0;
return 2;
case 1:
return tls_finish_handshake(a1, a2, a3, a4);
default:
return 2;
}
}