{"type": "func", "start": 5370293328, "end": 5370293610, "name": "GameManager::loadGround", "pseudocode": "// \n// GameManager::loadGround from 0x140182c50 to 0x140182d6a (282 bytes)\n// \n// 5 xrefs:\n// > GJGroundLayer::init @ 0x14027e2d3\n// > LevelSettingsLayer::selectArtClosed @ 0x140321ff8\n// > <???> @ 0x140677b2c\n// > <???> @ 0x140677b3c\n// > <???> @ 0x1406cb514\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 GameManager::loadGround(GameManager *a1, int a2)\n{\n  int v2; // eax\n  int v3; // edi\n  int m_loadedGroundID; // edx\n  cocos2d::CCString *v6; // rax\n  const char *CString; // rbx\n  cocos2d::CCTextureCache *v8; // rax\n  int v9; // edx\n  cocos2d::CCString *v10; // rax\n  const char *v11; // rbx\n  cocos2d::CCTextureCache *v12; // rax\n  cocos2d::CCString *v13; // rax\n  const char *v14; // rbx\n  cocos2d::CCTextureCache *v15; // rax\n  cocos2d::CCString *v16; // rax\n  const char *v17; // rbx\n  cocos2d::CCTextureCache *v18; // rax\n\n  v2 = 22;\n  v3 = 1;\n  if ( a2 < 22 )\n    v2 = a2;\n  m_loadedGroundID = a1->m_loadedGroundID;\n  if ( v2 > 1 )\n    v3 = v2;\n  if ( v3 != m_loadedGroundID )\n  {\n    if ( m_loadedGroundID )\n    {\n      v6 = cocos2d::CCString::createWithFormat(\"groundSquare_%02d_001.png\", m_loadedGroundID);\n      CString = cocos2d::CCString::getCString(v6);\n      v8 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();\n      cocos2d::CCTextureCache::removeTextureForKey(v8, CString);\n      v9 = a1->m_loadedGroundID;\n      if ( (unsigned int)(v9 - 8) <= 3 )\n      {\n        v10 = cocos2d::CCString::createWithFormat(\"groundSquare_%02d_2_001.png\", v9);\n        v11 = cocos2d::CCString::getCString(v10);\n        v12 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();\n        cocos2d::CCTextureCache::removeTextureForKey(v12, v11);\n      }\n    }\n    v13 = cocos2d::CCString::createWithFormat(\"groundSquare_%02d_001.png\", v3);\n    v14 = cocos2d::CCString::getCString(v13);\n    v15 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();\n    cocos2d::CCTextureCache::addImage(v15, v14, 0);\n    if ( (unsigned int)(v3 - 8) <= 3 )\n    {\n      v16 = cocos2d::CCString::createWithFormat(\"groundSquare_%02d_2_001.png\", v3);\n      v17 = cocos2d::CCString::getCString(v16);\n      v18 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();\n      cocos2d::CCTextureCache::addImage(v18, v17, 0);\n    }\n    a1->m_loadedGroundID = v3;\n  }\n}", "assembly": "; \n; GameManager::loadGround from 0x140182c50 to 0x140182d6a (282 bytes)\n; \n; 5 xrefs:\n; > GJGroundLayer::init @ 0x14027e2d3\n; > LevelSettingsLayer::selectArtClosed @ 0x140321ff8\n; > <???> @ 0x140677b2c\n; > <???> @ 0x140677b3c\n; > <???> @ 0x1406cb514\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_8], rsi                                               ; +0x0, 0x140182c50\npush    rdi                                                            ; +0x5, 0x140182c55\nsub     rsp, 20h                                                       ; +0x6, 0x140182c56\nmov     eax, 16h                                                       ; +0xa, 0x140182c5a\nmov     edi, 1                                                         ; +0xf, 0x140182c5f\ncmp     edx, eax                                                       ; +0x14, 0x140182c64\nmov     rsi, rcx                                                       ; +0x16, 0x140182c66\ncmovl   eax, edx                                                       ; +0x19, 0x140182c69\nmov     edx, [rcx+3C4h]                                                ; +0x1c, 0x140182c6c\ncmp     eax, edi                                                       ; +0x22, 0x140182c72\ncmovg   edi, eax                                                       ; +0x24, 0x140182c74\ncmp     edi, edx                                                       ; +0x27, 0x140182c77\njz      loc_140182D5F                                                  ; +0x29, 0x140182c79\nmov     [rsp+28h+arg_0], rbx                                           ; +0x2f, 0x140182c7f\ntest    edx, edx                                                       ; +0x34, 0x140182c84\njz      short loc_140182CEC                                            ; +0x36, 0x140182c86\nlea     rcx, aGroundsquare02; \"groundSquare_%02d_001.png\"              ; +0x38, 0x140182c88\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x3f, 0x140182c8f\nmov     rcx, rax                                                       ; +0x45, 0x140182c95\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x48, 0x140182c98\nmov     rbx, rax                                                       ; +0x4e, 0x140182c9e\ncall    cs:?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0x51, 0x140182ca1\nmov     rcx, rax                                                       ; +0x57, 0x140182ca7\nmov     rdx, rbx                                                       ; +0x5a, 0x140182caa\ncall    cs:?removeTextureForKey@CCTextureCache@cocos2d@@QEAAXPEBD@Z; cocos2d::CCTextureCache::removeTextureForKey(char const *) ; +0x5d, 0x140182cad\nmov     edx, [rsi+3C4h]                                                ; +0x63, 0x140182cb3\nlea     eax, [rdx-8]                                                   ; +0x69, 0x140182cb9\ncmp     eax, 3                                                         ; +0x6c, 0x140182cbc\nja      short loc_140182CEC                                            ; +0x6f, 0x140182cbf\nlea     rcx, aGroundsquare02_0; \"groundSquare_%02d_2_001.png\"          ; +0x71, 0x140182cc1\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x78, 0x140182cc8\nmov     rcx, rax                                                       ; +0x7e, 0x140182cce\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x81, 0x140182cd1\nmov     rbx, rax                                                       ; +0x87, 0x140182cd7\ncall    cs:?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0x8a, 0x140182cda\nmov     rcx, rax                                                       ; +0x90, 0x140182ce0\nmov     rdx, rbx                                                       ; +0x93, 0x140182ce3\ncall    cs:?removeTextureForKey@CCTextureCache@cocos2d@@QEAAXPEBD@Z; cocos2d::CCTextureCache::removeTextureForKey(char const *) ; +0x96, 0x140182ce6\nmov     edx, edi                                                       ; +0x9c, 0x140182cec\nlea     rcx, aGroundsquare02; \"groundSquare_%02d_001.png\"              ; +0x9e, 0x140182cee\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xa5, 0x140182cf5\nmov     rcx, rax                                                       ; +0xab, 0x140182cfb\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xae, 0x140182cfe\nmov     rbx, rax                                                       ; +0xb4, 0x140182d04\ncall    cs:?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0xb7, 0x140182d07\nxor     r8d, r8d                                                       ; +0xbd, 0x140182d0d\nmov     rdx, rbx                                                       ; +0xc0, 0x140182d10\nmov     rcx, rax                                                       ; +0xc3, 0x140182d13\ncall    cs:?addImage@CCTextureCache@cocos2d@@QEAAPEAVCCTexture2D@2@PEBD_N@Z; cocos2d::CCTextureCache::addImage(char const *,bool) ; +0xc6, 0x140182d16\nlea     eax, [rdi-8]                                                   ; +0xcc, 0x140182d1c\ncmp     eax, 3                                                         ; +0xcf, 0x140182d1f\nja      short loc_140182D54                                            ; +0xd2, 0x140182d22\nmov     edx, edi                                                       ; +0xd4, 0x140182d24\nlea     rcx, aGroundsquare02_0; \"groundSquare_%02d_2_001.png\"          ; +0xd6, 0x140182d26\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xdd, 0x140182d2d\nmov     rcx, rax                                                       ; +0xe3, 0x140182d33\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xe6, 0x140182d36\nmov     rbx, rax                                                       ; +0xec, 0x140182d3c\ncall    cs:?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0xef, 0x140182d3f\nxor     r8d, r8d                                                       ; +0xf5, 0x140182d45\nmov     rdx, rbx                                                       ; +0xf8, 0x140182d48\nmov     rcx, rax                                                       ; +0xfb, 0x140182d4b\ncall    cs:?addImage@CCTextureCache@cocos2d@@QEAAPEAVCCTexture2D@2@PEBD_N@Z; cocos2d::CCTextureCache::addImage(char const *,bool) ; +0xfe, 0x140182d4e\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x104, 0x140182d54\nmov     [rsi+3C4h], edi                                                ; +0x109, 0x140182d59\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x10f, 0x140182d5f\nadd     rsp, 20h                                                       ; +0x114, 0x140182d64\npop     rdi                                                            ; +0x118, 0x140182d68\nretn                                                                   ; +0x119, 0x140182d69", "xrefs": ["GJGroundLayer::init @ 0x14027e2d3", "LevelSettingsLayer::selectArtClosed @ 0x140321ff8", "<???> @ 0x140677b2c", "<???> @ 0x140677b3c", "<???> @ 0x1406cb514"], "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"}