{"type": "func", "start": 5369651488, "end": 5369652034, "name": "LevelBadgePopup::loadLevelsFinished", "pseudocode": "// \n// LevelBadgePopup::loadLevelsFinished from 0x1400e6120 to 0x1400e6342 (546 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x1407286a0\n// > <???> @ 0x140914cb4\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:26:32 +0000\n// \n\n// Hidden C++ exception states: #wind=3\nint __fastcall LevelBadgePopup::loadLevelsFinished(__int64 a1, cocos2d::CCArray *a2, _BYTE *a3)\n{\n  size_t v6; // rdi\n  __int64 v7; // rax\n  const void *v8; // rcx\n  size_t v9; // r8\n  __int64 v10; // r14\n  __int64 v11; // rbx\n  __int64 v12; // rax\n  __int64 v13; // rcx\n  signed int i; // ebx\n  signed int v15; // eax\n  struct cocos2d::CCObject *v16; // rax\n  __int64 *v17; // r15\n  const char *v18; // rdx\n  __int64 v19; // rbx\n  __int64 v20; // rdx\n  __int64 v21; // r8\n  __int64 v22; // rax\n  __int64 v23; // rdx\n  __int128 v25; // [rsp+38h] [rbp-70h] BYREF\n  __int64 v26; // [rsp+48h] [rbp-60h]\n  __int64 v27; // [rsp+50h] [rbp-58h]\n  __int128 v28; // [rsp+58h] [rbp-50h] BYREF\n  __int64 v29; // [rsp+68h] [rbp-40h]\n  __int64 v30; // [rsp+70h] [rbp-38h]\n  void *v31; // [rsp+C0h] [rbp+18h]\n\n  v6 = -1;\n  if ( !a3 )\n    goto LABEL_9;\n  v7 = -1;\n  do\n    ++v7;\n  while ( a3[v7] );\n  v8 = (const void *)(a1 + 32);\n  if ( *(_QWORD *)(a1 + 56) > 0xFu )\n    v8 = *(const void **)(a1 + 32);\n  v9 = *(_QWORD *)(a1 + 48);\n  if ( v9 == v7 )\n  {\n    if ( !v9 || (LODWORD(v7) = memcmp(v8, a3, v9), !(_DWORD)v7) )\n    {\nLABEL_9:\n      v10 = a1 - 664;\n      v11 = a1;\n      if ( a1 == 664 )\n        v11 = 0;\n      v12 = *(_QWORD *)&qword_14090BFB0;\n      if ( !*(_QWORD *)&qword_14090BFB0 )\n      {\n        v31 = operator new(0x690u);\n        *(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v31);\n        (*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);\n        v12 = *(_QWORD *)&qword_14090BFB0;\n      }\n      if ( *(_QWORD *)(v12 + 1352) == v11 )\n        *(_QWORD *)(v12 + 1352) = 0;\n      v13 = *(_QWORD *)(a1 + 64);\n      if ( v13 )\n      {\n        LoadingCircle::fadeAndRemove(v13);\n        *(_QWORD *)(a1 + 64) = 0;\n      }\n      for ( i = 0; ; ++i )\n      {\n        v15 = a2 ? cocos2d::CCArray::count(a2) : 0;\n        if ( i >= v15 )\n          break;\n        v16 = cocos2d::CCArray::objectAtIndex(a2, i);\n        if ( *(_BYTE *)(a1 + 12) )\n          v13 = *((unsigned int *)v16 + 86);\n        else\n          v13 = (unsigned int)(*((_DWORD *)v16 + 82) - *((_DWORD *)v16 + 83));\n        if ( (_DWORD)v13 == *(_DWORD *)(a1 + 8) )\n        {\n          LODWORD(v7) = LevelBadgePopup::buildCell(a1 - 664, v16);\n          return v7;\n        }\n      }\n      v17 = *(__int64 **)(cocos2d::CCDirector::sharedDirector(v13) + 272);\n      v25 = 0;\n      v26 = 0;\n      v27 = 15;\n      LOBYTE(v25) = 0;\n      v18 = \"Level not found\";\n      if ( *(_BYTE *)(a1 + 12) )\n        v18 = \"List not found\";\n      v28 = 0;\n      v29 = 0;\n      v30 = 0;\n      do\n        ++v6;\n      while ( v18[v6] );\n      sub_14003D230(&v28, v18, v6);\n      v19 = *v17;\n      v22 = TextAlertPopup::create(&v28, v20, v21, 150, &v25);\n      (*(void (__fastcall **)(__int64 *, __int64, __int64))(v19 + 456))(v17, v22, 1000);\n      (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v10 + 992LL))(a1 - 664, 0);\n      LOBYTE(v23) = 1;\n      LODWORD(v7) = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v10 + 520LL))(a1 - 664, v23);\n    }\n  }\n  return v7;\n}", "assembly": "; \n; LevelBadgePopup::loadLevelsFinished from 0x1400e6120 to 0x1400e6342 (546 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x1407286a0\n; > <???> @ 0x140914cb4\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:26:32 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x1400e6120\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x1400e6125\npush    rsi                                                            ; +0xa, 0x1400e612a\npush    rdi                                                            ; +0xb, 0x1400e612b\npush    r12                                                            ; +0xc, 0x1400e612c\npush    r14                                                            ; +0xe, 0x1400e612e\npush    r15                                                            ; +0x10, 0x1400e6130\nsub     rsp, 80h                                                       ; +0x12, 0x1400e6132\nmov     r9, r8                                                         ; +0x19, 0x1400e6139\nmov     rbp, rdx                                                       ; +0x1c, 0x1400e613c\nmov     rsi, rcx                                                       ; +0x1f, 0x1400e613f\nmov     rdi, 0FFFFFFFFFFFFFFFFh                                        ; +0x22, 0x1400e6142\ntest    r8, r8                                                         ; +0x29, 0x1400e6149\njz      short loc_1400E618C                                            ; +0x2c, 0x1400e614c\nmov     rax, rdi                                                       ; +0x2e, 0x1400e614e\ninc     rax                                                            ; +0x31, 0x1400e6151\ncmp     byte ptr [r8+rax], 0                                           ; +0x34, 0x1400e6154\njnz     short loc_1400E6151                                            ; +0x39, 0x1400e6159\nadd     rcx, 20h ; ' '                                                 ; +0x3b, 0x1400e615b\ncmp     qword ptr [rsi+38h], 0Fh                                       ; +0x3f, 0x1400e615f\njbe     short loc_1400E616A                                            ; +0x44, 0x1400e6164\nmov     rcx, [rsi+20h]; Buf1                                           ; +0x46, 0x1400e6166\nmov     r8, [rsi+30h]; Size                                            ; +0x4a, 0x1400e616a\ncmp     r8, rax                                                        ; +0x4e, 0x1400e616e\njnz     loc_1400E6326                                                  ; +0x51, 0x1400e6171\ntest    r8, r8                                                         ; +0x57, 0x1400e6177\njz      short loc_1400E618C                                            ; +0x5a, 0x1400e617a\nmov     rdx, r9; Buf2                                                  ; +0x5c, 0x1400e617c\ncall    memcmp                                                         ; +0x5f, 0x1400e617f\ntest    eax, eax                                                       ; +0x64, 0x1400e6184\njnz     loc_1400E6326                                                  ; +0x66, 0x1400e6186\nlea     r14, [rsi-298h]                                                ; +0x6c, 0x1400e618c\nmov     rbx, rsi                                                       ; +0x73, 0x1400e6193\nxor     r12d, r12d                                                     ; +0x76, 0x1400e6196\ntest    r14, r14                                                       ; +0x79, 0x1400e6199\ncmovz   rbx, r12                                                       ; +0x7c, 0x1400e619c\nmov     rax, cs:qword_14090BFB0                                        ; +0x80, 0x1400e61a0\ntest    rax, rax                                                       ; +0x87, 0x1400e61a7\njnz     short loc_1400E61E1                                            ; +0x8a, 0x1400e61aa\nmov     ecx, 690h; Size                                                ; +0x8c, 0x1400e61ac\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x91, 0x1400e61b1\nmov     [rsp+0A8h+arg_10], rax                                         ; +0x96, 0x1400e61b6\nmov     rcx, rax                                                       ; +0x9e, 0x1400e61be\ncall    GameLevelManager__GameLevelManager                             ; +0xa1, 0x1400e61c1\nnop                                                                    ; +0xa6, 0x1400e61c6\nmov     cs:qword_14090BFB0, rax                                        ; +0xa7, 0x1400e61c7\nmov     rcx, [rax]                                                     ; +0xae, 0x1400e61ce\nmov     rdx, [rcx+48h]                                                 ; +0xb1, 0x1400e61d1\nmov     rcx, rax                                                       ; +0xb5, 0x1400e61d5\ncall    rdx                                                            ; +0xb8, 0x1400e61d8\nmov     rax, cs:qword_14090BFB0                                        ; +0xba, 0x1400e61da\ncmp     [rax+548h], rbx                                                ; +0xc1, 0x1400e61e1\njnz     short loc_1400E61F1                                            ; +0xc8, 0x1400e61e8\nmov     [rax+548h], r12                                                ; +0xca, 0x1400e61ea\nmov     rcx, [rsi+40h]                                                 ; +0xd1, 0x1400e61f1\ntest    rcx, rcx                                                       ; +0xd5, 0x1400e61f5\njz      short loc_1400E6203                                            ; +0xd8, 0x1400e61f8\ncall    LoadingCircle__fadeAndRemove                                   ; +0xda, 0x1400e61fa\nmov     [rsi+40h], r12                                                 ; +0xdf, 0x1400e61ff\nmov     ebx, r12d                                                      ; +0xe3, 0x1400e6203\ntest    rbp, rbp                                                       ; +0xe6, 0x1400e6206\njz      short loc_1400E6216                                            ; +0xe9, 0x1400e6209\nmov     rcx, rbp                                                       ; +0xeb, 0x1400e620b\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xee, 0x1400e620e\njmp     short loc_1400E6219                                            ; +0xf4, 0x1400e6214\nmov     eax, r12d                                                      ; +0xf6, 0x1400e6216\ncmp     ebx, eax                                                       ; +0xf9, 0x1400e6219\njge     short loc_1400E625B                                            ; +0xfb, 0x1400e621b\nmov     edx, ebx                                                       ; +0xfd, 0x1400e621d\nmov     rcx, rbp                                                       ; +0xff, 0x1400e621f\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x102, 0x1400e6222\ncmp     byte ptr [rsi+0Ch], 0                                          ; +0x108, 0x1400e6228\njz      short loc_1400E6236                                            ; +0x10c, 0x1400e622c\nmov     ecx, [rax+158h]                                                ; +0x10e, 0x1400e622e\njmp     short loc_1400E6242                                            ; +0x114, 0x1400e6234\nmov     ecx, [rax+148h]                                                ; +0x116, 0x1400e6236\nsub     ecx, [rax+14Ch]                                                ; +0x11c, 0x1400e623c\ncmp     ecx, [rsi+8]                                                   ; +0x122, 0x1400e6242\njz      short loc_1400E624B                                            ; +0x125, 0x1400e6245\ninc     ebx                                                            ; +0x127, 0x1400e6247\njmp     short loc_1400E6206                                            ; +0x129, 0x1400e6249\nmov     rdx, rax                                                       ; +0x12b, 0x1400e624b\nmov     rcx, r14                                                       ; +0x12e, 0x1400e624e\ncall    LevelBadgePopup__buildCell                                     ; +0x131, 0x1400e6251\njmp     loc_1400E6326                                                  ; +0x136, 0x1400e6256\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x13b, 0x1400e625b\nmov     r15, [rax+110h]                                                ; +0x141, 0x1400e6261\nlea     rax, [rsp+0A8h+var_70]                                         ; +0x148, 0x1400e6268\nmov     [rsp+0A8h+arg_10], rax                                         ; +0x14d, 0x1400e626d\nxorps   xmm0, xmm0                                                     ; +0x155, 0x1400e6275\nmovups  [rsp+0A8h+var_70], xmm0                                        ; +0x158, 0x1400e6278\nmov     [rsp+0A8h+var_60], r12                                         ; +0x15d, 0x1400e627d\nmov     [rsp+0A8h+var_58], 0Fh                                         ; +0x162, 0x1400e6282\nmov     byte ptr [rsp+0A8h+var_70], 0                                  ; +0x16b, 0x1400e628b\nlea     rax, aListNotFound; \"List not found\"                           ; +0x170, 0x1400e6290\nlea     rdx, aLevelNotFound; \"Level not found\"                         ; +0x177, 0x1400e6297\ncmp     byte ptr [rsi+0Ch], 0                                          ; +0x17e, 0x1400e629e\ncmovnz  rdx, rax                                                       ; +0x182, 0x1400e62a2\nmovups  [rsp+0A8h+var_50], xmm0                                        ; +0x186, 0x1400e62a6\nmov     [rsp+0A8h+var_40], r12                                         ; +0x18b, 0x1400e62ab\nmov     [rsp+0A8h+var_38], r12                                         ; +0x190, 0x1400e62b0\ninc     rdi                                                            ; +0x195, 0x1400e62b5\ncmp     byte ptr [rdx+rdi], 0                                          ; +0x198, 0x1400e62b8\njnz     short loc_1400E62B5                                            ; +0x19c, 0x1400e62bc\nmov     r8, rdi                                                        ; +0x19e, 0x1400e62be\nlea     rcx, [rsp+0A8h+var_50]                                         ; +0x1a1, 0x1400e62c1\ncall    sub_14003D230                                                  ; +0x1a6, 0x1400e62c6\nmov     rbx, [r15]                                                     ; +0x1ab, 0x1400e62cb\nlea     rax, [rsp+0A8h+var_70]                                         ; +0x1ae, 0x1400e62ce\nmov     [rsp+0A8h+var_88], rax                                         ; +0x1b3, 0x1400e62d3\nmov     r9d, 96h                                                       ; +0x1b8, 0x1400e62d8\nmovss   xmm2, cs:dword_140834F64                                       ; +0x1be, 0x1400e62de\nmovss   xmm1, cs:dword_140834F20                                       ; +0x1c6, 0x1400e62e6\nlea     rcx, [rsp+0A8h+var_50]                                         ; +0x1ce, 0x1400e62ee\ncall    TextAlertPopup__create                                         ; +0x1d3, 0x1400e62f3\nmov     rdx, rax                                                       ; +0x1d8, 0x1400e62f8\nmov     r8d, 3E8h                                                      ; +0x1db, 0x1400e62fb\nmov     rcx, r15                                                       ; +0x1e1, 0x1400e6301\ncall    qword ptr [rbx+1C8h]                                           ; +0x1e4, 0x1400e6304\nmov     rax, [r14]                                                     ; +0x1ea, 0x1400e630a\nxor     edx, edx                                                       ; +0x1ed, 0x1400e630d\nmov     rcx, r14                                                       ; +0x1ef, 0x1400e630f\ncall    qword ptr [rax+3E0h]                                           ; +0x1f2, 0x1400e6312\nmov     rax, [r14]                                                     ; +0x1f8, 0x1400e6318\nmov     dl, 1                                                          ; +0x1fb, 0x1400e631b\nmov     rcx, r14                                                       ; +0x1fd, 0x1400e631d\ncall    qword ptr [rax+208h]                                           ; +0x200, 0x1400e6320\nlea     r11, [rsp+0A8h+var_28]                                         ; +0x206, 0x1400e6326\nmov     rbx, [r11+30h]                                                 ; +0x20e, 0x1400e632e\nmov     rbp, [r11+38h]                                                 ; +0x212, 0x1400e6332\nmov     rsp, r11                                                       ; +0x216, 0x1400e6336\npop     r15                                                            ; +0x219, 0x1400e6339\npop     r14                                                            ; +0x21b, 0x1400e633b\npop     r12                                                            ; +0x21d, 0x1400e633d\npop     rdi                                                            ; +0x21f, 0x1400e633f\npop     rsi                                                            ; +0x220, 0x1400e6340\nretn                                                                   ; +0x221, 0x1400e6341", "xrefs": ["<???> @ 0x1407286a0", "<???> @ 0x140914cb4"], "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"}