//
// o2i_SCT_signature from 0x9f019c to 0x9f02d8 (316 bytes)
//
// 3 xrefs:
// > o2i_SCT @ 0x9f0460
// > SCT_new_from_base64 @ 0xa8eac0
// > ??> @ 0x79f3c
//
// 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 o2i_SCT_signature(int a1, _BYTE **a2, unsigned int a3)
{
_BYTE *v5; // r7
_BYTE *v7; // r8
int v8; // r3
unsigned int v9; // r4
unsigned int v10; // r5
int v11; // r0
bool v12; // zf
int result; // r0
if ( *(_DWORD *)a1 )
{
ERR_put_error(50, 112, 103, "crypto/ct/ct_oct.c", 31);
return -1;
}
else if ( a3 <= 4 )
{
ERR_put_error(50, 112, 107, "crypto/ct/ct_oct.c", 42);
return -1;
}
else
{
v5 = *a2;
*(_BYTE *)(a1 + 40) = **a2;
*(_BYTE *)(a1 + 41) = v5[1];
if ( SCT_get_signature_nid() )
{
v7 = v5 + 4;
v8 = (unsigned __int8)v5[3];
v9 = *a2 - (v5 + 4) + a3;
v10 = v8 | ((unsigned __int8)v5[2] << 8);
if ( v10 > v9 )
{
ERR_put_error(50, 112, 107, "crypto/ct/ct_oct.c", 58);
return -1;
}
else
{
v11 = SCT_set1_signature(a1, v5 + 4, v8 | ((unsigned __int8)v5[2] << 8));
v12 = v11 == 1;
if ( v11 == 1 )
{
v7 += v10;
result = a3 - (v9 - v10);
}
else
{
result = -1;
}
if ( v12 )
*a2 = v7;
}
}
else
{
ERR_put_error(50, 112, 107, "crypto/ct/ct_oct.c", 51);
return -1;
}
}
return result;
}