//
// OPENSSL_strnlen from 0xa2f904 to 0xa2f960 (92 bytes)
//
// 4 xrefs:
// > sub_9E2C7C @ 0x9e32ec
// > sub_9E2C7C @ 0x9e3504
// > CRYPTO_strndup @ 0xa2f974
// > ??> @ 0x7902c
//
// 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:03 +0000
//
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;
}