{"type": "func", "start": 4296380240, "end": 4296380507, "name": "GJBaseGameLayer::syncBGTextures", "pseudocode": "// \n// GJBaseGameLayer::syncBGTextures from 0x100158f50 to 0x10015905b (267 bytes)\n// \n// 3 xrefs:\n// > PlayLayer::resetLevel @ 0x1000beddd\n// > LevelEditorLayer::onPlaytest @ 0x1000f2831\n// > LevelEditorLayer::onStopPlaytest @ 0x1000f2e96\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 __fastcall GJBaseGameLayer::syncBGTextures(GJBaseGameLayer *a1)\n{\n  int v2; // eax\n  int m_background; // esi\n  int v4; // eax\n  int m_ground; // esi\n  GJMGLayer *m_middleground; // rdi\n  int v7; // eax\n  int v8; // r15d\n  GJMGLayer *v9; // rdi\n  unsigned int v10; // r14d\n  GJMGLayer *v11; // rax\n\n  v2 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_background->getTag)(a1->m_background);\n  m_background = a1->m_gameState.m_background;\n  if ( v2 != m_background )\n    GJBaseGameLayer::createBackground(a1, m_background);\n  v4 = ((__int64 (__fastcall *)(GJGroundLayer *))a1->m_groundLayer->getTag)(a1->m_groundLayer);\n  m_ground = a1->m_gameState.m_ground;\n  if ( v4 != m_ground )\n    GJBaseGameLayer::createGroundLayer(a1, m_ground, a1->m_levelSettings->m_groundLineIndex);\n  m_middleground = a1->m_middleground;\n  if ( m_middleground )\n  {\n    v7 = ((__int64 (__fastcall *)(GJMGLayer *))m_middleground->getTag)(m_middleground);\n    v8 = a1->m_gameState.m_middleground;\n    v9 = a1->m_middleground;\n    if ( v7 == v8 )\n    {\n      if ( v9 )\n        return;\n      v8 = v7;\n    }\n    else if ( v9 )\n    {\n      ((void (__fastcall *)(GJMGLayer *))v9->removeFromParent)(v9);\n      a1->m_middleground = nullptr;\n    }\n  }\n  else\n  {\n    v8 = a1->m_gameState.m_middleground;\n  }\n  if ( v8 > 0 )\n  {\n    v10 = 3;\n    if ( (unsigned int)v8 < 3 )\n      v10 = v8;\n    v11 = GJMGLayer::create(v10);\n    a1->m_middleground = v11;\n    ((void (__fastcall *)(GJMGLayer *, _QWORD))v11->setTag)(v11, v10);\n    ((void (__fastcall *)(cocos2d::CCNode *, GJMGLayer *, __int64))a1->m_objectParent->addChild_0)(\n      a1->m_objectParent,\n      a1->m_middleground,\n      4294967257LL);\n  }\n}", "assembly": "; \n; GJBaseGameLayer::syncBGTextures from 0x100158f50 to 0x10015905b (267 bytes)\n; \n; 3 xrefs:\n; > PlayLayer::resetLevel @ 0x1000beddd\n; > LevelEditorLayer::onPlaytest @ 0x1000f2831\n; > LevelEditorLayer::onStopPlaytest @ 0x1000f2e96\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\npush    rbp                                                            ; +0x0, 0x100158f50\nmov     rbp, rsp                                                       ; +0x1, 0x100158f51\npush    r15                                                            ; +0x4, 0x100158f54\npush    r14                                                            ; +0x6, 0x100158f56\npush    rbx                                                            ; +0x8, 0x100158f58\npush    rax                                                            ; +0x9, 0x100158f59\nmov     rbx, rdi                                                       ; +0xa, 0x100158f5a\nmov     rdi, [rdi+0ED0h]                                               ; +0xd, 0x100158f5d\nmov     rax, [rdi]                                                     ; +0x14, 0x100158f64\ncall    qword ptr [rax+40h]                                            ; +0x17, 0x100158f67\nmov     esi, [rbx+76Ch]                                                ; +0x1a, 0x100158f6a\ncmp     eax, esi                                                       ; +0x20, 0x100158f70\njz      short loc_100158F7C                                            ; +0x22, 0x100158f72\nmov     rdi, rbx                                                       ; +0x24, 0x100158f74\ncall    GJBaseGameLayer__createBackground                              ; +0x27, 0x100158f77\nmov     rdi, [rbx+0EE0h]                                               ; +0x2c, 0x100158f7c\nmov     rax, [rdi]                                                     ; +0x33, 0x100158f83\ncall    qword ptr [rax+40h]                                            ; +0x36, 0x100158f86\nmov     esi, [rbx+770h]                                                ; +0x39, 0x100158f89\ncmp     eax, esi                                                       ; +0x3f, 0x100158f8f\njz      short loc_100158FA8                                            ; +0x41, 0x100158f91\nmov     rax, [rbx+0CB0h]                                               ; +0x43, 0x100158f93\nmov     edx, [rax+1A8h]                                                ; +0x4a, 0x100158f9a\nmov     rdi, rbx                                                       ; +0x50, 0x100158fa0\ncall    GJBaseGameLayer__createGroundLayer                             ; +0x53, 0x100158fa3\nmov     rdi, [rbx+0EF0h]                                               ; +0x58, 0x100158fa8\ntest    rdi, rdi                                                       ; +0x5f, 0x100158faf\njz      short loc_100158FD7                                            ; +0x62, 0x100158fb2\nmov     rax, [rdi]                                                     ; +0x64, 0x100158fb4\ncall    qword ptr [rax+40h]                                            ; +0x67, 0x100158fb7\nmov     r15d, [rbx+774h]                                               ; +0x6a, 0x100158fba\nmov     rdi, [rbx+0EF0h]                                               ; +0x71, 0x100158fc1\ncmp     eax, r15d                                                      ; +0x78, 0x100158fc8\njnz     short loc_100158FE0                                            ; +0x7b, 0x100158fcb\ntest    rdi, rdi                                                       ; +0x7d, 0x100158fcd\njnz     short loc_100159050                                            ; +0x80, 0x100158fd0\nmov     r15d, eax                                                      ; +0x82, 0x100158fd2\njmp     short loc_100158FF9                                            ; +0x85, 0x100158fd5\nmov     r15d, [rbx+774h]                                               ; +0x87, 0x100158fd7\njmp     short loc_100158FF9                                            ; +0x8e, 0x100158fde\ntest    rdi, rdi                                                       ; +0x90, 0x100158fe0\njz      short loc_100158FF9                                            ; +0x93, 0x100158fe3\nmov     rax, [rdi]                                                     ; +0x95, 0x100158fe5\ncall    qword ptr [rax+1F8h]                                           ; +0x98, 0x100158fe8\nmov     qword ptr [rbx+0EF0h], 0                                       ; +0x9e, 0x100158fee\ntest    r15d, r15d                                                     ; +0xa9, 0x100158ff9\njle     short loc_100159050                                            ; +0xac, 0x100158ffc\ncmp     r15d, 3                                                        ; +0xae, 0x100158ffe\nmov     r14d, 3                                                        ; +0xb2, 0x100159002\ncmovb   r14d, r15d                                                     ; +0xb8, 0x100159008\nmov     edi, r14d                                                      ; +0xbc, 0x10015900c\ncall    GJMGLayer__create                                              ; +0xbf, 0x10015900f\nmov     [rbx+0EF0h], rax                                               ; +0xc4, 0x100159014\nmov     rcx, [rax]                                                     ; +0xcb, 0x10015901b\nmov     rdi, rax                                                       ; +0xce, 0x10015901e\nmov     esi, r14d                                                      ; +0xd1, 0x100159021\ncall    qword ptr [rcx+48h]                                            ; +0xd4, 0x100159024\nmov     rdi, [rbx+0EA0h]                                               ; +0xd7, 0x100159027\nmov     rsi, [rbx+0EF0h]                                               ; +0xde, 0x10015902e\nmov     rax, [rdi]                                                     ; +0xe5, 0x100159035\nmov     rax, [rax+1C0h]                                                ; +0xe8, 0x100159038\nmov     edx, 0FFFFFFD9h                                                ; +0xef, 0x10015903f\nadd     rsp, 8                                                         ; +0xf4, 0x100159044\npop     rbx                                                            ; +0xf8, 0x100159048\npop     r14                                                            ; +0xf9, 0x100159049\npop     r15                                                            ; +0xfb, 0x10015904b\npop     rbp                                                            ; +0xfd, 0x10015904d\njmp     rax                                                            ; +0xfe, 0x10015904e\nadd     rsp, 8                                                         ; +0x100, 0x100159050\npop     rbx                                                            ; +0x104, 0x100159054\npop     r14                                                            ; +0x105, 0x100159055\npop     r15                                                            ; +0x107, 0x100159057\npop     rbp                                                            ; +0x109, 0x100159059\nretn                                                                   ; +0x10a, 0x10015905a", "xrefs": ["PlayLayer::resetLevel @ 0x1000beddd", "LevelEditorLayer::onPlaytest @ 0x1000f2831", "LevelEditorLayer::onStopPlaytest @ 0x1000f2e96"], "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"}