{"type": "func", "start": 5370961744, "end": 5370962020, "name": "GJBaseGameLayer::addUIObject", "pseudocode": "// \n// GJBaseGameLayer::addUIObject from 0x140225f50 to 0x140226064 (276 bytes)\n// \n// 5 xrefs:\n// > GJBaseGameLayer::positionUIObjects @ 0x14022627f\n// > GJBaseGameLayer::positionUIObjects @ 0x14022642b\n// > <???> @ 0x140680218\n// > <???> @ 0x140680228\n// > <???> @ 0x1406cd7f4\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid GJBaseGameLayer::addUIObject(GJBaseGameLayer *a1, GameObject *a2)\n{\n  __int64 v4; // rbx\n  __int64 v5; // rax\n  _BOOL8 v6; // rdx\n  unsigned __int64 m_calcCollisionBlockObjects2Size; // r9\n  std::_Vector_val<std::_Simple_types<GameObject *>>::pointer Mylast; // rdx\n  std::_Vector_val<std::_Simple_types<GameObject *>>::pointer Myfirst; // r8\n  _BYTE v10[24]; // [rsp+20h] [rbp-18h] BYREF\n  GameObject *v11; // [rsp+48h] [rbp+10h] BYREF\n  char v12; // [rsp+50h] [rbp+18h] BYREF\n\n  if ( !a2->m_isUIObject )\n  {\n    LODWORD(v11) = a2->m_uniqueID;\n    v4 = *(_QWORD *)sub_14024F3B0(&a1->m_uiObjectPositions, v10, &v11);\n    v5 = ((__int64 (__fastcall *)(GameObject *, char *))a2->getStartPos)(a2, &v12);\n    cocos2d::CCPoint::operator=(v4 + 20, v5);\n    GJBaseGameLayer::removeObjectFromSection(a1, a2);\n    LOBYTE(v6) = 1;\n    a2->deactivateObject(a2, v6);\n    a2->m_outerSectionIndex = -1;\n    a2->m_isUIObject = 1;\n    cocos2d::CCArray::addObject(a1->m_uiObjects, a2);\n    if ( a2->m_objectID == 1816 )\n    {\n      m_calcCollisionBlockObjects2Size = a1->m_calcCollisionBlockObjects2Size;\n      Mylast = a1->m_calcCollisionBlockObjects2._Mypair._Myval2._Mylast;\n      Myfirst = a1->m_calcCollisionBlockObjects2._Mypair._Myval2._Myfirst;\n      v11 = a2;\n      if ( m_calcCollisionBlockObjects2Size < Mylast - Myfirst )\n      {\n        Myfirst[m_calcCollisionBlockObjects2Size] = a2;\n      }\n      else if ( Mylast == a1->m_calcCollisionBlockObjects2._Mypair._Myval2._Myend )\n      {\n        sub_140063110(&a1->m_calcCollisionBlockObjects2._Mypair._Myval2._Myfirst, Mylast, &v11);\n      }\n      else\n      {\n        *Mylast = a2;\n        ++a1->m_calcCollisionBlockObjects2._Mypair._Myval2._Mylast;\n      }\n      a2->m_innerSectionIndex = a1->m_calcCollisionBlockObjects2Size++;\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::addUIObject from 0x140225f50 to 0x140226064 (276 bytes)\n; \n; 5 xrefs:\n; > GJBaseGameLayer::positionUIObjects @ 0x14022627f\n; > GJBaseGameLayer::positionUIObjects @ 0x14022642b\n; > <???> @ 0x140680218\n; > <???> @ 0x140680228\n; > <???> @ 0x1406cd7f4\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nmov     [rsp+arg_18], rsi                                              ; +0x0, 0x140225f50\npush    rdi                                                            ; +0x5, 0x140225f55\nsub     rsp, 30h                                                       ; +0x6, 0x140225f56\ncmp     byte ptr [rdx+549h], 0                                         ; +0xa, 0x140225f5a\nmov     rdi, rdx                                                       ; +0x11, 0x140225f61\nmov     rsi, rcx                                                       ; +0x14, 0x140225f64\njnz     loc_140226059                                                  ; +0x17, 0x140225f67\nmov     eax, [rdx+39Ch]                                                ; +0x1d, 0x140225f6d\nlea     r8, [rsp+38h+arg_8]                                            ; +0x23, 0x140225f73\nlea     rdx, [rsp+38h+var_18]                                          ; +0x28, 0x140225f78\nmov     [rsp+38h+arg_0], rbx                                           ; +0x2d, 0x140225f7d\nadd     rcx, 910h                                                      ; +0x32, 0x140225f82\nmov     dword ptr [rsp+38h+arg_8], eax                                 ; +0x39, 0x140225f89\ncall    sub_14024F3B0                                                  ; +0x3d, 0x140225f8d\nlea     rdx, [rsp+38h+arg_10]                                          ; +0x42, 0x140225f92\nmov     rcx, rdi                                                       ; +0x47, 0x140225f97\nmov     rbx, [rax]                                                     ; +0x4a, 0x140225f9a\nmov     rax, [rdi]                                                     ; +0x4d, 0x140225f9d\ncall    qword ptr [rax+670h]                                           ; +0x50, 0x140225fa0\nmov     rdx, rax                                                       ; +0x56, 0x140225fa6\nlea     rcx, [rbx+14h]                                                 ; +0x59, 0x140225fa9\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x5d, 0x140225fad\nmov     rdx, rdi                                                       ; +0x63, 0x140225fb3\nmov     rcx, rsi                                                       ; +0x66, 0x140225fb6\ncall    GJBaseGameLayer__removeObjectFromSection                       ; +0x69, 0x140225fb9\nmov     rax, [rdi]                                                     ; +0x6e, 0x140225fbe\nmov     dl, 1                                                          ; +0x71, 0x140225fc1\nmov     rcx, rdi                                                       ; +0x73, 0x140225fc3\ncall    qword ptr [rax+478h]                                           ; +0x76, 0x140225fc6\nmov     dword ptr [rdi+278h], 0FFFFFFFFh                               ; +0x7c, 0x140225fcc\nmov     rdx, rdi                                                       ; +0x86, 0x140225fd6\nmov     byte ptr [rdi+549h], 1                                         ; +0x89, 0x140225fd9\nmov     rcx, [rsi+3548h]                                               ; +0x90, 0x140225fe0\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x97, 0x140225fe7\ncmp     dword ptr [rdi+40Ch], 718h                                     ; +0x9d, 0x140225fed\nmov     rbx, [rsp+38h+arg_0]                                           ; +0xa7, 0x140225ff7\njnz     short loc_140226059                                            ; +0xac, 0x140225ffc\nmovsxd  r9, dword ptr [rsi+3638h]                                      ; +0xae, 0x140225ffe\nlea     rcx, [rsi+3620h]                                               ; +0xb5, 0x140226005\nmov     rdx, [rcx+8]                                                   ; +0xbc, 0x14022600c\nmov     r8, [rcx]                                                      ; +0xc0, 0x140226010\nmov     rax, rdx                                                       ; +0xc3, 0x140226013\nsub     rax, r8                                                        ; +0xc6, 0x140226016\nmov     [rsp+38h+arg_8], rdi                                           ; +0xc9, 0x140226019\nsar     rax, 3                                                         ; +0xce, 0x14022601e\ncmp     r9, rax                                                        ; +0xd2, 0x140226022\njb      short loc_140226043                                            ; +0xd5, 0x140226025\ncmp     rdx, [rcx+10h]                                                 ; +0xd7, 0x140226027\njz      short loc_140226037                                            ; +0xdb, 0x14022602b\nmov     [rdx], rdi                                                     ; +0xdd, 0x14022602d\nadd     qword ptr [rcx+8], 8                                           ; +0xe0, 0x140226030\njmp     short loc_140226047                                            ; +0xe5, 0x140226035\nlea     r8, [rsp+38h+arg_8]                                            ; +0xe7, 0x140226037\ncall    sub_140063110                                                  ; +0xec, 0x14022603c\njmp     short loc_140226047                                            ; +0xf1, 0x140226041\nmov     [r8+r9*8], rdi                                                 ; +0xf3, 0x140226043\nmov     eax, [rsi+3638h]                                               ; +0xf7, 0x140226047\nmov     [rdi+274h], eax                                                ; +0xfd, 0x14022604d\ninc     dword ptr [rsi+3638h]                                          ; +0x103, 0x140226053\nmov     rsi, [rsp+38h+arg_18]                                          ; +0x109, 0x140226059\nadd     rsp, 30h                                                       ; +0x10e, 0x14022605e\npop     rdi                                                            ; +0x112, 0x140226062\nretn                                                                   ; +0x113, 0x140226063", "xrefs": ["GJBaseGameLayer::positionUIObjects @ 0x14022627f", "GJBaseGameLayer::positionUIObjects @ 0x14022642b", "<???> @ 0x140680218", "<???> @ 0x140680228", "<???> @ 0x1406cd7f4"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}