//
// dtls1_set_message_header from 0x7a583c to 0x7a5884 (72 bytes)
//
// 3 xrefs:
// > dtls_construct_hello_verify_request @ 0x7a8848
// > sub_7B5EFC @ 0x7b5f1c
// > ??> @ 0x5d48c
//
// 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 dtls1_set_message_header(int a1, char a2, int a3, int a4, int a5)
{
__int16 v5; // r5
_WORD *v6; // lr
int result; // r0
_WORD *v8; // r12
result = *(_DWORD *)(a1 + 108);
if ( a4 )
{
v8 = (_WORD *)(result + 264);
}
else
{
v6 = (_WORD *)(result + 264);
v8 = (_WORD *)*(unsigned __int16 *)(result + 266);
}
if ( a4 )
LOWORD(v8) = *v8;
else
v5 = (_WORD)v8 + 1;
if ( !a4 )
{
*v6 = (_WORD)v8;
v6[1] = v5;
}
*(_BYTE *)(result + 288) = a2;
*(_DWORD *)(result + 292) = a3;
*(_WORD *)(result + 296) = (_WORD)v8;
*(_DWORD *)(result + 300) = a4;
*(_DWORD *)(result + 304) = a5;
return result;
}