//
// ASN1_UTCTIME_adj from 0xd67f3c to 0xd680dc (416 bytes)
//
// 4 xrefs:
// > ASN1_TIME_adj @ 0xd67868
// > ASN1_UTCTIME_set @ 0xd680e4
// > X509_time_adj_ex @ 0xdea9ec
// > ??> @ 0x745e0
//
// 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_UTCTIME_adj(int *a1, __int64 a2, unsigned int a3, __int64 a4)
{
int *v4; // x20
_DWORD *v7; // x19
int v8; // w23
int v9; // w8
const char *v10; // x21
_QWORD v12[2]; // [xsp+58h] [xbp+48h] BYREF
_BYTE v13[56]; // [xsp+68h] [xbp+58h] BYREF
v4 = a1;
v12[0] = a2;
if ( a1 )
{
v7 = (_DWORD *)OPENSSL_gmtime(v12, v13);
if ( !v7 )
return nullptr;
v8 = 0;
}
else
{
v4 = (int *)ASN1_UTCTIME_new();
if ( !v4 )
return nullptr;
v7 = (_DWORD *)OPENSSL_gmtime(v12, v13);
if ( !v7 )
goto LABEL_17;
v8 = 1;
}
if ( (a3 || a4) && !(unsigned int)OPENSSL_gmtime_adj(v7, a3, a4) )
{
if ( v8 )
goto LABEL_17;
return nullptr;
}
v9 = v7[5];
if ( (unsigned int)(v9 - 50) <= 0x63 )
{
v10 = *((const char **)v4 + 1);
if ( v10 && (unsigned __int64)*v4 > 0x13 )
goto LABEL_11;
v10 = (const char *)CRYPTO_malloc(20, "crypto/asn1/a_utctm.c", 166);
if ( v10 )
{
CRYPTO_free(*((_QWORD *)v4 + 1), "crypto/asn1/a_utctm.c", 171);
v9 = v7[5];
*((_QWORD *)v4 + 1) = v10;
LABEL_11:
BIO_snprintf(v10, 20, "%02d%02d%02d%02d%02d%02dZ", v9 % 100, v7[4] + 1, v7[3], v7[2], v7[1], *v7);
*v4 = strlen(v10);
v4[1] = 23;
return v4;
}
ERR_put_error(13, 218, 65, "crypto/asn1/a_utctm.c", 168);
}
if ( v8 )
LABEL_17:
ASN1_UTCTIME_free(v4);
return nullptr;
}