//
// tls12_copy_sigalgs from 0xd585f0 to 0xd58758 (360 bytes)
//
// 3 xrefs:
// > tls_construct_certificate_request @ 0xd527a8
// > ssl_add_clienthello_tlsext @ 0xd58c28
// > ??> @ 0x730c8
//
// 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
//
_BYTE *__fastcall tls12_copy_sigalgs(__int64 a1, _BYTE *a2, unsigned __int8 *a3, unsigned __int64 a4)
{
_BYTE *v8; // x21
unsigned __int8 *v9; // x19
int v10; // w4
int *v12; // x20
unsigned int v13; // w4
if ( !a4 )
return nullptr;
v8 = a2;
v9 = a3;
do
{
v10 = *v9;
if ( !*v9 )
goto LABEL_13;
switch ( v10 )
{
case 1:
v12 = dword_F630C8;
break;
case 2:
v12 = &dword_F630D8;
break;
case 3:
v12 = &dword_F630E8;
break;
case 4:
v12 = &dword_F630F8;
break;
case 5:
v12 = &dword_F63108;
break;
case 6:
v12 = &dword_F63118;
break;
case 237:
v12 = &dword_F63128;
break;
case 238:
v12 = &dword_F63138;
break;
case 239:
v12 = &dword_F63148;
break;
default:
goto LABEL_13;
}
if ( ssl_md(v12[2]) )
{
v13 = v9[1];
if ( v9[1] )
{
if ( v13 <= 3 || v13 - 237 <= 2 )
{
if ( (unsigned int)ssl_security(a1, 0x5000Bu, v12[1], *v12, (__int64)v9) )
{
*v8 = *v9;
v8[1] = v9[1];
v8 += 2;
}
}
}
}
LABEL_13:
v9 += 2;
}
while ( a4 > v9 - a3 );
return (_BYTE *)(v8 - a2);
}