//
// UI_add_verify_string from 0x83a0b4 to 0x83a2b8 (516 bytes)
//
// 2 xrefs:
// > EVP_read_pw_string_min @ 0x8b74e4
// > ??> @ 0x668ac
//
// 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
//
int __fastcall UI_add_verify_string(int a1, int a2, int a3, int a4, int a5, int a6, int a7)
{
_DWORD *v11; // r0
int v12; // r4
int *v13; // r0
int v14; // r0
int v15; // r5
int v17; // r5
if ( !a2 )
{
ERR_put_error(40, 109, 67, (int)"crypto/ui/ui_lib.c", 99);
return -1;
}
if ( !a4 )
{
ERR_put_error(40, 109, 105, (int)"crypto/ui/ui_lib.c", 102);
return -1;
}
v11 = CRYPTO_malloc(&dword_20, (int)"crypto/ui/ui_lib.c", 103);
v12 = (int)v11;
if ( !v11 )
return -1;
v11[1] = a2;
v11[3] = a4;
v13 = *(int **)(a1 + 4);
*(_DWORD *)(v12 + 8) = a3;
*(_DWORD *)(v12 + 28) = 0;
*(_DWORD *)v12 = 2;
if ( !v13 )
{
v13 = OPENSSL_sk_new_null();
*(_DWORD *)(a1 + 4) = v13;
if ( !v13 )
{
if ( (*(_DWORD *)(v12 + 28) & 1) != 0 )
{
CRYPTO_free(*(void **)(v12 + 4), (int)"crypto/ui/ui_lib.c", 56);
if ( *(_DWORD *)v12 == 3 )
{
CRYPTO_free(*(void **)(v12 + 16), (int)"crypto/ui/ui_lib.c", 59);
CRYPTO_free(*(void **)(v12 + 20), (int)"crypto/ui/ui_lib.c", 60);
CRYPTO_free(*(void **)(v12 + 24), (int)"crypto/ui/ui_lib.c", 61);
}
}
CRYPTO_free((void *)v12, (int)"crypto/ui/ui_lib.c", 67);
return -1;
}
}
*(_DWORD *)(v12 + 16) = a5;
*(_DWORD *)(v12 + 20) = a6;
*(_DWORD *)(v12 + 24) = a7;
v14 = OPENSSL_sk_push(v13, v12);
v15 = v14;
if ( v14 > 0 )
return v15;
v17 = v14 - 1;
if ( (*(_DWORD *)(v12 + 28) & 1) != 0 )
{
CRYPTO_free(*(void **)(v12 + 4), (int)"crypto/ui/ui_lib.c", 56);
if ( *(_DWORD *)v12 == 3 )
{
CRYPTO_free(*(void **)(v12 + 16), (int)"crypto/ui/ui_lib.c", 59);
CRYPTO_free(*(void **)(v12 + 20), (int)"crypto/ui/ui_lib.c", 60);
CRYPTO_free(*(void **)(v12 + 24), (int)"crypto/ui/ui_lib.c", 61);
}
}
CRYPTO_free((void *)v12, (int)"crypto/ui/ui_lib.c", 67);
return v17;
}