//
// CTLOG_new from 0x9efff8 to 0x9f0110 (280 bytes)
//
// 2 xrefs:
// > CTLOG_new_from_base64 @ 0xa8ee74
// > ??> @ 0x79ecc
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:07:29 +0000
//
int *__fastcall CTLOG_new(int a1, int a2)
{
int *v4; // r4
int v5; // r0
int v6; // r0
int *result; // r0
int v8; // [sp+Ch] [bp-8h] BYREF
v4 = (int *)CRYPTO_zalloc(40, "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;
}
v8 = 0;
v6 = i2d_PUBKEY(a1, &v8);
if ( v6 <= 0 )
{
ERR_put_error(50, 125, 113, "crypto/ct/ct_log.c", 81);
CRYPTO_free(v8, "crypto/ct/ct_log.c", 88);
LABEL_7:
CTLOG_free(v4);
return nullptr;
}
SHA256(v8, v6, v4 + 1);
CRYPTO_free(v8, "crypto/ct/ct_log.c", 88);
result = v4;
v4[9] = a1;
return result;
}