//
// getStringForKeyJNI from 0xb0ef50 to 0xb0f1b8 (616 bytes)
//
// 2 xrefs:
// > cocos2d::CCUserDefault::getStringForKey @ 0xb202f4
// > ??> @ 0x901e0
//
// 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
//
char **__usercall getStringForKeyJNI@(const char *a1@, char *a2@, char **a3@)
{
__int64 v6; // x26
__int64 v7; // x24
__int64 v8; // x25
void *v9; // x0
char *v11; // x0
unsigned int *v12; // x1
int v13; // w2
unsigned int *v14; // x1
int v15; // w2
char *v16; // [xsp+60h] [xbp+60h] BYREF
__int64 v17; // [xsp+68h] [xbp+68h] BYREF
__int64 v18; // [xsp+70h] [xbp+70h] BYREF
__int64 v19; // [xsp+78h] [xbp+78h]
__int64 v20; // [xsp+80h] [xbp+80h]
sub_D153B8((int)&v16, &byte_F288A0);
if ( (unsigned __int8)cocos2d::JniHelper::getStaticMethodInfo(
&v18,
"org/cocos2dx/lib/Cocos2dxHelper",
"getStringForKey",
"(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;") )
{
v6 = (*(__int64 (__fastcall **)(__int64, const char *))(*(_QWORD *)v18 + 1336LL))(v18, a1);
v7 = (*(__int64 (__fastcall **)(__int64, char *))(*(_QWORD *)v18 + 1336LL))(v18, a2);
v8 = _JNIEnv::CallStaticObjectMethod(v18, v19, v20, v6, v7);
cocos2d::JniHelper::jstring2string(&v17, v8);
sub_D163D4(&v16, &v17);
v9 = (void *)(v17 - 24);
if ( (__int64 *)(v17 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v14 = (unsigned int *)(v17 - 8);
do
v15 = __ldaxr(v14);
while ( __stlxr(v15 - 1, v14) );
}
else
{
v15 = *(_DWORD *)(v17 - 8);
*(_DWORD *)(v17 - 8) = v15 - 1;
}
if ( v15 <= 0 )
operator delete(v9);
}
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v18 + 184LL))(v18, v19);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v18 + 184LL))(v18, v6);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v18 + 184LL))(v18, v7);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v18 + 184LL))(v18, v8);
*a3 = v16;
v16 = &byte_124B6C8;
}
else
{
sub_D153B8((int)a3, a2);
v11 = v16 - 24;
if ( v16 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v12 = (unsigned int *)(v16 - 8);
do
v13 = __ldaxr(v12);
while ( __stlxr(v13 - 1, v12) );
}
else
{
v13 = *((_DWORD *)v16 - 2);
*((_DWORD *)v16 - 2) = v13 - 1;
}
if ( v13 <= 0 )
operator delete(v11);
}
}
return a3;
}