//
// sub_FB8030 from 0xfb8030 to 0xfb813c (268 bytes)
//
// 2 xrefs:
// > ssl_add_cert_chain @ 0xfb97d8
// > ssl_add_cert_chain @ 0xfb97f4
//
// 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:16 +0000
//
__int64 __fastcall sub_FB8030(__int64 a1, _QWORD *a2, __int64 a3)
{
int v6; // w19
int v8; // w0
_BYTE *v9; // [xsp+38h] [xbp+38h] BYREF
v6 = i2d_X509(a3, 0);
if ( (v6 & 0x80000000) == 0 && BUF_MEM_grow_clean(a1, (int)(*a2 + 3 + v6)) )
{
v9 = (_BYTE *)(*(_QWORD *)(a1 + 8) + *a2);
*v9 = BYTE2(v6);
v9[1] = BYTE1(v6);
v9[2] = v6;
v9 += 3;
v8 = i2d_X509(a3, &v9);
if ( v8 < 0 )
{
ERR_put_error(20, 319, 7, "ssl/ssl_cert.c", 760);
return 0;
}
else
{
*a2 += v8 + 3;
return 1;
}
}
else
{
ERR_put_error(20, 319, 7, "ssl/ssl_cert.c", 752);
return 0;
}
}