//
// SRP_VBASE_get1_by_user from 0xa4cab8 to 0xa4cd70 (696 bytes)
//
// 1 xrefs:
// > ??> @ 0x8021c
//
// 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:08:20 +0000
//
_DWORD *__fastcall SRP_VBASE_get1_by_user(_DWORD *a1, const char *a2)
{
int v4; // r4
int v5; // r7
int v6; // r0
int v7; // r1
_DWORD *v8; // r0
_DWORD *v9; // r4
int v10; // r1
int v11; // r2
void *v12; // r0
int *v13; // r6
void *v14; // r0
int *v15; // r5
int *v16; // r0
bool v17; // zf
_DWORD *v19; // r0
int v20; // r3
const char *v21; // r0
const char *v22; // r6
void *v23; // r0
void *v24; // r0
int v25; // r5
int v26; // r0
bool v27; // zf
_BYTE v28[20]; // [sp+0h] [bp-40h] BYREF
_BYTE v29[44]; // [sp+14h] [bp-2Ch] BYREF
if ( a1 )
{
v4 = 0;
while ( 1 )
{
v6 = OPENSSL_sk_num(*a1);
v7 = v4;
if ( v4 >= v6 )
break;
++v4;
v5 = OPENSSL_sk_value(*a1, v7);
if ( !strcmp(*(const char **)v5, a2) )
{
v19 = CRYPTO_malloc(&dword_18, (int)"crypto/srp/srp_vfy.c", 154);
v9 = v19;
if ( v19 )
{
v19[4] = 0;
v19[3] = 0;
v20 = *(_DWORD *)(v5 + 16);
v19[3] = *(_DWORD *)(v5 + 12);
*v19 = 0;
v19[4] = v20;
v21 = *(const char **)v5;
v9[5] = 0;
v9[1] = 0;
v9[2] = 0;
v22 = *(const char **)(v5 + 20);
if ( !v21 || (v23 = CRYPTO_strdup(v21, (int)"crypto/srp/srp_vfy.c", 176), (*v9 = v23) != 0) )
{
if ( !v22 || (v24 = CRYPTO_strdup(v22, (int)"crypto/srp/srp_vfy.c", 178), (v9[5] = v24) != 0) )
{
v25 = BN_dup(*(_DWORD *)(v5 + 4));
v26 = BN_dup(*(_DWORD *)(v5 + 8));
v9[1] = v25;
v27 = v25 == 0;
if ( v25 )
v27 = v26 == 0;
v9[2] = v26;
if ( !v27 )
return v9;
}
}
LABEL_23:
SRP_user_pwd_free((int)v9);
}
return nullptr;
}
}
if ( !a1[2] )
return nullptr;
if ( !a1[3] )
return nullptr;
if ( !a1[4] )
return nullptr;
v8 = CRYPTO_malloc(&dword_18, (int)"crypto/srp/srp_vfy.c", 154);
v9 = v8;
if ( !v8 )
return nullptr;
v10 = a1[3];
v11 = a1[4];
v8[1] = 0;
v8[2] = 0;
*v8 = 0;
v8[5] = 0;
v8[3] = v10;
v8[4] = v11;
if ( !a2 || (v12 = CRYPTO_strdup(a2, (int)"crypto/srp/srp_vfy.c", 176), (*v9 = v12) != 0) )
{
if ( RAND_bytes((int)v28, 20) > 0 )
{
v13 = (int *)EVP_MD_CTX_new();
if ( v13 )
{
v14 = EVP_sha1();
if ( !EVP_DigestInit_ex(v13, (int)v14, nullptr) )
goto LABEL_22;
strlen((const char *)a1[2]);
if ( !EVP_DigestUpdate((int)v13) )
goto LABEL_22;
strlen(a2);
if ( !EVP_DigestUpdate((int)v13) || !EVP_DigestFinal_ex((int **)v13, (int)v29, nullptr) )
goto LABEL_22;
EVP_MD_CTX_free(v13);
v15 = BN_bin2bn(v29, 20, nullptr);
v16 = BN_bin2bn(v28, 20, nullptr);
v9[1] = v15;
v17 = v15 == nullptr;
if ( v15 )
v17 = v16 == nullptr;
v9[2] = v16;
if ( !v17 )
return v9;
}
}
}
v13 = nullptr;
LABEL_22:
EVP_MD_CTX_free(v13);
goto LABEL_23;
}
return nullptr;
}