//
// dtls_construct_change_cipher_spec from 0xfcb7d4 to 0xfcb8b4 (224 bytes)
//
// 3 xrefs:
// > ossl_statem_client_construct_message @ 0xfca76c
// > ossl_statem_server_construct_message @ 0xfd284c
// > ??> @ 0x62b60
//
// 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:26 +0000
//
__int64 __fastcall dtls_construct_change_cipher_spec(__int64 a1)
{
_BYTE *v1; // x2
__int64 v2; // x1
__int16 v3; // w3
bool v4; // zf
v1 = *(_BYTE **)(*(_QWORD *)(a1 + 120) + 8LL);
*v1 = 1;
v2 = *(_QWORD *)(a1 + 152);
v3 = *(_WORD *)(v2 + 266);
v4 = *(_DWORD *)a1 == 256;
*(_WORD *)(v2 + 264) = v3;
*(_DWORD *)(a1 + 136) = 1;
if ( v4 )
{
*(_WORD *)(v2 + 266) = v3 + 1;
v1[1] = HIBYTE(v3);
v1[2] = *(_WORD *)(*(_QWORD *)(a1 + 152) + 264LL);
v2 = *(_QWORD *)(a1 + 152);
v3 = *(_WORD *)(v2 + 264);
*(_DWORD *)(a1 + 136) += 2;
}
*(_DWORD *)(a1 + 140) = 0;
*(_BYTE *)(v2 + 296) = 1;
*(_QWORD *)(v2 + 304) = 0;
*(_WORD *)(v2 + 312) = v3;
*(_QWORD *)(v2 + 320) = 0;
*(_QWORD *)(v2 + 328) = 0;
if ( (unsigned int)dtls1_buffer_message(a1, 1) )
return 1;
ERR_put_error(20, 371, 68, "ssl/statem/statem_dtls.c", 897);
return 0;
}