//
// GameLevelManager::likeItem from 0x10057e6f0 to 0x10057eef9 (2057 bytes)
//
// 3 xrefs:
// > LikeItemLayer::onLike @ 0x1006cff79
// > LikeItemLayer::onDislike @ 0x1006cfff6
// > LikeItemLayer::triggerLike @ 0x1006d007b
//
// This function is hookable on this platform (idp: pc, 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 12:32:19 +0000
//
__int64 __fastcall GameLevelManager::likeItem(
__int64 a1,
__int64 a2,
unsigned int a3,
unsigned __int8 a4,
unsigned int a5)
{
unsigned int v8; // r15d
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // rax
__int64 v12; // rax
const std::string::value_type *v13; // rax
std::string::value_type *v14; // rsi
__int64 v15; // rax
int v16; // r14d
__int64 v17; // rax
__int64 v18; // rax
char *v19; // rax
__int64 v20; // rax
__int64 v21; // rax
const char *v22; // rbx
size_t v23; // rax
size_t v24; // r14
char *v25; // r15
char *v26; // rbx
size_t v27; // r12
unsigned int v28; // eax
size_t v29; // rax
std::string::size_type v30; // rbx
char *data; // r14
size_t v32; // r15
const std::string::value_type *v33; // rsi
std::string::size_type size; // rdx
const char *v35; // rbx
size_t v36; // rax
size_t v37; // r14
char *v38; // r15
size_t v39; // r12
size_t v40; // rax
size_t v41; // rbx
char *v42; // r14
size_t v43; // r15
char v45; // [rsp+0h] [rbp-1A0h]
char v46; // [rsp+0h] [rbp-1A0h]
__int128 v47; // [rsp+28h] [rbp-178h] BYREF
void *v48; // [rsp+38h] [rbp-168h]
std::string v49; // [rsp+40h] [rbp-160h] BYREF
std::string v50; // [rsp+58h] [rbp-148h] BYREF
char *CString; // [rsp+70h] [rbp-130h]
std::string::value_type *v52; // [rsp+78h] [rbp-128h]
char *v53; // [rsp+80h] [rbp-120h]
char v54; // [rsp+88h] [rbp-118h] BYREF
_BYTE v55[15]; // [rsp+89h] [rbp-117h] BYREF
std::string::value_type *__s; // [rsp+98h] [rbp-108h]
std::string v57; // [rsp+A0h] [rbp-100h] BYREF
_QWORD v58[2]; // [rsp+B8h] [rbp-E8h] BYREF
void *v59; // [rsp+C8h] [rbp-D8h]
__int128 v60; // [rsp+D0h] [rbp-D0h] BYREF
void *v61; // [rsp+E0h] [rbp-C0h]
int v62; // [rsp+ECh] [rbp-B4h]
_QWORD __dst[2]; // [rsp+F0h] [rbp-B0h] BYREF
char *v64; // [rsp+100h] [rbp-A0h]
std::string v65; // [rsp+108h] [rbp-98h] BYREF
char __src[16]; // [rsp+120h] [rbp-80h] BYREF
void *__p; // [rsp+130h] [rbp-70h]
_BYTE v68[32]; // [rsp+150h] [rbp-50h] BYREF
v8 = a2;
if ( (_DWORD)a2 == 1 )
{
v9 = GameManager::sharedState();
GameManager::reportAchievementWithID(v9, "geometry.ach.like", 100, 0);
if ( (unsigned __int8)GameLevelManager::hasLikedItem(a1, 1, a3, 1, a5) )
return __stack_chk_guard;
a2 = 1;
goto LABEL_10;
}
if ( (_DWORD)a2 != 3 )
{
if ( (unsigned __int8)GameLevelManager::hasLikedItem(a1, (unsigned int)a2, a3, 1, a5) )
return __stack_chk_guard;
a2 = (unsigned int)a2;
LABEL_10:
if ( (unsigned __int8)GameLevelManager::hasLikedItem(a1, a2, a3, 0, a5) )
return __stack_chk_guard;
LABEL_11:
GameLevelManager::markItemAsLiked(a1, v8, a3, a4, a5);
v10 = sub_10088E820("like_%i_%i_%i_%i", v45);
CString = (char *)cocos2d::CCString::getCString(v10);
GameLevelManager::getBasePostString(&v65);
v11 = sub_10088E820("%c%s%s%c%c%s", (char)"7");
cocos2d::CCString::getCString(v11);
v12 = sub_10088E820("&itemID=%i&like=%i&type=%i&secret=%s&special=%i", v46);
v13 = (const std::string::value_type *)cocos2d::CCString::getCString(v12);
std::string::append(&v65, v13);
sub_10051B980(&v54, 10);
std::string::append(&v65, "&rs=");
v14 = v55;
v52 = v55;
if ( (v54 & 1) != 0 )
v14 = __s;
std::string::append(&v65, v14);
if ( (v54 & 1) != 0 )
v52 = __s;
v15 = GJAccountManager::sharedState((__int64)&v65, (__int64)v14);
v16 = *(_DWORD *)(v15 + 352) - *(_DWORD *)(v15 + 356);
v17 = GameManager::sharedState();
if ( (*(_BYTE *)(v17 + 608) & 1) != 0 )
{
sub_10001AD30(__src, *(const void **)(v17 + 624), *(_QWORD *)(v17 + 616));
}
else
{
v18 = v17 + 608;
__p = *(void **)(v18 + 16);
*(_OWORD *)__src = *(_OWORD *)v18;
}
v62 = a4;
if ( (__src[0] & 1) != 0 )
v19 = (char *)__p;
else
v19 = &__src[1];
v53 = v19;
GameManager::sharedState();
v20 = sub_10088E820("%c%s%s%c%c%s", (char)"0J");
cocos2d::CCString::getCString(v20);
v21 = sub_10088E820("%i%i%i%i%s%i%s%i%s", v16);
v22 = (const char *)cocos2d::CCString::getCString(v21);
v23 = strlen(v22);
if ( v23 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v24 = v23;
if ( v23 >= 0x17 )
{
v27 = 26;
if ( (v23 | 7) != 0x17 )
v27 = (v23 | 7) + 1;
v25 = (char *)operator new(v27);
v64 = v25;
__dst[0] = v27 | 1;
__dst[1] = v24;
}
else
{
LOBYTE(__dst[0]) = 2 * v23;
v25 = (char *)__dst + 1;
if ( !v23 )
{
BYTE1(__dst[0]) = 0;
if ( (__src[0] & 1) == 0 )
goto LABEL_26;
goto LABEL_25;
}
}
memmove(v25, v22, v24);
v25[v24] = 0;
if ( (__src[0] & 1) == 0 )
{
LABEL_26:
if ( (__dst[0] & 1) != 0 )
v26 = v64;
else
v26 = (char *)__dst + 1;
v28 = strlen(v26);
sub_100872DB0(v26, v28, v68);
sub_100873590(v68, __src);
v29 = strlen(__src);
if ( v29 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v30 = v29;
if ( v29 >= 0x17 )
{
v32 = 26;
if ( (v29 | 7) != 0x17 )
v32 = (v29 | 7) + 1;
data = (char *)operator new(v32);
v57.__r_.__value_.__r.__words[2] = (std::string::size_type)data;
v57.__r_.__value_.__r.__words[0] = v32 | 1;
v57.__r_.__value_.__l.__size_ = v30;
}
else
{
v57.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v29);
data = v57.__r_.__value_.__s.__data_;
if ( !v29 )
{
LABEL_42:
data[v30] = 0;
strcpy((char *)&v47, "\n58281");
cocos2d::ZipUtils::base64EncodeEnc(&v50, &v57, &v47);
if ( (v47 & 1) != 0 )
operator delete(v48);
if ( (*(_BYTE *)&v57.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v57.__r_.__value_.__l.__data_);
std::string::append(&v65, "&chk=");
if ( (*(_BYTE *)&v50.__r_.__value_.__s.0 & 1) != 0 )
{
v33 = v50.__r_.__value_.__l.__data_;
size = v50.__r_.__value_.__l.__size_;
}
else
{
size = *(_BYTE *)&v50.__r_.__value_.__l.0 >> 1;
v33 = v50.__r_.__value_.__s.__data_;
}
std::string::append(&v65, v33, size);
v49.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x38u);
v49.__r_.__value_.__r.__words[0] = 57;
v49.__r_.__value_.__l.__size_ = 52;
strcpy(v49.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/likeGJItem211.php");
if ( (*(_BYTE *)&v65.__r_.__value_.__s.0 & 1) != 0 )
v35 = v65.__r_.__value_.__l.__data_;
else
v35 = v65.__r_.__value_.__s.__data_;
v36 = strlen(v35);
if ( v36 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v37 = v36;
if ( v36 >= 0x17 )
{
v39 = 26;
if ( (v36 | 7) != 0x17 )
v39 = (v36 | 7) + 1;
v38 = (char *)operator new(v39);
v59 = v38;
v58[0] = v39 | 1;
v58[1] = v37;
}
else
{
LOBYTE(v58[0]) = 2 * v36;
v38 = (char *)v58 + 1;
if ( !v36 )
{
LABEL_60:
v38[v37] = 0;
v40 = strlen(CString);
if ( v40 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v41 = v40;
if ( v40 >= 0x17 )
{
v43 = 26;
if ( (v40 | 7) != 0x17 )
v43 = (v40 | 7) + 1;
v42 = (char *)operator new(v43);
v61 = v42;
*(_QWORD *)&v60 = v43 | 1;
*((_QWORD *)&v60 + 1) = v41;
}
else
{
LOBYTE(v60) = 2 * v40;
v42 = (char *)&v60 + 1;
if ( !v40 )
{
LABEL_68:
v42[v41] = 0;
GameLevelManager::ProcessHttpRequest(a1, &v49, (__int64)v58, &v60, 0x10u);
if ( (v60 & 1) != 0 )
{
operator delete(v61);
if ( (v58[0] & 1) == 0 )
{
LABEL_70:
if ( (*(_BYTE *)&v49.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_71;
goto LABEL_79;
}
}
else if ( (v58[0] & 1) == 0 )
{
goto LABEL_70;
}
operator delete(v59);
if ( (*(_BYTE *)&v49.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_71:
if ( (*(_BYTE *)&v50.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_72;
goto LABEL_80;
}
LABEL_79:
operator delete(v49.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v50.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_72:
if ( (__dst[0] & 1) == 0 )
goto LABEL_73;
goto LABEL_81;
}
LABEL_80:
operator delete(v50.__r_.__value_.__l.__data_);
if ( (__dst[0] & 1) == 0 )
{
LABEL_73:
if ( (v54 & 1) == 0 )
goto LABEL_74;
goto LABEL_82;
}
LABEL_81:
operator delete(v64);
if ( (v54 & 1) == 0 )
{
LABEL_74:
if ( (*(_BYTE *)&v65.__r_.__value_.__s.0 & 1) == 0 )
return __stack_chk_guard;
LABEL_75:
operator delete(v65.__r_.__value_.__l.__data_);
return __stack_chk_guard;
}
LABEL_82:
operator delete(__s);
if ( (*(_BYTE *)&v65.__r_.__value_.__s.0 & 1) == 0 )
return __stack_chk_guard;
goto LABEL_75;
}
}
memmove(v42, CString, v41);
goto LABEL_68;
}
}
memmove(v38, v35, v37);
goto LABEL_60;
}
}
memcpy(data, __src, v30);
goto LABEL_42;
}
LABEL_25:
operator delete(__p);
goto LABEL_26;
}
if ( !(unsigned __int8)sub_10057F970(a1, 3, a3, 1, a5) && !(unsigned __int8)sub_10057F970(a1, 3, a3, 0, a5) )
goto LABEL_11;
return __stack_chk_guard;
}