//
// ssl3_send_alert from 0xd39888 to 0xd39950 (200 bytes)
//
// 68 xrefs:
// > dtls1_read_bytes @ 0xd30a5c
// > ssl3_read_bytes @ 0xd331f4
// > ssl3_read_bytes @ 0xd336d0
// > ssl3_get_record @ 0xd356b4
// > ssl3_get_record @ 0xd357dc
// > dtls1_process_record @ 0xd35e60
// > ssl3_shutdown @ 0xd380ac
// > ssl_get_prev_session @ 0xd46fec
// > sub_D47644 @ 0xd47bc0
// > sub_D47644 @ 0xd47e7c
// > sub_D47644 @ 0xd47ecc
// > sub_D47644 @ 0xd47f04
// > sub_D47644 @ 0xd47f54
// > ossl_statem_client_read_transition @ 0xd48824
// > tls_construct_client_hello @ 0xd49048
// > tls_construct_client_hello @ 0xd49178
// > dtls_process_hello_verify @ 0xd491fc
// > tls_process_server_hello @ 0xd49304
// > tls_process_server_certificate @ 0xd498e8
// > tls_process_certificate_request @ 0xd49c9c
// > tls_process_certificate_request @ 0xd49eb0
// > tls_process_certificate_request @ 0xd49ee0
// > tls_process_certificate_request @ 0xd49fcc
// > tls_process_certificate_request @ 0xd4a07c
// > tls_process_certificate_request @ 0xd4a0e0
// > tls_process_certificate_request @ 0xd4a15c
// > tls_process_certificate_request @ 0xd4a188
// > tls_process_new_session_ticket @ 0xd4a250
// > tls_process_cert_status @ 0xd4a478
// > tls_construct_client_key_exchange @ 0xd4a734
// > tls_construct_client_key_exchange @ 0xd4a764
// > tls_construct_client_key_exchange @ 0xd4aa0c
// > tls_client_key_exchange_post_work @ 0xd4accc
// > tls_client_key_exchange_post_work @ 0xd4ad2c
// > tls_construct_client_certificate @ 0xd4b1b4
// > ssl3_check_cert_and_algorithm @ 0xd4b240
// > tls_process_key_exchange @ 0xd4b534
// > tls_process_server_done @ 0xd4c1a0
// > tls_process_server_done @ 0xd4c1bc
// > tls_process_server_done @ 0xd4c200
// > tls_process_server_done @ 0xd4c218
// > tls_process_server_done @ 0xd4c240
// > tls_process_server_done @ 0xd4c274
// > tls_prepare_client_certificate @ 0xd4c630
// > tls_prepare_client_certificate @ 0xd4c664
// > dtls_get_message @ 0xd4daa8
// > dtls_get_message @ 0xd4dc64
// > tls_process_change_cipher_spec @ 0xd4e424
// > tls_process_finished @ 0xd4e58c
// > tls_get_message_header @ 0xd4eab8
// > tls_get_message_body @ 0xd4ed74
// > ossl_statem_server_read_transition @ 0xd4fda8
// > ossl_statem_server_read_transition @ 0xd4fecc
// > tls_process_client_hello @ 0xd50784
// > tls_post_process_client_hello @ 0xd51660
// > tls_construct_server_hello @ 0xd51960
// > tls_construct_server_key_exchange @ 0xd52010
// > tls_process_client_key_exchange @ 0xd52878
// > tls_process_cert_verify @ 0xd536c0
// > tls_process_client_certificate @ 0xd53a8c
// > ssl_parse_serverhello_tlsext @ 0xd56d98
// > ssl_parse_serverhello_tlsext @ 0xd56f90
// > ssl_parse_serverhello_tlsext @ 0xd56fe8
// > ssl_parse_clienthello_tlsext @ 0xd5a1ac
// > ssl_parse_clienthello_tlsext @ 0xd5a1e4
// > ssl_parse_clienthello_tlsext @ 0xd5a1f8
// > tls1_set_server_sigalgs @ 0xd5a8cc
// > ??> @ 0x87f78
//
// 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
//
__int64 __fastcall ssl3_send_alert(__int64 a1, int a2, unsigned int a3)
{
int v5; // w0
char v6; // w21
__int64 v7; // x1
__int64 v9; // x1
v5 = (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)(*(_QWORD *)(a1 + 8) + 192LL) + 88LL))(a3);
if ( v5 == 70 && *(_DWORD *)a1 == 768 )
{
v6 = 40;
if ( a2 != 2 )
goto LABEL_5;
goto LABEL_8;
}
v6 = v5;
if ( v5 < 0 )
return 0xFFFFFFFFLL;
if ( a2 == 2 )
{
LABEL_8:
v9 = *(_QWORD *)(a1 + 376);
if ( v9 )
SSL_CTX_remove_session(*(_QWORD *)(a1 + 720), v9);
}
LABEL_5:
v7 = *(_QWORD *)(a1 + 144);
*(_BYTE *)(v7 + 248) = a2;
*(_DWORD *)(v7 + 244) = 1;
*(_BYTE *)(*(_QWORD *)(a1 + 144) + 249LL) = v6;
if ( !(unsigned int)RECORD_LAYER_write_pending(a1 + 928) )
return (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(a1 + 8) + 120LL))(a1);
return 0xFFFFFFFFLL;
}