//
// localStorageGetItem from 0xaaef78 to 0xaaf11c (420 bytes)
//
// 1 xrefs:
// > ??> @ 0x2bf08
//
// 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
//
const char *__fastcall localStorageGetItem(const char *a1)
{
__int64 v3; // x21
__int64 v4; // x22
const std::string *v5; // x1
cocos2d::CCString *v6; // x20
void *v7; // x0
unsigned int *v8; // x2
int v9; // w1
__int64 v10; // [xsp+38h] [xbp+38h] BYREF
__int64 v11; // [xsp+40h] [xbp+40h] BYREF
__int64 v12; // [xsp+48h] [xbp+48h]
__int64 v13; // [xsp+50h] [xbp+50h]
if ( !(unsigned __int8)cocos2d::JniHelper::getStaticMethodInfo(
&v11,
"org/cocos2dx/lib/Cocos2dxLocalStorage",
"getItem",
"(Ljava/lang/String;)Ljava/lang/String;") )
return nullptr;
v3 = (*(__int64 (__fastcall **)(__int64, const char *))(*(_QWORD *)v11 + 1336LL))(v11, a1);
v4 = _JNIEnv::CallStaticObjectMethod(v11, v12, v13, v3);
cocos2d::JniHelper::jstring2string();
v6 = (cocos2d::CCString *)cocos2d::CCString::create((cocos2d::CCString *)&v10, v5);
v7 = (void *)(v10 - 24);
if ( (__int64 *)(v10 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v10 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *(_DWORD *)(v10 - 8);
*(_DWORD *)(v10 - 8) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v7);
}
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 184LL))(v11, v4);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 184LL))(v11, v3);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 184LL))(v11, v12);
if ( v6 )
return cocos2d::CCString::getCString(v6);
else
return nullptr;
}