//
// UI_dup_error_string from 0xde2c78 to 0xde2e68 (496 bytes)
//
// 1 xrefs:
// > ??> @ 0xc2dd8
//
// 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
//
__int64 __fastcall UI_dup_error_string(__int64 a1, const char *a2)
{
const char *v3; // x20
_QWORD *v4; // x0
__int64 v5; // x19
int *v6; // x0
__int64 result; // x0
unsigned int v8; // w20
if ( !a2 )
{
ERR_put_error(40, 109, 67, (__int64)"crypto/ui/ui_lib.c", 99);
return 0xFFFFFFFFLL;
}
v3 = CRYPTO_strdup(a2, (__int64)"crypto/ui/ui_lib.c", 341);
if ( !v3 )
{
ERR_put_error(40, 101, 65, (__int64)"crypto/ui/ui_lib.c", 343);
return 0xFFFFFFFFLL;
}
v4 = CRYPTO_malloc(&dword_40, (__int64)"crypto/ui/ui_lib.c", 103);
v5 = (__int64)v4;
if ( !v4 )
return 0xFFFFFFFFLL;
v4[1] = v3;
v4[3] = 0;
*((_DWORD *)v4 + 14) = 1;
v6 = *(int **)(a1 + 8);
*(_DWORD *)(v5 + 16) = 0;
*(_DWORD *)v5 = 5;
if ( v6 || (v6 = (int *)OPENSSL_sk_new_null(), (*(_QWORD *)(a1 + 8) = v6) != 0) )
{
*(_DWORD *)(v5 + 32) = 0;
*(_DWORD *)(v5 + 36) = 0;
*(_QWORD *)(v5 + 40) = 0;
result = OPENSSL_sk_push(v6, v5);
if ( (int)result <= 0 )
{
v8 = result - 1;
if ( (*(_DWORD *)(v5 + 56) & 1) != 0 )
{
CRYPTO_free(*(void **)(v5 + 8), (__int64)"crypto/ui/ui_lib.c", 56);
if ( *(_DWORD *)v5 == 3 )
{
CRYPTO_free(*(void **)(v5 + 32), (__int64)"crypto/ui/ui_lib.c", 59);
CRYPTO_free(*(void **)(v5 + 40), (__int64)"crypto/ui/ui_lib.c", 60);
CRYPTO_free(*(void **)(v5 + 48), (__int64)"crypto/ui/ui_lib.c", 61);
}
}
CRYPTO_free((void *)v5, (__int64)"crypto/ui/ui_lib.c", 67);
return v8;
}
}
else
{
if ( (*(_DWORD *)(v5 + 56) & 1) != 0 )
{
CRYPTO_free(*(void **)(v5 + 8), (__int64)"crypto/ui/ui_lib.c", 56);
if ( *(_DWORD *)v5 == 3 )
{
CRYPTO_free(*(void **)(v5 + 32), (__int64)"crypto/ui/ui_lib.c", 59);
CRYPTO_free(*(void **)(v5 + 40), (__int64)"crypto/ui/ui_lib.c", 60);
CRYPTO_free(*(void **)(v5 + 48), (__int64)"crypto/ui/ui_lib.c", 61);
}
}
CRYPTO_free((void *)v5, (__int64)"crypto/ui/ui_lib.c", 67);
return 0xFFFFFFFFLL;
}
return result;
}