// // LevelEditorLayer::createObjectsFromString from 0x67139c to 0x671c4c (2224 bytes) // // 4 xrefs: // > LevelEditorLayer::duplicateKeyframeAnimation @ 0x671ce4 // > EditorUI::spriteFromObjectString @ 0x696c68 // > EditorUI::pasteObjects @ 0x6bf350 // > @ 0x95b20 // // 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 // cocos2d::CCArray *__fastcall LevelEditorLayer::createObjectsFromString( LevelEditorLayer *a1, const void **a2, unsigned __int8 a3, unsigned __int8 a4) { void **m_start; // x19 unsigned __int64 v6; // x21 unsigned __int64 v7; // x22 size_t v8; // x2 int v9; // w0 _BOOL4 v10; // w21 char *v11; // x19 unsigned __int64 v12; // x22 unsigned __int64 v13; // x23 size_t v14; // x2 unsigned __int64 v15; // x22 void **v16; // x0 cocos2d::CCArray *m_redoObjects; // x0 cocos2d::CCArray *v18; // x0 std::string *v19; // x0 std::string *v20; // x23 std::string *v21; // x19 long double v22; // q0 __int64 *v23; // x20 __int64 *v24; // x19 int v25; // w25 __int64 *v26; // x20 __int64 i; // x0 int v28; // w21 unsigned __int64 v29; // x23 __int64 v30; // x19 long double v31; // q0 __int64 v32; // x24 const char *v33; // x23 char *v34; // x0 unsigned int *v35; // x19 int v36; // w1 unsigned int *v38; // x23 int v39; // w1 unsigned __int64 v40; // x5 void *v41; // x0 unsigned int *v42; // x1 int v43; // w2 GameObject *v44; // x19 int m_currentLayer; // w0 __int64 v46; // x1 __int64 *v47; // x0 unsigned int *v48; // x3 int v49; // w2 std::string *v50; // x19 std::string *m_finish; // x20 stl::StringData::Internal *m_data; // x1 __int64 *v53; // x0 unsigned int *v54; // x3 int v55; // w2 UndoObject *v56; // x0 EditorUI *m_editorUI; // x0 int v58; // [xsp+78h] [xbp+78h] int v59; // [xsp+7Ch] [xbp+7Ch] cocos2d::CCArray *v60; // [xsp+80h] [xbp+80h] __int64 v61; // [xsp+90h] [xbp+90h] std::string *v63; // [xsp+A0h] [xbp+A0h] const char *v64; // [xsp+B0h] [xbp+B0h] BYREF __int64 v65; // [xsp+B8h] [xbp+B8h] BYREF std::vector v66; // [xsp+C0h] [xbp+C0h] BYREF std::vector v67; // [xsp+D8h] [xbp+D8h] BYREF void *v68; // [xsp+F0h] [xbp+F0h] BYREF void *v69; // [xsp+F8h] [xbp+F8h] __int64 v70; // [xsp+100h] [xbp+100h] v59 = a4; v58 = a3; sub_D153B8((int)&v67, " "); m_start = v67.m_start; v6 = *((_QWORD *)*a2 - 3); v7 = *((_QWORD *)v67.m_start - 3); if ( v7 > v6 ) v8 = *((_QWORD *)*a2 - 3); else v8 = *((_QWORD *)v67.m_start - 3); if ( memcmp(*a2, v67.m_start, v8) || (v9 = v6 - v7, v6 - v7 + 0x80000000 > 0xFFFFFFFF) || (v10 = 1, v9) ) { sub_D153B8((int)&v68, &byte_F288A0); v10 = 0; v11 = (char *)v68; v12 = *((_QWORD *)*a2 - 3); v13 = *((_QWORD *)v68 - 3); if ( v13 > v12 ) v14 = *((_QWORD *)*a2 - 3); else v14 = *((_QWORD *)v68 - 3); if ( !memcmp(*a2, v68, v14) ) { v15 = v12 - v13; if ( v15 + 0x80000000 <= 0xFFFFFFFF ) v10 = v15 == 0; } if ( v11 - 24 != (char *)&qword_124B6B0 ) sub_4DB660(v11 - 24); m_start = v67.m_start; v16 = v67.m_start - 3; if ( (__int64 *)v67.m_start - 3 == &qword_124B6B0 ) goto LABEL_15; } else { v16 = m_start - 3; if ( m_start - 3 == (void **)&qword_124B6B0 ) goto LABEL_15; } if ( &pthread_create ) { v35 = (unsigned int *)(m_start - 1); do v36 = __ldaxr(v35); while ( __stlxr(v36 - 1, v35) ); } else { v36 = *((_DWORD *)m_start - 2); *((_DWORD *)m_start - 2) = v36 - 1; } if ( v36 <= 0 ) { operator delete(v16); if ( v10 ) return nullptr; goto LABEL_16; } LABEL_15: if ( v10 ) return nullptr; LABEL_16: m_redoObjects = a1->m_redoObjects; a1->m_keepGroupParents = 1; v18 = (cocos2d::CCArray *)cocos2d::CCArray::removeAllObjects(m_redoObjects); v60 = (cocos2d::CCArray *)cocos2d::CCArray::create(v18); memset(&v66, 0, sizeof(v66)); v19 = (std::string *)operator new(0x12C8u); v20 = v19; v21 = v19 + 601; do { if ( v19 ) v19->m_data.m_data = (stl::StringData::Internal *)&byte_124B6C8; ++v19; } while ( v19 != v21 ); v66.m_start = v20; v66.m_finish = v21; v66.m_reserveEnd = v20 + 601; memset(&v67, 0, sizeof(v67)); std::vector::_M_default_append((__int64)&v67, 0x259u); v68 = nullptr; v69 = nullptr; v70 = 0; sub_66B910(a2, ";", (__int64)&v68); v23 = (__int64 *)v68; v24 = (__int64 *)v69; if ( ((_BYTE *)v69 - (_BYTE *)v68) >> 3 ) { v61 = 0; v25 = 0; while ( v59 || a1->m_initializing || a1->m_objectCount.random - a1->m_objectCount.seed <= 79999 ) { v26 = &v23[v61]; for ( i = 0; i != 601; ++i ) v67.m_start[i] = nullptr; v28 = 1; v29 = 0; v30 = sub_D16674(v26, 44, 0, v22); v32 = *(int *)(*v26 - 24); while ( 1 ) { if ( v29 != v32 ) { if ( v28 ) { if ( v29 > *(_QWORD *)(*v26 - 24) ) sub_D13C5C( "%s: __pos (which is %zu) > this->size() (which is %zu)", "basic_string::substr", v29, *(_QWORD *)(*v26 - 24)); sub_D14F84(&v64, v26, v29, v30 - v29); v33 = v64; v25 = atoi(v64); v34 = (char *)(v33 - 24); if ( v33 - 24 != (const char *)&qword_124B6B0 ) { if ( &pthread_create ) { v38 = (unsigned int *)(v33 - 8); do v39 = __ldaxr(v38); while ( __stlxr(v39 - 1, v38) ); } else { v39 = *((_DWORD *)v33 - 2); *((_DWORD *)v33 - 2) = v39 - 1; } if ( v39 <= 0 ) operator delete(v34); } } else if ( v25 > 0 ) { v40 = *(_QWORD *)(*v26 - 24); v63 = &v66.m_start[v25]; if ( v29 > v40 ) sub_D13C5C("%s: __pos (which is %zu) > this->size() (which is %zu)", "basic_string::substr", v29, v40); sub_D14F84(&v65, v26, v29, v30 - v29); sub_D163D4(v63, &v65); v41 = (void *)(v65 - 24); if ( (__int64 *)(v65 - 24) != &qword_124B6B0 ) { if ( &pthread_create ) { v42 = (unsigned int *)(v65 - 8); do v43 = __ldaxr(v42); while ( __stlxr(v43 - 1, v42) ); } else { v43 = *(_DWORD *)(v65 - 8); *(_DWORD *)(v65 - 8) = v43 - 1; } if ( v43 <= 0 ) operator delete(v41); } v67.m_start[v25] = a1; } v28 ^= 1u; } if ( v30 == -1 ) break; v29 = v30 + 1; v30 = sub_D16674(v26, 44, v30 + 1, v31); } v44 = LevelEditorLayer::addObjectFromVector(a1, &v66, &v67); if ( v44 ) { m_currentLayer = a1->m_currentLayer; if ( m_currentLayer != -1 && !a1->m_keepEditorLayer && v44->m_editorLayer != m_currentLayer && v44->m_editorLayer2 != m_currentLayer ) { v44->m_editorLayer = m_currentLayer; } cocos2d::CCArray::addObject(v60, v44); if ( !v58 ) { v56 = UndoObject::create(v44, New); LevelEditorLayer::addToUndoList(a1, v56, 0); } } sub_D174B8(v26, 0, *(_QWORD *)(*v26 - 24), 0); v23 = (__int64 *)v68; if ( ++v61 >= (unsigned __int64)(((_BYTE *)v69 - (_BYTE *)v68) >> 3) ) { v24 = (__int64 *)v69; goto LABEL_68; } } m_editorUI = a1->m_editorUI; if ( m_editorUI ) EditorUI::showMaxError(m_editorUI); v24 = (__int64 *)v69; v23 = (__int64 *)v68; } LABEL_68: a1->m_keepGroupParents = 0; if ( v23 != v24 ) { do { while ( 1 ) { v46 = *v23; v47 = (__int64 *)(*v23 - 24); if ( v47 != &qword_124B6B0 ) { v48 = (unsigned int *)(*v23 - 8); if ( &pthread_create ) { do v49 = __ldaxr(v48); while ( __stlxr(v49 - 1, v48) ); } else { v49 = *(_DWORD *)(v46 - 8); *(_DWORD *)(v46 - 8) = v49 - 1; } if ( v49 <= 0 ) break; } if ( ++v23 == v24 ) goto LABEL_76; } ++v23; operator delete(v47); } while ( v23 != v24 ); LABEL_76: v24 = (__int64 *)v68; } if ( v24 ) operator delete(v24); if ( v67.m_start ) operator delete(v67.m_start); v50 = v66.m_start; m_finish = v66.m_finish; if ( v66.m_start != v66.m_finish ) { do { while ( 1 ) { m_data = v50->m_data.m_data; v53 = (__int64 *)((char *)v50->m_data.m_data - 24); if ( v53 != &qword_124B6B0 ) { v54 = (unsigned int *)((char *)v50->m_data.m_data - 8); if ( &pthread_create ) { do v55 = __ldaxr(v54); while ( __stlxr(v55 - 1, v54) ); } else { v55 = *((_DWORD *)m_data - 2); *((_DWORD *)m_data - 2) = v55 - 1; } if ( v55 <= 0 ) break; } if ( m_finish == ++v50 ) goto LABEL_89; } ++v50; operator delete(v53); } while ( m_finish != v50 ); LABEL_89: m_finish = v66.m_start; } if ( m_finish ) operator delete(m_finish); return v60; }
GD Web Decomp Icon

GD Web Decomp

Raw Source