//
// sub_8C4B4C from 0x8c4b4c to 0x8c4c84 (312 bytes)
//
// 2 xrefs:
// > sub_8C4EEC @ 0x8c5260
// > sub_8C4EEC @ 0x8c5650
//
// 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 sub_8C4B4C(int **a1, const char *a2, char *a3)
{
_BYTE *v5; // r0
void *v6; // r5
int v7; // r3
_BYTE *v8; // r12
int v9; // r3
char v10; // r4
unsigned __int32 *p_r_info; // lr
int v12; // r3
int v13; // t1
_DWORD *v14; // r0
void *v15; // r8
if ( a2 )
{
v5 = CRYPTO_strdup(a2, (int)"crypto/asn1/asn_mime.c", 840);
v6 = v5;
if ( !v5 )
{
v15 = nullptr;
a3 = nullptr;
goto LABEL_14;
}
v7 = (unsigned __int8)*v5;
if ( *v5 )
{
v8 = v5;
do
{
v9 = v7 + 1;
v10 = *(_BYTE *)(ctype_ + v9);
p_r_info = &stru_1F3298.r_info;
if ( (v10 & 1) != 0 )
p_r_info = (unsigned __int32 *)&tolower_tab_;
v12 = 2 * v9;
if ( (v10 & 1) != 0 )
*v8 = *(_WORD *)(*p_r_info + v12);
v13 = (unsigned __int8)*++v8;
v7 = v13;
}
while ( v13 );
}
}
else
{
v6 = nullptr;
}
if ( a3 )
{
a3 = (char *)CRYPTO_strdup(a3, (int)"crypto/asn1/asn_mime.c", 852);
if ( !a3 )
{
v15 = nullptr;
LABEL_14:
CRYPTO_free(v6, (int)"crypto/asn1/asn_mime.c", 866);
CRYPTO_free(a3, (int)"crypto/asn1/asn_mime.c", 867);
CRYPTO_free(v15, (int)"crypto/asn1/asn_mime.c", 868);
return 0;
}
}
v14 = CRYPTO_malloc(byte_8, (int)"crypto/asn1/asn_mime.c", 857);
v15 = v14;
if ( !v14 )
goto LABEL_14;
*v14 = v6;
v14[1] = a3;
if ( !OPENSSL_sk_push(*a1, (int)v14) )
goto LABEL_14;
return 1;
}