//
// tls_construct_finished from 0xfcc5a8 to 0xfcc71c (372 bytes)
//
// 3 xrefs:
// > ossl_statem_client_construct_message @ 0xfca748
// > ossl_statem_server_construct_message @ 0xfd2814
// > ??> @ 0xadbf0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:15:27 +0000
//
__int64 __fastcall tls_construct_finished(__int64 a1)
{
__int64 v1; // x4
__int64 v2; // x22
unsigned int v4; // w23
int v5; // w0
int v6; // w20
__int64 v7; // x3
size_t v8; // x21
v1 = *(_QWORD *)(*(_QWORD *)(a1 + 8) + 192LL);
v2 = *(_QWORD *)(*(_QWORD *)(a1 + 120) + 8LL);
v4 = *(_DWORD *)(v1 + 108);
v5 = (*(__int64 (**)(void))(v1 + 40))();
v6 = v5;
if ( v5 <= 0 )
return 0;
v7 = *(_QWORD *)(a1 + 144);
v8 = v5;
*(_DWORD *)(v7 + 400) = v5;
memcpy((void *)(v2 + v4), (const void *)(v7 + 272), v5);
if ( *(_DWORD *)(a1 + 56) )
{
if ( v6 > 64 )
OPENSSL_die((int)"assertion failed: i <= EVP_MAX_MD_SIZE");
memcpy((void *)(*(_QWORD *)(a1 + 144) + 897LL), (const void *)(*(_QWORD *)(a1 + 144) + 272LL), v8);
*(_BYTE *)(*(_QWORD *)(a1 + 144) + 961LL) = v6;
}
else
{
if ( v6 > 64 )
OPENSSL_die((int)"assertion failed: i <= EVP_MAX_MD_SIZE");
memcpy((void *)(*(_QWORD *)(a1 + 144) + 832LL), (const void *)(*(_QWORD *)(a1 + 144) + 272LL), v8);
*(_BYTE *)(*(_QWORD *)(a1 + 144) + 896LL) = v6;
}
if ( (*(unsigned int (__fastcall **)(__int64, __int64, size_t))(*(_QWORD *)(*(_QWORD *)(a1 + 8) + 192LL) + 112LL))(
a1,
20,
v8) )
{
return 1;
}
ERR_put_error(20, 359, 68, "ssl/statem/statem_lib.c", 91);
return 0;
}