//
// dtls1_query_mtu from 0x7b6fec to 0x7b70cc (224 bytes)
//
// 3 xrefs:
// > dtls1_do_write @ 0x7a4da4
// > dtls1_do_write @ 0x7a518c
// > ??> @ 0x5d3fc
//
// 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_query_mtu(int a1)
{
int v1; // r5
int v3; // r6
unsigned int v4; // r5
int wbio; // r0
int v7; // r6
int v8; // r0
int v9; // r0
int v10; // r3
unsigned int v11; // r6
int v12; // r6
int v13; // r0
v1 = *(_DWORD *)(a1 + 108);
v3 = *(_DWORD *)(v1 + 280);
if ( v3 )
{
wbio = SSL_get_wbio(a1);
*(_DWORD *)(v1 + 284) = v3 - BIO_ctrl(wbio, 49, 0, 0);
v1 = *(_DWORD *)(a1 + 108);
*(_DWORD *)(v1 + 280) = 0;
}
v4 = *(_DWORD *)(v1 + 284);
if ( v4 >= dtls1_min_mtu(a1) )
return 1;
if ( (SSL_get_options(a1) & 0x1000) == 0 )
{
v7 = *(_DWORD *)(a1 + 108);
v8 = SSL_get_wbio(a1);
v9 = BIO_ctrl(v8, 40, 0, 0);
v10 = *(_DWORD *)(a1 + 108);
*(_DWORD *)(v7 + 284) = v9;
v11 = *(_DWORD *)(v10 + 284);
if ( v11 < dtls1_min_mtu(a1) )
{
v12 = *(_DWORD *)(a1 + 108);
*(_DWORD *)(v12 + 284) = dtls1_min_mtu(a1);
v13 = SSL_get_wbio(a1);
BIO_ctrl(v13, 42, *(_DWORD *)(*(_DWORD *)(a1 + 108) + 284), 0);
}
return 1;
}
return 0;
}