//
// CTLOG_new from 0x1001208 to 0x100132c (292 bytes)
//
// 2 xrefs:
// > CTLOG_new_from_base64 @ 0x10a2cf4
// > ??> @ 0xb2870
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:15:54 +0000
//
__int64 *__fastcall CTLOG_new(__int64 a1, __int64 a2)
{
__int64 *v4; // x19
__int64 v5; // x0
__int64 v7; // [xsp+38h] [xbp+38h] BYREF
v4 = (__int64 *)CRYPTO_zalloc(48, "crypto/ct/ct_log.c", 237);
if ( !v4 )
{
ERR_put_error(50, 117, 65, "crypto/ct/ct_log.c", 240);
return nullptr;
}
v5 = CRYPTO_strdup(a2, "crypto/ct/ct_log.c", 244);
*v4 = v5;
if ( !v5 )
{
ERR_put_error(50, 117, 65, "crypto/ct/ct_log.c", 246);
goto LABEL_7;
}
v7 = 0;
if ( (int)i2d_PUBKEY(a1, &v7) <= 0 )
{
ERR_put_error(50, 125, 113, "crypto/ct/ct_log.c", 81);
CRYPTO_free(v7, "crypto/ct/ct_log.c", 88);
LABEL_7:
CTLOG_free(v4);
return nullptr;
}
SHA256(v7);
CRYPTO_free(v7, "crypto/ct/ct_log.c", 88);
v4[5] = a1;
return v4;
}