//
// PEM_dek_info from 0x821600 to 0x8216c8 (200 bytes)
//
// 3 xrefs:
// > PEM_ASN1_write_bio @ 0x822184
// > PEM_X509_INFO_write_bio @ 0x8ba650
// > ??> @ 0x6530c
//
// 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
//
size_t __fastcall PEM_dek_info(char *a1, const char *a2, int a3, unsigned __int8 *a4)
{
size_t result; // r0
int v9; // r6
unsigned __int8 *v10; // r3
char *v11; // r1
unsigned __int8 *v12; // r12
unsigned int v13; // t1
OPENSSL_strlcat(a1, "DEK-Info: ", 0x400u);
OPENSSL_strlcat(a1, a2, 0x400u);
OPENSSL_strlcat(a1, ",", 0x400u);
result = strlen(a1);
v9 = 2 * a3;
if ( (int)(2 * a3 + result) < 1024 )
{
if ( a3 <= 0 )
{
v9 = 0;
}
else
{
v10 = a4;
v11 = &a1[result];
do
{
v12 = v10;
v13 = *v10++;
v11 += 2;
*(v11 - 2) = a0123456789abcd_11[v13 >> 4];
*(v11 - 1) = a0123456789abcd_11[*v12 & 0xF];
}
while ( v10 != &a4[a3] );
}
result += v9;
a1[result] = 10;
a1[result + 1] = 0;
}
return result;
}