//
// OPENSSL_strnlen from 0x81ad04 to 0x81ad60 (92 bytes)
//
// 4 xrefs:
// > sub_7CE07C @ 0x7ce6ec
// > sub_7CE07C @ 0x7ce904
// > CRYPTO_strndup @ 0x81ad74
// > ??> @ 0x5f5ac
//
// 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 OPENSSL_strnlen(unsigned __int8 *a1, int a2)
{
unsigned __int8 *v2; // r1
unsigned __int8 *v3; // r3
unsigned __int8 *v5; // r2
if ( !a2 )
return 0;
if ( !*a1 )
return *a1;
v2 = &a1[a2];
v3 = a1 + 1;
do
{
v5 = v3;
if ( v3 == v2 )
return v3 - a1;
}
while ( *v3++ );
return v5 - a1;
}