//
// EditorUI::replaceGroupID from 0x100016150 to 0x1000163e3 (659 bytes)
//
// 1 xrefs:
// > EditorUI::dynamicGroupUpdate @ 0x100015df6
//
// 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:18:54 +0000
//
__int64 __fastcall EditorUI::replaceGroupID(__int64 a1, unsigned int *a2, unsigned int a3, unsigned int a4)
{
char v4; // al
unsigned int v7; // r13d
__int64 result; // rax
unsigned int v9; // r13d
__int64 v10; // rax
__int64 v11; // r12
const char *v12; // rax
__int64 v13; // rax
__int64 CString; // rax
char v15; // [rsp-8h] [rbp-30h]
v15 = v4;
if ( *((__int16 *)a2 + 584) > 0 )
{
v7 = 0;
while ( (unsigned int)GameObject::getGroupID(a2, v7) != a3 )
{
if ( (int)++v7 >= *((__int16 *)a2 + 584) )
goto LABEL_7;
}
(*(void (__fastcall **)(unsigned int *, _QWORD))(*(_QWORD *)a2 + 1608LL))(a2, a3);
(*(void (__fastcall **)(unsigned int *, _QWORD))(*(_QWORD *)a2 + 1600LL))(a2, a4);
}
LABEL_7:
result = GJBaseGameLayer::remapGroupParent(*(_QWORD *)(a1 + 1440), a2, a3, a4);
if ( a2[312] != 1 )
return result;
v9 = a2[366];
if ( v9 == a3 )
{
EffectGameObject::setTargetID(a2, a4);
if ( a2[367] != a3 )
{
LABEL_10:
if ( a2[420] != a3 )
goto LABEL_11;
goto LABEL_16;
}
}
else if ( a2[367] != a3 )
{
goto LABEL_10;
}
EffectGameObject::setTargetID2(a2, a4);
if ( a2[420] != a3 )
{
LABEL_11:
if ( a2[417] != a3 )
goto LABEL_12;
goto LABEL_17;
}
LABEL_16:
a2[420] = a4;
if ( a2[417] != a3 )
{
LABEL_12:
result = a2[257];
if ( (_DWORD)result == 899 )
return result;
goto LABEL_18;
}
LABEL_17:
a2[417] = a4;
result = a2[257];
if ( (_DWORD)result == 899 )
return result;
LABEL_18:
if ( (_DWORD)result == 1615 )
return result;
v10 = (*(__int64 (__fastcall **)(unsigned int *, __int64))(*(_QWORD *)a2 + 480LL))(a2, 999);
if ( v10 )
{
v11 = v10;
v12 = (const char *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 944LL))(v10);
if ( atoi(v12) == v9 && a2[366] != v9 )
{
v13 = sub_10088E820("%i", v15);
CString = cocos2d::CCString::getCString(v13);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 928LL))(v11, CString);
}
}
result = a2[257];
if ( (int)result <= 2067 )
{
if ( (_DWORD)result == 901 )
{
if ( a2[382] == a3 )
a2[382] = a4;
}
else if ( (_DWORD)result == 1268 )
{
SpawnTriggerGameObject::changeRemap(a2, a3, a4, 0);
return SpawnTriggerGameObject::changeRemap(a2, a3, a4, 1);
}
return result;
}
if ( (_DWORD)result == 2068 )
return ChanceTriggerGameObject::editChanceObject(a2, a3, a4);
if ( (_DWORD)result == 2903 )
{
if ( a2[463] == a3 )
{
a2[463] = a4;
if ( a2[464] != a3 )
{
LABEL_31:
if ( a2[465] != a3 )
goto LABEL_32;
goto LABEL_39;
}
}
else if ( a2[464] != a3 )
{
goto LABEL_31;
}
a2[464] = a4;
if ( a2[465] != a3 )
{
LABEL_32:
if ( a2[466] != a3 )
return result;
goto LABEL_40;
}
LABEL_39:
a2[465] = a4;
if ( a2[466] != a3 )
return result;
LABEL_40:
a2[466] = a4;
}
return result;
}