//
// sub_85520C from 0x85520c to 0x8552e8 (220 bytes)
//
// 1 xrefs:
// > sub_855DA8 @ 0x855dac
//
// 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:02:35 +0000
//
int __fastcall sub_85520C(size_t a1, int a2, int a3)
{
int v6; // r0
int v8; // r0
int file; // r8
int v10; // r0
int v11; // r0
int v12; // r4
_BYTE v13[64]; // [sp+0h] [bp-40h] BYREF
if ( a1 )
{
if ( byte_D31664 )
{
LABEL_3:
v6 = sub_84B860(a3);
RAND_bytes(a2, v6);
return 0;
}
if ( RAND_status(a1) )
{
byte_D31664 = 1;
goto LABEL_3;
}
v8 = *(_DWORD *)(a1 + 1100);
if ( v8 )
{
file = RAND_load_file(v8, 1024);
if ( RAND_status(file) )
{
v11 = file;
LABEL_13:
if ( !v11 )
goto LABEL_3;
return 1;
}
}
else
{
file = 0;
}
do
{
if ( !RAND_bytes(v13, 64) )
break;
v10 = RAND_add(v13, 64, 0, 1077936128);
}
while ( !RAND_status(v10) );
*(_BYTE *)(a1 + 1668) = 0;
RAND_file_name(a1 + 1668, 0x4000);
if ( !*(_BYTE *)(a1 + 1668) || (v12 = RAND_load_file(a1 + 1668, 1024), !RAND_status(v12)) )
{
sub_8280FC(a1, "libcurl is now using a weak random seed!\n");
return 1;
}
v11 = v12 + file;
goto LABEL_13;
}
if ( RAND_status(0) )
goto LABEL_3;
return 1;
}