//
// OPENSSL_strnlen from 0x103e7a4 to 0x103e7f0 (76 bytes)
//
// 4 xrefs:
// > sub_FF1EE0 @ 0xff23fc
// > sub_FF1EE0 @ 0xff2650
// > CRYPTO_strndup @ 0x103e818
// > ??> @ 0xa5370
//
// 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:16:28 +0000
//
__int64 __fastcall OPENSSL_strnlen(_BYTE *a1, __int64 a2)
{
_BYTE *v2; // x2
_BYTE *v3; // x1
_BYTE *v5; // x4
if ( !a2 )
return 0;
if ( !*a1 )
return 0;
v2 = a1 + 1;
v3 = &a1[a2];
do
{
v5 = v2;
if ( v2 == v3 )
return v2 - a1;
}
while ( *v2++ );
return v5 - a1;
}