{"type": "func", "start": 4298650368, "end": 4298650530, "name": "GameManager::loadBackground", "pseudocode": "// \n// GameManager::loadBackground from 0x100383300 to 0x1003833a2 (162 bytes)\n// \n// 2 xrefs:\n// > LevelSettingsLayer::selectArtClosed @ 0x10026f3e5\n// > GameManager::getBGTexture @ 0x100383b40\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 GameManager::loadBackground(GameManager *a1, int a2)\n{\n  char v2; // al\n  int v3; // eax\n  int v4; // r14d\n  int m_loadedBgID; // esi\n  cocos2d::CCString *v6; // rax\n  const char *CString; // r15\n  cocos2d::CCTextureCache *v8; // rax\n  cocos2d::CCString *v9; // rax\n  const char *v10; // r15\n  cocos2d::CCTextureCache *v11; // rax\n  char v12; // [rsp-8h] [rbp-20h]\n\n  v12 = v2;\n  v3 = 59;\n  if ( a2 < 59 )\n    v3 = a2;\n  v4 = 1;\n  if ( v3 >= 2 )\n    v4 = v3;\n  m_loadedBgID = a1->m_loadedBgID;\n  if ( v4 != m_loadedBgID )\n  {\n    if ( m_loadedBgID )\n    {\n      v6 = (cocos2d::CCString *)sub_1007AB580(\"game_bg_%02d_001.png\", v12);\n      CString = cocos2d::CCString::getCString(v6);\n      v8 = cocos2d::CCTextureCache::sharedTextureCache();\n      cocos2d::CCTextureCache::removeTextureForKey(v8, CString);\n    }\n    v9 = (cocos2d::CCString *)sub_1007AB580(\"game_bg_%02d_001.png\", v12);\n    v10 = cocos2d::CCString::getCString(v9);\n    AppDelegate::get();\n    v11 = cocos2d::CCTextureCache::sharedTextureCache();\n    cocos2d::CCTextureCache::addImage(v11, v10, 0);\n    a1->m_loadedBgID = v4;\n  }\n}", "assembly": "; \n; GameManager::loadBackground from 0x100383300 to 0x1003833a2 (162 bytes)\n; \n; 2 xrefs:\n; > LevelSettingsLayer::selectArtClosed @ 0x10026f3e5\n; > GameManager::getBGTexture @ 0x100383b40\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, 0x100383300\nmov     rbp, rsp                                                       ; +0x1, 0x100383301\npush    r15                                                            ; +0x4, 0x100383304\npush    r14                                                            ; +0x6, 0x100383306\npush    rbx                                                            ; +0x8, 0x100383308\npush    rax; char                                                      ; +0x9, 0x100383309\ncmp     esi, 3Bh ; ';'                                                 ; +0xa, 0x10038330a\nmov     eax, 3Bh ; ';'                                                 ; +0xd, 0x10038330d\ncmovl   eax, esi                                                       ; +0x12, 0x100383312\ncmp     eax, 2                                                         ; +0x15, 0x100383315\nmov     r14d, 1                                                        ; +0x18, 0x100383318\ncmovge  r14d, eax                                                      ; +0x1e, 0x10038331e\nmov     esi, [rdi+3A0h]                                                ; +0x22, 0x100383322\ncmp     r14d, esi                                                      ; +0x28, 0x100383328\njz      short loc_100383397                                            ; +0x2b, 0x10038332b\nmov     rbx, rdi                                                       ; +0x2d, 0x10038332d\ntest    esi, esi                                                       ; +0x30, 0x100383330\njz      short loc_10038335D                                            ; +0x32, 0x100383332\nlea     rdi, aGameBg02d001Pn; \"game_bg_%02d_001.png\"                   ; +0x34, 0x100383334\nxor     eax, eax                                                       ; +0x3b, 0x10038333b\ncall    sub_1007AB580                                                  ; +0x3d, 0x10038333d\nmov     rdi, rax                                                       ; +0x42, 0x100383342\ncall    cocos2d__CCString__getCString                                  ; +0x45, 0x100383345\nmov     r15, rax                                                       ; +0x4a, 0x10038334a\ncall    cocos2d__CCTextureCache__sharedTextureCache                    ; +0x4d, 0x10038334d\nmov     rdi, rax                                                       ; +0x52, 0x100383352\nmov     rsi, r15                                                       ; +0x55, 0x100383355\ncall    cocos2d__CCTextureCache__removeTextureForKey                   ; +0x58, 0x100383358\nlea     rdi, aGameBg02d001Pn; \"game_bg_%02d_001.png\"                   ; +0x5d, 0x10038335d\nmov     esi, r14d                                                      ; +0x64, 0x100383364\nxor     eax, eax                                                       ; +0x67, 0x100383367\ncall    sub_1007AB580                                                  ; +0x69, 0x100383369\nmov     rdi, rax                                                       ; +0x6e, 0x10038336e\ncall    cocos2d__CCString__getCString                                  ; +0x71, 0x100383371\nmov     r15, rax                                                       ; +0x76, 0x100383376\ncall    AppDelegate__get                                               ; +0x79, 0x100383379\ncall    cocos2d__CCTextureCache__sharedTextureCache                    ; +0x7e, 0x10038337e\nmov     rdi, rax                                                       ; +0x83, 0x100383383\nmov     rsi, r15                                                       ; +0x86, 0x100383386\nxor     edx, edx                                                       ; +0x89, 0x100383389\ncall    cocos2d__CCTextureCache__addImage                              ; +0x8b, 0x10038338b\nmov     [rbx+3A0h], r14d                                               ; +0x90, 0x100383390\nadd     rsp, 8                                                         ; +0x97, 0x100383397\npop     rbx                                                            ; +0x9b, 0x10038339b\npop     r14                                                            ; +0x9c, 0x10038339c\npop     r15                                                            ; +0x9e, 0x10038339e\npop     rbp                                                            ; +0xa0, 0x1003833a0\nretn                                                                   ; +0xa1, 0x1003833a1", "xrefs": ["LevelSettingsLayer::selectArtClosed @ 0x10026f3e5", "GameManager::getBGTexture @ 0x100383b40"], "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"}