{"type": "func", "start": 5275640, "end": 5276156, "name": "EndPortalObject::updateEndPos", "pseudocode": "// \n// EndPortalObject::updateEndPos from 0x507ff8 to 0x5081fc (516 bytes)\n// \n// 2 xrefs:\n// > PlayLayer::checkForEnd @ 0x3ff632\n// > EndPortalObject::setVisible @ 0x508228\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:51:25 +0000\n// \n\nint __fastcall EndPortalObject::updateEndPos(EndPortalObject *this, int a2)\n{\n  GameManager *WinSize; // r0\n  float v5; // s16\n  GameManager *v6; // r0\n  GameManager *v7; // r0\n  float v8; // s16\n  float v9; // s17\n  float v10; // s15\n  GameManager *v11; // r0\n  float v12; // s18\n  float v13; // s17\n  void (__fastcall *v14)(EndPortalObject *, _BYTE *); // r8\n  float *v15; // r0\n  GameManager *v16; // r0\n  int v17; // r6\n  int (__fastcall *v18)(int, _DWORD); // r7\n  float v19; // s16\n  int v20; // r0\n  int (__fastcall *v21)(EndPortalObject *, _DWORD); // r6\n  float v22; // s16\n  int v23; // r0\n  GameManager *v24; // r0\n  int (__fastcall *v25)(EndPortalObject *, _DWORD); // r6\n  int v26; // r0\n  GameManager *v27; // r0\n  int v28; // r3\n  float v29; // s16\n  void (__fastcall *v30)(_DWORD, _DWORD); // r6\n  int v31; // r0\n  float v32; // r1\n  int (__fastcall *v33)(EndPortalObject *, int); // r6\n  int v34; // r0\n  _BYTE v36[4]; // [sp+4h] [bp-1Ch] BYREF\n  float v37; // [sp+8h] [bp-18h]\n  _BYTE v38[4]; // [sp+Ch] [bp-14h] BYREF\n  float v39; // [sp+10h] [bp-10h]\n  _BYTE v40[4]; // [sp+14h] [bp-Ch] BYREF\n  float v41; // [sp+18h] [bp-8h]\n\n  cocos2d::CCDirector::sharedDirector(this);\n  WinSize = (GameManager *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v36);\n  if ( *((_BYTE *)this + 1173) )\n  {\n    v5 = 225.0;\n    (*(void (__fastcall **)(_BYTE *, EndPortalObject *))(*(_DWORD *)this + 908))(v38, this);\n    if ( v39 > 225.0 )\n    {\n      (*(void (__fastcall **)(_BYTE *, EndPortalObject *))(*(_DWORD *)this + 908))(v40, this);\n      v5 = v41;\n    }\n  }\n  else\n  {\n    v6 = (GameManager *)GameManager::sharedState(WinSize);\n    if ( *(_BYTE *)(*(_DWORD *)(*((_DWORD *)v6 + 101) + 2076) + 1953)\n      || (v7 = (GameManager *)GameManager::sharedState(v6),\n          v8 = v37 * 0.5,\n          v9 = *(float *)(*((_DWORD *)v7 + 101) + 1000),\n          v6 = (GameManager *)GameManager::sharedState(v7),\n          v10 = v8 / *(float *)(*((_DWORD *)v6 + 101) + 328),\n          v5 = 225.0,\n          (float)(v9 + v10) > 225.0) )\n    {\n      v11 = (GameManager *)GameManager::sharedState(v6);\n      v12 = v37 * 0.5;\n      v13 = *(float *)(*((_DWORD *)v11 + 101) + 1000);\n      v5 = v13 + (float)(v12 / *(float *)(*(_DWORD *)(GameManager::sharedState(v11) + 404) + 328));\n    }\n  }\n  v14 = *(void (__fastcall **)(EndPortalObject *, _BYTE *))(*(_DWORD *)this + 684);\n  v15 = (float *)(*(int (__fastcall **)(EndPortalObject *))(*(_DWORD *)this + 96))(this);\n  cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v40, *v15, v5);\n  v14(this, v40);\n  v16 = *((GameManager **)this + 165);\n  if ( v16 )\n  {\n    if ( a2 )\n      v16 = (GameManager *)(*(int (__fastcall **)(GameManager *, float))(*(_DWORD *)v16 + 20))(v16, 1.0);\n    v17 = *((_DWORD *)this + 165);\n    v18 = *(int (__fastcall **)(int, _DWORD))(*(_DWORD *)v17 + 80);\n    v19 = 1.0;\n    if ( *((_BYTE *)this + 1172) )\n      v19 = -1.0;\n    v20 = GameManager::sharedState(v16);\n    v16 = (GameManager *)v18(v17, v19 / *(float *)(*(_DWORD *)(v20 + 404) + 332));\n  }\n  v21 = *(int (__fastcall **)(EndPortalObject *, _DWORD))(*(_DWORD *)this + 64);\n  if ( *((_BYTE *)this + 1172) )\n    v22 = -1.0;\n  else\n    v22 = 1.0;\n  v23 = GameManager::sharedState(v16);\n  v24 = (GameManager *)v21(this, v22 / *(float *)(*(_DWORD *)(v23 + 404) + 332));\n  v25 = *(int (__fastcall **)(EndPortalObject *, _DWORD))(*(_DWORD *)this + 72);\n  v26 = GameManager::sharedState(v24);\n  v27 = (GameManager *)v25(this, 1.0 / *(float *)(*(_DWORD *)(v26 + 404) + 332));\n  v28 = *((_DWORD *)this + 292);\n  if ( v28 )\n  {\n    v29 = v37;\n    v30 = *(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)v28 + 72);\n    v31 = GameManager::sharedState(v27);\n    v30(\n      *((_DWORD *)this + 292),\n      (float)((float)(v29 / *(float *)(*(_DWORD *)(v31 + 404) + 332)) * 1.5) / *(float *)(*((_DWORD *)this + 292) + 348));\n    if ( *((_BYTE *)this + 1172) )\n      v32 = -1.0;\n    else\n      v32 = 1.0;\n    (*(void (__fastcall **)(_DWORD, float))(**((_DWORD **)this + 292) + 64))(\n      *((_DWORD *)this + 292),\n      COERCE_FLOAT(LODWORD(v32)));\n  }\n  v33 = *(int (__fastcall **)(EndPortalObject *, int))(*(_DWORD *)this + 92);\n  v34 = (*(int (__fastcall **)(EndPortalObject *))(*(_DWORD *)this + 96))(this);\n  return v33(this, v34);\n}", "assembly": "; \n; EndPortalObject::updateEndPos from 0x507ff8 to 0x5081fc (516 bytes)\n; \n; 2 xrefs:\n; > PlayLayer::checkForEnd @ 0x3ff632\n; > EndPortalObject::setVisible @ 0x508228\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:51:25 +0000\n; \nPUSH.W          {R4-R8,LR}                                             ; +0x0, 0x507ff8\nMOV             R4, R0                                                 ; +0x4, 0x507ffc\nVPUSH           {D8-D9}                                                ; +0x6, 0x507ffe\nMOV             R7, R1                                                 ; +0xa, 0x508002\nLDR             R5, =(__stack_chk_guard_ptr - 0x50800A)                ; +0xc, 0x508004\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0xe, 0x508006\nLDR             R5, [R5]; __stack_chk_guard                            ; +0x10, 0x508008\nSUB             SP, SP, #0x20                                          ; +0x12, 0x50800a\nLDR             R3, [R5]                                               ; +0x14, 0x50800c\nADD             R6, SP, #0x20+var_C                                    ; +0x16, 0x50800e\nSTR             R3, [SP,#0x20+var_4]                                   ; +0x18, 0x508010\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x1a, 0x508012\nMOV             R1, R0                                                 ; +0x1e, 0x508016\nADD             R0, SP, #0x20+var_1C; this                             ; +0x20, 0x508018\nBL              _ZN7cocos2d10CCDirector10getWinSizeEv; cocos2d::CCDirector::getWinSize(void) ; +0x22, 0x50801a\nLDRB.W          R3, [R4,#0x495]                                        ; +0x26, 0x50801e\nCBZ             R3, loc_508054                                         ; +0x2a, 0x508022\nLDR             R3, [R4]                                               ; +0x2c, 0x508024\nADD             R0, SP, #0x20+var_14                                   ; +0x2e, 0x508026\nMOV             R1, R4                                                 ; +0x30, 0x508028\nVLDR            S16, =225.0                                            ; +0x32, 0x50802a\nLDR.W           R3, [R3,#0x38C]                                        ; +0x36, 0x50802e\nBLX             R3                                                     ; +0x3a, 0x508032\nVLDR            S15, [SP,#0x20+var_10]                                 ; +0x3c, 0x508034\nVCMPE.F32       S15, S16                                               ; +0x40, 0x508038\nVMRS            APSR_nzcv, FPSCR                                       ; +0x44, 0x50803c\nBLE             loc_5080C8                                             ; +0x48, 0x508040\nLDR             R3, [R4]                                               ; +0x4a, 0x508042\nMOV             R0, R6                                                 ; +0x4c, 0x508044\nMOV             R1, R4                                                 ; +0x4e, 0x508046\nLDR.W           R3, [R3,#0x38C]                                        ; +0x50, 0x508048\nBLX             R3                                                     ; +0x54, 0x50804c\nVLDR            S16, [SP,#0x20+var_8]                                  ; +0x56, 0x50804e\nB               loc_5080C8                                             ; +0x5a, 0x508052\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x5c, 0x508054\nVMOV.F32        S18, #0.5                                              ; +0x60, 0x508058\nLDR.W           R3, [R0,#0x194]                                        ; +0x64, 0x50805c\nLDR.W           R3, [R3,#0x81C]                                        ; +0x68, 0x508060\nLDRB.W          R3, [R3,#0x7A1]                                        ; +0x6c, 0x508064\nCBNZ            R3, loc_5080A0                                         ; +0x70, 0x508068\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x72, 0x50806a\nVLDR            S16, [SP,#0x20+var_18]                                 ; +0x76, 0x50806e\nVMUL.F32        S16, S16, S18                                          ; +0x7a, 0x508072\nLDR.W           R3, [R0,#0x194]                                        ; +0x7e, 0x508076\nVLDR            S17, [R3,#0x3E8]                                       ; +0x82, 0x50807a\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x86, 0x50807e\nLDR.W           R3, [R0,#0x194]                                        ; +0x8a, 0x508082\nVLDR            S15, [R3,#0x148]                                       ; +0x8e, 0x508086\nVDIV.F32        S15, S16, S15                                          ; +0x92, 0x50808a\nVLDR            S16, =225.0                                            ; +0x96, 0x50808e\nVADD.F32        S15, S17, S15                                          ; +0x9a, 0x508092\nVCMPE.F32       S15, S16                                               ; +0x9e, 0x508096\nVMRS            APSR_nzcv, FPSCR                                       ; +0xa2, 0x50809a\nBLE             loc_5080C8                                             ; +0xa6, 0x50809e\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xa8, 0x5080a0\nVLDR            S15, [SP,#0x20+var_18]                                 ; +0xac, 0x5080a4\nVMUL.F32        S18, S15, S18                                          ; +0xb0, 0x5080a8\nLDR.W           R3, [R0,#0x194]                                        ; +0xb4, 0x5080ac\nVLDR            S17, [R3,#0x3E8]                                       ; +0xb8, 0x5080b0\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xbc, 0x5080b4\nLDR.W           R3, [R0,#0x194]                                        ; +0xc0, 0x5080b8\nVLDR            S15, [R3,#0x148]                                       ; +0xc4, 0x5080bc\nVDIV.F32        S18, S18, S15                                          ; +0xc8, 0x5080c0\nVADD.F32        S16, S17, S18                                          ; +0xcc, 0x5080c4\nLDR             R3, [R4]                                               ; +0xd0, 0x5080c8\nMOV             R0, R4                                                 ; +0xd2, 0x5080ca\nLDR.W           R8, [R3,#0x2AC]                                        ; +0xd4, 0x5080cc\nLDR             R3, [R3,#0x60]                                         ; +0xd8, 0x5080d0\nBLX             R3                                                     ; +0xda, 0x5080d2\nVMOV            R2, S16; float                                         ; +0xdc, 0x5080d4\nVMOV.F32        S19, #1.0                                              ; +0xe0, 0x5080d8\nMOV             R3, R0                                                 ; +0xe4, 0x5080dc\nMOV             R0, R6; this                                           ; +0xe6, 0x5080de\nLDR             R1, [R3]; float                                        ; +0xe8, 0x5080e0\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0xea, 0x5080e2\nMOV             R0, R4                                                 ; +0xee, 0x5080e6\nMOV             R1, R6                                                 ; +0xf0, 0x5080e8\nBLX             R8                                                     ; +0xf2, 0x5080ea\nLDR.W           R0, [R4,#0x294]                                        ; +0xf4, 0x5080ec\nCBZ             R0, loc_508132                                         ; +0xf8, 0x5080f0\nCBZ             R7, loc_5080FE                                         ; +0xfa, 0x5080f2\nLDR             R3, [R0]                                               ; +0xfc, 0x5080f4\nVMOV            R1, S19                                                ; +0xfe, 0x5080f6\nLDR             R3, [R3,#0x14]                                         ; +0x102, 0x5080fa\nBLX             R3                                                     ; +0x104, 0x5080fc\nLDR.W           R6, [R4,#0x294]                                        ; +0x106, 0x5080fe\nVMOV.F32        S15, #-1.0                                             ; +0x10a, 0x508102\nLDR             R3, [R6]                                               ; +0x10e, 0x508106\nLDR             R7, [R3,#0x50]                                         ; +0x110, 0x508108\nLDRB.W          R3, [R4,#0x494]                                        ; +0x112, 0x50810a\nCMP             R3, #0                                                 ; +0x116, 0x50810e\nVMOV.F32        S16, #1.0                                              ; +0x118, 0x508110\nIT NE                                                                  ; +0x11c, 0x508114\nVMOVNE.F32      S16, S15                                               ; +0x11e, 0x508116\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x122, 0x50811a\nLDR.W           R3, [R0,#0x194]                                        ; +0x126, 0x50811e\nMOV             R0, R6                                                 ; +0x12a, 0x508122\nVLDR            S15, [R3,#0x14C]                                       ; +0x12c, 0x508124\nVDIV.F32        S15, S16, S15                                          ; +0x130, 0x508128\nVMOV            R1, S15                                                ; +0x134, 0x50812c\nBLX             R7                                                     ; +0x138, 0x508130\nVMOV.F32        S18, #-1.0                                             ; +0x13a, 0x508132\nLDR             R3, [R4]                                               ; +0x13e, 0x508136\nLDR             R6, [R3,#0x40]                                         ; +0x140, 0x508138\nLDRB.W          R3, [R4,#0x494]                                        ; +0x142, 0x50813a\nCMP             R3, #0                                                 ; +0x146, 0x50813e\nVMOV.F32        S17, #1.0                                              ; +0x148, 0x508140\nITE EQ                                                                 ; +0x14c, 0x508144\nVMOVEQ.F32      S16, S17                                               ; +0x14e, 0x508146\nVMOVNE.F32      S16, S18                                               ; +0x152, 0x50814a\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x156, 0x50814e\nLDR.W           R3, [R0,#0x194]                                        ; +0x15a, 0x508152\nMOV             R0, R4                                                 ; +0x15e, 0x508156\nVLDR            S15, [R3,#0x14C]                                       ; +0x160, 0x508158\nVDIV.F32        S15, S16, S15                                          ; +0x164, 0x50815c\nVMOV            R1, S15                                                ; +0x168, 0x508160\nBLX             R6                                                     ; +0x16c, 0x508164\nLDR             R3, [R4]                                               ; +0x16e, 0x508166\nLDR             R6, [R3,#0x48]                                         ; +0x170, 0x508168\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x172, 0x50816a\nLDR.W           R3, [R0,#0x194]                                        ; +0x176, 0x50816e\nMOV             R0, R4                                                 ; +0x17a, 0x508172\nVLDR            S15, [R3,#0x14C]                                       ; +0x17c, 0x508174\nVDIV.F32        S15, S19, S15                                          ; +0x180, 0x508178\nVMOV            R1, S15                                                ; +0x184, 0x50817c\nBLX             R6                                                     ; +0x188, 0x508180\nLDR.W           R3, [R4,#0x490]                                        ; +0x18a, 0x508182\nCBZ             R3, loc_5081D6                                         ; +0x18e, 0x508186\nLDR             R3, [R3]                                               ; +0x190, 0x508188\nVLDR            S16, [SP,#0x20+var_18]                                 ; +0x192, 0x50818a\nLDR             R6, [R3,#0x48]                                         ; +0x196, 0x50818e\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x198, 0x508190\nLDR.W           R3, [R4,#0x490]                                        ; +0x19c, 0x508194\nLDR.W           R2, [R0,#0x194]                                        ; +0x1a0, 0x508198\nMOV             R0, R3                                                 ; +0x1a4, 0x50819c\nVLDR            S15, [R2,#0x14C]                                       ; +0x1a6, 0x50819e\nVDIV.F32        S16, S16, S15                                          ; +0x1aa, 0x5081a2\nVMOV.F32        S15, #1.5                                              ; +0x1ae, 0x5081a6\nVMUL.F32        S16, S16, S15                                          ; +0x1b2, 0x5081aa\nVLDR            S15, [R3,#0x15C]                                       ; +0x1b6, 0x5081ae\nVDIV.F32        S15, S16, S15                                          ; +0x1ba, 0x5081b2\nVMOV            R1, S15                                                ; +0x1be, 0x5081b6\nBLX             R6                                                     ; +0x1c2, 0x5081ba\nLDR.W           R0, [R4,#0x490]                                        ; +0x1c4, 0x5081bc\nLDRB.W          R2, [R4,#0x494]                                        ; +0x1c8, 0x5081c0\nLDR             R3, [R0]                                               ; +0x1cc, 0x5081c4\nCMP             R2, #0                                                 ; +0x1ce, 0x5081c6\nITE EQ                                                                 ; +0x1d0, 0x5081c8\nVMOVEQ          R1, S17                                                ; +0x1d2, 0x5081ca\nVMOVNE          R1, S18                                                ; +0x1d6, 0x5081ce\nLDR             R3, [R3,#0x40]                                         ; +0x1da, 0x5081d2\nBLX             R3                                                     ; +0x1dc, 0x5081d4\nLDR             R3, [R4]                                               ; +0x1de, 0x5081d6\nMOV             R0, R4                                                 ; +0x1e0, 0x5081d8\nLDR             R6, [R3,#0x5C]                                         ; +0x1e2, 0x5081da\nLDR             R3, [R3,#0x60]                                         ; +0x1e4, 0x5081dc\nBLX             R3                                                     ; +0x1e6, 0x5081de\nMOV             R1, R0                                                 ; +0x1e8, 0x5081e0\nMOV             R0, R4                                                 ; +0x1ea, 0x5081e2\nBLX             R6                                                     ; +0x1ec, 0x5081e4\nLDR             R2, [SP,#0x20+var_4]                                   ; +0x1ee, 0x5081e6\nLDR             R3, [R5]                                               ; +0x1f0, 0x5081e8\nCMP             R2, R3                                                 ; +0x1f2, 0x5081ea\nBEQ             loc_5081F2                                             ; +0x1f4, 0x5081ec\nBLX             __stack_chk_fail                                       ; +0x1f6, 0x5081ee\nADD             SP, SP, #0x20 ; ' '                                    ; +0x1fa, 0x5081f2\nVPOP            {D8-D9}                                                ; +0x1fc, 0x5081f4\nPOP.W           {R4-R8,PC}                                             ; +0x200, 0x5081f8", "xrefs": ["PlayLayer::checkForEnd @ 0x3ff632", "EndPortalObject::setVisible @ 0x508228"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}