{"type": "func", "start": 5370292736, "end": 5370292999, "name": "GameManager::loadMiddleground", "pseudocode": "// \n// GameManager::loadMiddleground from 0x140182a00 to 0x140182b07 (263 bytes)\n// \n// 5 xrefs:\n// > GJMGLayer::init @ 0x14027f0ee\n// > LevelSettingsLayer::selectArtClosed @ 0x1403220f7\n// > <???> @ 0x140677ae4\n// > <???> @ 0x140677af4\n// > <???> @ 0x1406cb4b4\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::loadMiddleground(GameManager *a1, int a2)\n{\n  int v2; // eax\n  int m_loadedMG; // edx\n  int v5; // edi\n  cocos2d::CCString *v6; // rax\n  const char *CString; // rbx\n  cocos2d::CCTextureCache *v8; // rax\n  cocos2d::CCString *v9; // rax\n  const char *v10; // rbx\n  cocos2d::CCTextureCache *v11; // rax\n  cocos2d::CCString *v12; // rax\n  const char *v13; // rbx\n  cocos2d::CCTextureCache *v14; // rax\n  cocos2d::CCString *v15; // rax\n  const char *v16; // rbx\n  cocos2d::CCTextureCache *v17; // rax\n\n  v2 = 3;\n  if ( a2 < 3 )\n    v2 = a2;\n  m_loadedMG = a1->m_loadedMG;\n  v5 = 0;\n  if ( v2 > 0 )\n    v5 = v2;\n  if ( v5 != m_loadedMG )\n  {\n    v6 = cocos2d::CCString::createWithFormat(\"fg_%02d_001.png\", m_loadedMG);\n    CString = cocos2d::CCString::getCString(v6);\n    v8 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();\n    cocos2d::CCTextureCache::removeTextureForKey(v8, CString);\n    v9 = cocos2d::CCString::createWithFormat(\"fg_%02d_2_001.png\", a1->m_loadedMG);\n    v10 = cocos2d::CCString::getCString(v9);\n    v11 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();\n    cocos2d::CCTextureCache::removeTextureForKey(v11, v10);\n    if ( v5 > 0 )\n    {\n      v12 = cocos2d::CCString::createWithFormat(\"fg_%02d_001.png\", v5);\n      v13 = cocos2d::CCString::getCString(v12);\n      v14 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();\n      cocos2d::CCTextureCache::addImage(v14, v13, 0);\n      v15 = cocos2d::CCString::createWithFormat(\"fg_%02d_2_001.png\", v5);\n      v16 = cocos2d::CCString::getCString(v15);\n      v17 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();\n      cocos2d::CCTextureCache::addImage(v17, v16, 0);\n    }\n    a1->m_loadedMG = v5;\n  }\n}", "assembly": "; \n; GameManager::loadMiddleground from 0x140182a00 to 0x140182b07 (263 bytes)\n; \n; 5 xrefs:\n; > GJMGLayer::init @ 0x14027f0ee\n; > LevelSettingsLayer::selectArtClosed @ 0x1403220f7\n; > <???> @ 0x140677ae4\n; > <???> @ 0x140677af4\n; > <???> @ 0x1406cb4b4\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, 0x140182a00\npush    rdi                                                            ; +0x5, 0x140182a05\nsub     rsp, 20h                                                       ; +0x6, 0x140182a06\nmov     eax, 3                                                         ; +0xa, 0x140182a0a\nmov     rsi, rcx                                                       ; +0xf, 0x140182a0f\ncmp     edx, eax                                                       ; +0x12, 0x140182a12\ncmovl   eax, edx                                                       ; +0x14, 0x140182a14\nmov     edx, [rcx+3C8h]                                                ; +0x17, 0x140182a17\nxor     edi, edi                                                       ; +0x1d, 0x140182a1d\ntest    eax, eax                                                       ; +0x1f, 0x140182a1f\ncmovg   edi, eax                                                       ; +0x21, 0x140182a21\ncmp     edi, edx                                                       ; +0x24, 0x140182a24\njz      loc_140182AFC                                                  ; +0x26, 0x140182a26\nlea     rcx, aFg02d001Png; \"fg_%02d_001.png\"                           ; +0x2c, 0x140182a2c\nmov     [rsp+28h+arg_0], rbx                                           ; +0x33, 0x140182a33\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x38, 0x140182a38\nmov     rcx, rax                                                       ; +0x3e, 0x140182a3e\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x41, 0x140182a41\nmov     rbx, rax                                                       ; +0x47, 0x140182a47\ncall    cs:?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0x4a, 0x140182a4a\nmov     rcx, rax                                                       ; +0x50, 0x140182a50\nmov     rdx, rbx                                                       ; +0x53, 0x140182a53\ncall    cs:?removeTextureForKey@CCTextureCache@cocos2d@@QEAAXPEBD@Z; cocos2d::CCTextureCache::removeTextureForKey(char const *) ; +0x56, 0x140182a56\nmov     edx, [rsi+3C8h]                                                ; +0x5c, 0x140182a5c\nlea     rcx, aFg02d2001Png; \"fg_%02d_2_001.png\"                        ; +0x62, 0x140182a62\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x69, 0x140182a69\nmov     rcx, rax                                                       ; +0x6f, 0x140182a6f\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x72, 0x140182a72\nmov     rbx, rax                                                       ; +0x78, 0x140182a78\ncall    cs:?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0x7b, 0x140182a7b\nmov     rcx, rax                                                       ; +0x81, 0x140182a81\nmov     rdx, rbx                                                       ; +0x84, 0x140182a84\ncall    cs:?removeTextureForKey@CCTextureCache@cocos2d@@QEAAXPEBD@Z; cocos2d::CCTextureCache::removeTextureForKey(char const *) ; +0x87, 0x140182a87\ntest    edi, edi                                                       ; +0x8d, 0x140182a8d\njle     short loc_140182AF1                                            ; +0x8f, 0x140182a8f\nmov     edx, edi                                                       ; +0x91, 0x140182a91\nlea     rcx, aFg02d001Png; \"fg_%02d_001.png\"                           ; +0x93, 0x140182a93\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x9a, 0x140182a9a\nmov     rcx, rax                                                       ; +0xa0, 0x140182aa0\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xa3, 0x140182aa3\nmov     rbx, rax                                                       ; +0xa9, 0x140182aa9\ncall    cs:?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0xac, 0x140182aac\nxor     r8d, r8d                                                       ; +0xb2, 0x140182ab2\nmov     rdx, rbx                                                       ; +0xb5, 0x140182ab5\nmov     rcx, rax                                                       ; +0xb8, 0x140182ab8\ncall    cs:?addImage@CCTextureCache@cocos2d@@QEAAPEAVCCTexture2D@2@PEBD_N@Z; cocos2d::CCTextureCache::addImage(char const *,bool) ; +0xbb, 0x140182abb\nmov     edx, edi                                                       ; +0xc1, 0x140182ac1\nlea     rcx, aFg02d2001Png; \"fg_%02d_2_001.png\"                        ; +0xc3, 0x140182ac3\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xca, 0x140182aca\nmov     rcx, rax                                                       ; +0xd0, 0x140182ad0\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xd3, 0x140182ad3\nmov     rbx, rax                                                       ; +0xd9, 0x140182ad9\ncall    cs:?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0xdc, 0x140182adc\nxor     r8d, r8d                                                       ; +0xe2, 0x140182ae2\nmov     rdx, rbx                                                       ; +0xe5, 0x140182ae5\nmov     rcx, rax                                                       ; +0xe8, 0x140182ae8\ncall    cs:?addImage@CCTextureCache@cocos2d@@QEAAPEAVCCTexture2D@2@PEBD_N@Z; cocos2d::CCTextureCache::addImage(char const *,bool) ; +0xeb, 0x140182aeb\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xf1, 0x140182af1\nmov     [rsi+3C8h], edi                                                ; +0xf6, 0x140182af6\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xfc, 0x140182afc\nadd     rsp, 20h                                                       ; +0x101, 0x140182b01\npop     rdi                                                            ; +0x105, 0x140182b05\nretn                                                                   ; +0x106, 0x140182b06", "xrefs": ["GJMGLayer::init @ 0x14027f0ee", "LevelSettingsLayer::selectArtClosed @ 0x1403220f7", "<???> @ 0x140677ae4", "<???> @ 0x140677af4", "<???> @ 0x1406cb4b4"], "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"}