{"type": "func", "start": 5371927664, "end": 5371928043, "name": "GJBaseGameLayer::createMiddleground", "pseudocode": "// \n// GJBaseGameLayer::createMiddleground from 0x140311c70 to 0x140311deb (379 bytes)\n// \n// 7 xrefs:\n// > GameManager::finishedLoadingMGAsync @ 0x14027e02a\n// > GJBaseGameLayer::syncBGTextures @ 0x140344f95\n// > LevelEditorLayer::init @ 0x1403eeaef\n// > LevelSettingsLayer::selectArtClosed @ 0x14045b3a9\n// > PlayLayer::setupHasCompleted @ 0x140504d74\n// > ArtTriggerGameObject::triggerObject @ 0x1406630d7\n// > <???> @ 0x14091e7f4\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\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:30:16 +0000\n// \n\n// Hidden C++ exception states: #wind=1\nvoid __fastcall GJBaseGameLayer::createMiddleground(__int64 a1, int a2)\n{\n  __int64 v4; // rcx\n  cocos2d::CCLayer *v5; // rbx\n\n  v4 = *(_QWORD *)(a1 + 4352);\n  if ( v4 )\n  {\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)v4 + 512LL))(v4);\n    *(_QWORD *)(a1 + 4352) = 0;\n  }\n  if ( a2 > 0 )\n  {\n    if ( a2 > 3 )\n      a2 = 3;\n    v5 = (cocos2d::CCLayer *)operator new(0x1E8u);\n    cocos2d::CCLayer::CCLayer(v5);\n    *(_QWORD *)v5 = &GJMGLayer::`vftable';\n    *((_QWORD *)v5 + 40) = &GJMGLayer::`vftable';\n    *((_QWORD *)v5 + 41) = &GJMGLayer::`vftable';\n    *((_QWORD *)v5 + 42) = &GJMGLayer::`vftable';\n    *((_QWORD *)v5 + 43) = &GJMGLayer::`vftable';\n    *((_QWORD *)v5 + 44) = &GJMGLayer::`vftable';\n    *((_QWORD *)v5 + 51) = 0;\n    *((_QWORD *)v5 + 52) = 0;\n    *((_DWORD *)v5 + 106) = 0;\n    *((_QWORD *)v5 + 54) = 0;\n    *((_BYTE *)v5 + 440) = 0;\n    *((_DWORD *)v5 + 111) = 0;\n    *((_WORD *)v5 + 224) = 257;\n    *((_DWORD *)v5 + 113) = 0;\n    *((_WORD *)v5 + 228) = 0;\n    *((_BYTE *)v5 + 458) = 0;\n    *((_QWORD *)v5 + 58) = 0;\n    *((_QWORD *)v5 + 59) = 0;\n    *((_QWORD *)v5 + 60) = 0;\n    if ( (unsigned __int8)GJMGLayer::init(v5, (unsigned int)a2) )\n    {\n      cocos2d::CCObject::autorelease(v5);\n    }\n    else\n    {\n      (*(void (__fastcall **)(cocos2d::CCLayer *, __int64))(*(_QWORD *)v5 + 8LL))(v5, 1);\n      v5 = nullptr;\n    }\n    *(_QWORD *)(a1 + 4352) = v5;\n    (*(void (__fastcall **)(cocos2d::CCLayer *, _QWORD))(*(_QWORD *)v5 + 64LL))(v5, (unsigned int)a2);\n    (*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 4272) + 456LL))(\n      *(_QWORD *)(a1 + 4272),\n      *(_QWORD *)(a1 + 4352),\n      4294967257LL);\n  }\n}", "assembly": "; \n; GJBaseGameLayer::createMiddleground from 0x140311c70 to 0x140311deb (379 bytes)\n; \n; 7 xrefs:\n; > GameManager::finishedLoadingMGAsync @ 0x14027e02a\n; > GJBaseGameLayer::syncBGTextures @ 0x140344f95\n; > LevelEditorLayer::init @ 0x1403eeaef\n; > LevelSettingsLayer::selectArtClosed @ 0x14045b3a9\n; > PlayLayer::setupHasCompleted @ 0x140504d74\n; > ArtTriggerGameObject::triggerObject @ 0x1406630d7\n; > <???> @ 0x14091e7f4\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\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:30:16 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x140311c70\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x140311c75\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x140311c7a\npush    rdi                                                            ; +0xf, 0x140311c7f\nsub     rsp, 20h                                                       ; +0x10, 0x140311c80\nmov     esi, edx                                                       ; +0x14, 0x140311c84\nmov     rdi, rcx                                                       ; +0x16, 0x140311c86\nmov     rcx, [rcx+1100h]                                               ; +0x19, 0x140311c89\nxor     ebp, ebp                                                       ; +0x20, 0x140311c90\ntest    rcx, rcx                                                       ; +0x22, 0x140311c92\njz      short loc_140311CA7                                            ; +0x25, 0x140311c95\nmov     rax, [rcx]                                                     ; +0x27, 0x140311c97\ncall    qword ptr [rax+200h]                                           ; +0x2a, 0x140311c9a\nmov     [rdi+1100h], rbp                                               ; +0x30, 0x140311ca0\ntest    esi, esi                                                       ; +0x37, 0x140311ca7\njle     loc_140311DD6                                                  ; +0x39, 0x140311ca9\nmov     eax, 3                                                         ; +0x3f, 0x140311caf\ncmp     esi, eax                                                       ; +0x44, 0x140311cb4\ncmovg   esi, eax                                                       ; +0x46, 0x140311cb6\nmov     ecx, 1E8h; Size                                                ; +0x49, 0x140311cb9\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x4e, 0x140311cbe\nmov     rbx, rax                                                       ; +0x53, 0x140311cc3\nmov     [rsp+28h+arg_0], rax                                           ; +0x56, 0x140311cc6\nmov     rcx, rax                                                       ; +0x5b, 0x140311ccb\ncall    cs:??0CCLayer@cocos2d@@QEAA@XZ; cocos2d::CCLayer::CCLayer(void) ; +0x5e, 0x140311cce\nlea     rax, ??_7GJMGLayer@@6B@; const GJMGLayer::`vftable'            ; +0x64, 0x140311cd4\nmov     [rbx], rax                                                     ; +0x6b, 0x140311cdb\nlea     rax, ??_7GJMGLayer@@6B@_0; const GJMGLayer::`vftable'          ; +0x6e, 0x140311cde\nmov     [rbx+140h], rax                                                ; +0x75, 0x140311ce5\nlea     rax, ??_7GJMGLayer@@6B@_1; const GJMGLayer::`vftable'          ; +0x7c, 0x140311cec\nmov     [rbx+148h], rax                                                ; +0x83, 0x140311cf3\nlea     rax, ??_7GJMGLayer@@6B@_2; const GJMGLayer::`vftable'          ; +0x8a, 0x140311cfa\nmov     [rbx+150h], rax                                                ; +0x91, 0x140311d01\nlea     rax, ??_7GJMGLayer@@6B@_3; const GJMGLayer::`vftable'          ; +0x98, 0x140311d08\nmov     [rbx+158h], rax                                                ; +0x9f, 0x140311d0f\nlea     rax, ??_7GJMGLayer@@6B@_4; const GJMGLayer::`vftable'          ; +0xa6, 0x140311d16\nmov     [rbx+160h], rax                                                ; +0xad, 0x140311d1d\nmov     [rbx+198h], rbp                                                ; +0xb4, 0x140311d24\nmov     [rbx+1A0h], rbp                                                ; +0xbb, 0x140311d2b\nmov     [rbx+1A8h], ebp                                                ; +0xc2, 0x140311d32\nmov     [rbx+1B0h], rbp                                                ; +0xc8, 0x140311d38\nmov     byte ptr [rbx+1B8h], 0                                         ; +0xcf, 0x140311d3f\nmov     [rbx+1BCh], ebp                                                ; +0xd6, 0x140311d46\nmov     word ptr [rbx+1C0h], 101h                                      ; +0xdc, 0x140311d4c\nmov     [rbx+1C4h], ebp                                                ; +0xe5, 0x140311d55\nmov     word ptr [rbx+1C8h], 0                                         ; +0xeb, 0x140311d5b\nmov     byte ptr [rbx+1CAh], 0                                         ; +0xf4, 0x140311d64\nmov     [rbx+1D0h], rbp                                                ; +0xfb, 0x140311d6b\nmov     [rbx+1D8h], rbp                                                ; +0x102, 0x140311d72\nmov     [rbx+1E0h], rbp                                                ; +0x109, 0x140311d79\nmov     edx, esi                                                       ; +0x110, 0x140311d80\nmov     rcx, rbx                                                       ; +0x112, 0x140311d82\ncall    GJMGLayer__init                                                ; +0x115, 0x140311d85\nmov     rcx, rbx                                                       ; +0x11a, 0x140311d8a\ntest    al, al                                                         ; +0x11d, 0x140311d8d\njz      short loc_140311D99                                            ; +0x11f, 0x140311d8f\ncall    cs:?autorelease@CCObject@cocos2d@@QEAAPEAV12@XZ; cocos2d::CCObject::autorelease(void) ; +0x121, 0x140311d91\njmp     short loc_140311DA7                                            ; +0x127, 0x140311d97\nmov     rax, [rbx]                                                     ; +0x129, 0x140311d99\nmov     edx, 1                                                         ; +0x12c, 0x140311d9c\ncall    qword ptr [rax+8]                                              ; +0x131, 0x140311da1\nmov     rbx, rbp                                                       ; +0x134, 0x140311da4\nmov     [rdi+1100h], rbx                                               ; +0x137, 0x140311da7\nmov     rax, [rbx]                                                     ; +0x13e, 0x140311dae\nmov     edx, esi                                                       ; +0x141, 0x140311db1\nmov     rcx, rbx                                                       ; +0x143, 0x140311db3\ncall    qword ptr [rax+40h]                                            ; +0x146, 0x140311db6\nmov     rcx, [rdi+10B0h]                                               ; +0x149, 0x140311db9\nmov     rax, [rcx]                                                     ; +0x150, 0x140311dc0\nmov     r8d, 0FFFFFFD9h                                                ; +0x153, 0x140311dc3\nmov     rdx, [rdi+1100h]                                               ; +0x159, 0x140311dc9\ncall    qword ptr [rax+1C8h]                                           ; +0x160, 0x140311dd0\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x166, 0x140311dd6\nmov     rbp, [rsp+28h+arg_10]                                          ; +0x16b, 0x140311ddb\nmov     rsi, [rsp+28h+arg_18]                                          ; +0x170, 0x140311de0\nadd     rsp, 20h                                                       ; +0x175, 0x140311de5\npop     rdi                                                            ; +0x179, 0x140311de9\nretn                                                                   ; +0x17a, 0x140311dea", "xrefs": ["GameManager::finishedLoadingMGAsync @ 0x14027e02a", "GJBaseGameLayer::syncBGTextures @ 0x140344f95", "LevelEditorLayer::init @ 0x1403eeaef", "LevelSettingsLayer::selectArtClosed @ 0x14045b3a9", "PlayLayer::setupHasCompleted @ 0x140504d74", "ArtTriggerGameObject::triggerObject @ 0x1406630d7", "<???> @ 0x14091e7f4"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "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"}