{"type": "func", "start": 4652240, "end": 4652516, "name": "GJBaseGameLayer::createPlayerCollisionBlock", "pseudocode": "// \n// GJBaseGameLayer::createPlayerCollisionBlock from 0x46fcd0 to 0x46fde4 (276 bytes)\n// \n// 2 xrefs:\n// > PlayLayer::setupHasCompleted @ 0x31c2ce\n// > LevelEditorLayer::init @ 0x376a04\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::createPlayerCollisionBlock(GJBaseGameLayer *a1)\n{\n  GameObject *m_player1CollisionBlock; // r7\n  GameObject **p_m_player2CollisionBlock; // r8\n  GameObject *v4; // r4\n  GameObject_vtbl *v5; // r2\n  PlayerObject *m_player2; // r0\n  void (__fastcall *setStartPos)(GameObject *__hidden, cocos2d::CCPoint); // r9\n  const cocos2d::CCPoint *v8; // r0\n  GJBaseGameLayer_vtbl *v9; // r3\n  void (__fastcall *addToSection)(GJBaseGameLayer *__hidden, GameObject *); // r3\n  void (__fastcall *setupCustomSprites)(GameObject *__hidden, std::string); // [sp+4h] [bp-18h]\n  cocos2d::CCPoint v12; // [sp+Ch] [bp-10h] BYREF\n\n  m_player1CollisionBlock = a1->m_player1CollisionBlock;\n  if ( !m_player1CollisionBlock )\n  {\n    p_m_player2CollisionBlock = &a1->m_player2CollisionBlock;\n    while ( 1 )\n    {\n      v4 = GameObject::createWithKey((int)&stru_70C.st_info);\n      cocos2d::CCObject::retain(v4);\n      v4->customSetup(v4);\n      sub_776584((int)&v12, \"edit_eCollisionBlock01_001.png\");\n      GameObject::addColorSprite(v4, (char **)&v12);\n      sub_774008(&v12);\n      setupCustomSprites = v4->setupCustomSprites;\n      sub_776584((int)&v12, \"edit_eCollisionBlock01_001.png\");\n      ((void (__fastcall *)(GameObject *, cocos2d::CCPoint *))setupCustomSprites)(v4, &v12);\n      sub_774008(&v12);\n      v5 = v4->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n      if ( m_player1CollisionBlock )\n      {\n        *p_m_player2CollisionBlock = v4;\n        setStartPos = v5->setStartPos;\n        m_player2 = a1->m_player2;\n        v4[1].m_pobTexture = (cocos2d::CCTexture2D *)(&stru_270C + 5);\n      }\n      else\n      {\n        m_player2 = a1->m_player1;\n        a1->m_player1CollisionBlock = v4;\n        setStartPos = v5->setStartPos;\n        v4[1].m_pobTexture = (cocos2d::CCTexture2D *)(&stru_270C + 4);\n      }\n      v8 = m_player2->getPosition(m_player2);\n      cocos2d::CCPoint::CCPoint(&v12, v8);\n      ((void (__fastcall *)(GameObject *, cocos2d::CCPoint *))setStartPos)(v4, &v12);\n      v9 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n      v4->m_bDontDraw = 1;\n      addToSection = v9->addToSection;\n      v4->m_unk507 = 1;\n      addToSection(a1, v4);\n      cocos2d::CCArray::addObject(a1->m_collisionBlocks, v4);\n      if ( m_player1CollisionBlock == (GameObject *)((char *)&dword_0 + 1) )\n        break;\n      m_player1CollisionBlock = (GameObject *)(&dword_0 + 1);\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::createPlayerCollisionBlock from 0x46fcd0 to 0x46fde4 (276 bytes)\n; \n; 2 xrefs:\n; > PlayLayer::setupHasCompleted @ 0x31c2ce\n; > LevelEditorLayer::init @ 0x376a04\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\nLDR             R3, =(__stack_chk_guard_ptr - 0x46FCDA)                ; +0x0, 0x46fcd0\nPUSH.W          {R4-R11,LR}                                            ; +0x2, 0x46fcd2\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x6, 0x46fcd6\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x8, 0x46fcd8\nSUB             SP, SP, #0x1C                                          ; +0xa, 0x46fcda\nMOV             R6, R0                                                 ; +0xc, 0x46fcdc\nLDR             R2, [R3]                                               ; +0xe, 0x46fcde\nSTR             R3, [SP,#0x1C+var_1C]                                  ; +0x10, 0x46fce0\nSTR             R2, [SP,#0x1C+var_8]                                   ; +0x12, 0x46fce2\nMOVW            R2, #0x2A14                                            ; +0x14, 0x46fce4\nLDR             R7, [R0,R2]                                            ; +0x18, 0x46fce8\nCMP             R7, #0                                                 ; +0x1a, 0x46fcea\nBNE             loc_46FDD0                                             ; +0x1c, 0x46fcec\nLDR.W           R10, =(aEditEcollision_1 - 0x46FD02); \"edit_eCollisionBlock01_001.png\" ; +0x1e, 0x46fcee\nADD.W           R8, R0, #0x2A00                                        ; +0x22, 0x46fcf2\nLDR.W           R11, =(aEditEcollision_1 - 0x46FD04); \"edit_eCollisionBlock01_001.png\" ; +0x26, 0x46fcf6\nADD.W           R8, R8, #0x18                                          ; +0x2a, 0x46fcfa\nADD             R10, PC; \"edit_eCollisionBlock01_001.png\"              ; +0x2e, 0x46fcfe\nADD             R11, PC; \"edit_eCollisionBlock01_001.png\"              ; +0x30, 0x46fd00\nMOV.W           R0, #stru_70C.st_info; this                            ; +0x32, 0x46fd02\nADD             R5, SP, #0x1C+var_10                                   ; +0x36, 0x46fd06\nBL              _ZN10GameObject13createWithKeyEi; GameObject::createWithKey(int) ; +0x38, 0x46fd08\nADD.W           R9, SP, #0x1C+var_14                                   ; +0x3c, 0x46fd0c\nMOV             R4, R0                                                 ; +0x40, 0x46fd10\nBL              _ZN7cocos2d8CCObject6retainEv; cocos2d::CCObject::retain(void) ; +0x42, 0x46fd12\nLDR             R3, [R4]                                               ; +0x46, 0x46fd16\nMOV             R0, R4                                                 ; +0x48, 0x46fd18\nLDR.W           R3, [R3,#0x270]                                        ; +0x4a, 0x46fd1a\nBLX             R3                                                     ; +0x4e, 0x46fd1e\nMOV             R1, R10; char *                                        ; +0x50, 0x46fd20\nMOV             R0, R5; int                                            ; +0x52, 0x46fd22\nMOV             R2, R9                                                 ; +0x54, 0x46fd24\nBL              sub_776584                                             ; +0x56, 0x46fd26\nMOV             R0, R4                                                 ; +0x5a, 0x46fd2a\nMOV             R1, R5                                                 ; +0x5c, 0x46fd2c\nBL              _ZN10GameObject14addColorSpriteESs; GameObject::addColorSprite(std::string) ; +0x5e, 0x46fd2e\nMOV             R0, R5                                                 ; +0x62, 0x46fd32\nBL              sub_774008                                             ; +0x64, 0x46fd34\nLDR             R3, [R4]                                               ; +0x68, 0x46fd38\nMOV             R1, R11; char *                                        ; +0x6a, 0x46fd3a\nMOV             R0, R5; int                                            ; +0x6c, 0x46fd3c\nMOV             R2, R9                                                 ; +0x6e, 0x46fd3e\nLDR.W           R3, [R3,#0x274]                                        ; +0x70, 0x46fd40\nSTR             R3, [SP,#0x1C+var_18]                                  ; +0x74, 0x46fd44\nBL              sub_776584                                             ; +0x76, 0x46fd46\nMOV             R0, R4                                                 ; +0x7a, 0x46fd4a\nMOV             R1, R5                                                 ; +0x7c, 0x46fd4c\nLDR             R3, [SP,#0x1C+var_18]                                  ; +0x7e, 0x46fd4e\nBLX             R3                                                     ; +0x80, 0x46fd50\nMOV             R0, R5                                                 ; +0x82, 0x46fd52\nBL              sub_774008                                             ; +0x84, 0x46fd54\nLDR             R2, [R4]                                               ; +0x88, 0x46fd58\nCBNZ            R7, loc_46FD74                                         ; +0x8a, 0x46fd5a\nADD.W           R3, R6, #0x2A00                                        ; +0x8c, 0x46fd5c\nLDR.W           R0, [R6,#0x8B8]                                        ; +0x90, 0x46fd60\nSTR             R4, [R3,#0x14]                                         ; +0x94, 0x46fd64\nMOVW            R3, #0x2710                                            ; +0x96, 0x46fd66\nLDR.W           R9, [R2,#0x2A4]                                        ; +0x9a, 0x46fd6a\nSTR.W           R3, [R4,#0x5D4]                                        ; +0x9e, 0x46fd6e\nB               loc_46FD88                                             ; +0xa2, 0x46fd72\nSTR.W           R4, [R8]                                               ; +0xa4, 0x46fd74\nMOVW            R3, #0x2711                                            ; +0xa8, 0x46fd78\nLDR.W           R9, [R2,#0x2A4]                                        ; +0xac, 0x46fd7c\nLDR.W           R0, [R6,#0x8BC]                                        ; +0xb0, 0x46fd80\nSTR.W           R3, [R4,#0x5D4]                                        ; +0xb4, 0x46fd84\nLDR             R3, [R0]                                               ; +0xb8, 0x46fd88\nLDR             R3, [R3,#0x60]                                         ; +0xba, 0x46fd8a\nBLX             R3                                                     ; +0xbc, 0x46fd8c\nMOV             R1, R0; cocos2d::CCPoint *                             ; +0xbe, 0x46fd8e\nMOV             R0, R5; this                                           ; +0xc0, 0x46fd90\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0xc2, 0x46fd92\nMOV             R1, R5                                                 ; +0xc6, 0x46fd96\nMOV             R0, R4                                                 ; +0xc8, 0x46fd98\nMOVS            R5, #1                                                 ; +0xca, 0x46fd9a\nBLX             R9                                                     ; +0xcc, 0x46fd9c\nLDR             R3, [R6]                                               ; +0xce, 0x46fd9e\nMOV             R0, R6                                                 ; +0xd0, 0x46fda0\nMOV             R1, R4                                                 ; +0xd2, 0x46fda2\nSTRB.W          R5, [R4,#0x1D7]                                        ; +0xd4, 0x46fda4\nLDR.W           R3, [R3,#0x288]                                        ; +0xd8, 0x46fda8\nSTRB.W          R5, [R4,#0x45B]                                        ; +0xdc, 0x46fdac\nBLX             R3                                                     ; +0xe0, 0x46fdb0\nLDR.W           R0, [R6,#0x8C8]; this                                  ; +0xe2, 0x46fdb2\nMOV             R1, R4; cocos2d::CCObject *                            ; +0xe6, 0x46fdb6\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0xe8, 0x46fdb8\nCMP             R7, R5                                                 ; +0xec, 0x46fdbc\nBEQ             loc_46FDD0                                             ; +0xee, 0x46fdbe\nMOV             R7, R5                                                 ; +0xf0, 0x46fdc0\nB               loc_46FD02                                             ; +0xf2, 0x46fdc2\nB               loc_46FDC6                                             ; +0xf4, 0x46fdc4\nMOV             R0, R5                                                 ; +0xf6, 0x46fdc6\nBL              sub_774008                                             ; +0xf8, 0x46fdc8\nBL              __cxa_end_cleanup                                      ; +0xfc, 0x46fdcc\nLDR             R3, [SP,#0x1C+var_1C]                                  ; +0x100, 0x46fdd0\nLDR             R2, [SP,#0x1C+var_8]                                   ; +0x102, 0x46fdd2\nLDR             R3, [R3]                                               ; +0x104, 0x46fdd4\nCMP             R2, R3                                                 ; +0x106, 0x46fdd6\nBEQ             loc_46FDDE                                             ; +0x108, 0x46fdd8\nBLX             __stack_chk_fail                                       ; +0x10a, 0x46fdda\nADD             SP, SP, #0x1C                                          ; +0x10e, 0x46fdde\nPOP.W           {R4-R11,PC}                                            ; +0x110, 0x46fde0", "xrefs": ["PlayLayer::setupHasCompleted @ 0x31c2ce", "LevelEditorLayer::init @ 0x376a04"], "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"}