//
// RSA_padding_check_SSLv23 from 0xdd8c60 to 0xdd8e18 (440 bytes)
//
// 2 xrefs:
// > sub_DD535C @ 0xdd56f4
// > ??> @ 0xbc5e0
//
// 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 RSA_padding_check_SSLv23(void *a1, int a2, unsigned __int8 *a3, int a4, int a5)
{
int v5; // w4
_BYTE *v6; // x2
int v7; // w3
int v8; // w4
int v9; // w19
unsigned int v12; // w19
if ( a4 <= 9 )
{
ERR_put_error(4, 114, 111, (__int64)"crypto/rsa/rsa_ssl.c", 63);
return 0xFFFFFFFFLL;
}
else if ( a4 + 1 == a5 && (v5 = *a3, v6 = a3 + 1, v5 == 2) )
{
v7 = a4 - 1;
v8 = 0;
v9 = v7;
while ( *v6++ )
{
if ( ++v8 == v7 )
goto LABEL_7;
}
v9 = v8;
LABEL_7:
if ( v9 <= 7 || v9 == v7 )
{
ERR_put_error(4, 114, 113, (__int64)"crypto/rsa/rsa_ssl.c", 79);
return 0xFFFFFFFFLL;
}
else if ( *(v6 - 9) == 3
&& *(v6 - 8) == 3
&& *(v6 - 7) == 3
&& *(v6 - 6) == 3
&& *(v6 - 5) == 3
&& *(v6 - 4) == 3
&& *(v6 - 3) == 3
&& *(v6 - 2) == 3 )
{
ERR_put_error(4, 114, 115, (__int64)"crypto/rsa/rsa_ssl.c", 87);
return 0xFFFFFFFFLL;
}
else
{
v12 = v7 - (v9 + 1);
if ( (int)v12 > a2 )
{
ERR_put_error(4, 114, 109, (__int64)"crypto/rsa/rsa_ssl.c", 94);
return 0xFFFFFFFFLL;
}
else
{
memcpy(a1, v6, v12);
return v12;
}
}
}
else
{
ERR_put_error(4, 114, 107, (__int64)"crypto/rsa/rsa_ssl.c", 67);
return 0xFFFFFFFFLL;
}
}