//
// ASN1_TIME_to_generalizedtime from 0x7c1114 to 0x7c1208 (244 bytes)
//
// 1 xrefs:
// > ??> @ 0x5e46c
//
// 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 ASN1_TIME_to_generalizedtime(int a1, int *a2)
{
int v4; // r4
int v5; // r7
int v6; // r6
int v8; // r0
if ( !ASN1_TIME_check(a1) )
return 0;
if ( a2 )
{
v4 = *a2;
if ( !*a2 )
{
v8 = ASN1_GENERALIZEDTIME_new();
v4 = v8;
if ( !v8 )
return 0;
*a2 = v8;
}
}
else
{
v4 = ASN1_GENERALIZEDTIME_new();
if ( !v4 )
return 0;
}
if ( *(_DWORD *)(a1 + 4) == 24 )
{
if ( ASN1_STRING_set(v4, *(void **)(a1 + 8)) )
return v4;
}
else if ( ASN1_STRING_set(v4, nullptr) )
{
v5 = *(_DWORD *)(v4 + 8);
v6 = *(_DWORD *)a1 + 3;
if ( **(unsigned __int8 **)(a1 + 8) > 0x34u )
OPENSSL_strlcpy(v5, "19", *(_DWORD *)a1 + 3);
else
OPENSSL_strlcpy(v5, "20", *(_DWORD *)a1 + 3);
OPENSSL_strlcat(v5, *(_DWORD *)(a1 + 8), v6);
return v4;
}
return 0;
}