{"type": "func", "start": 5373074688, "end": 5373075432, "name": "LevelLeaderboard::loadScores", "pseudocode": "// \n// LevelLeaderboard::loadScores from 0x140429d00 to 0x140429fe8 (744 bytes)\n// \n// 3 xrefs:\n// > LevelLeaderboard::init @ 0x1404295bc\n// > LevelLeaderboard::updateUserScoreFinished @ 0x140429ff7\n// > <???> @ 0x140926a68\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:32:12 +0000\n// \n\n// Hidden C++ exception states: #wind=6\nvoid __fastcall LevelLeaderboard::loadScores(__int64 a1)\n{\n  int v2; // ebx\n  cocos2d::CCString *v3; // rax\n  const char *CString; // rax\n  size_t v5; // r8\n  void **v6; // rsi\n  __int64 v7; // rbx\n  cocos2d::CCArray *LocalScores; // rax\n  void **v9; // rbx\n  __int64 v10; // rcx\n  __int64 StoredOnlineLevels; // rax\n  void **v12; // r8\n  __int64 v13; // rcx\n  __int64 v14; // rdx\n  __int64 v15; // rcx\n  void *v16; // rcx\n  void *v17; // [rsp+30h] [rbp-38h]\n  void *v18; // [rsp+30h] [rbp-38h]\n  void *v19; // [rsp+30h] [rbp-38h]\n  void *v20; // [rsp+30h] [rbp-38h]\n  void *Block[2]; // [rsp+38h] [rbp-30h] BYREF\n  __int64 v22; // [rsp+48h] [rbp-20h]\n  unsigned __int64 v23; // [rsp+50h] [rbp-18h]\n\n  v2 = *(_DWORD *)(*(_QWORD *)(a1 + 680) + 328LL) - *(_DWORD *)(*(_QWORD *)(a1 + 680) + 332LL);\n  if ( !*(_QWORD *)&qword_14090BFB0 )\n  {\n    v17 = operator new(0x690u);\n    *(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v17);\n    (*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);\n  }\n  v3 = cocos2d::CCString::createWithFormat(\"ll_%i_%i_%i\", v2, *(_DWORD *)(a1 + 688), *(_DWORD *)(a1 + 692));\n  CString = cocos2d::CCString::getCString(v3);\n  *(_OWORD *)Block = 0;\n  v22 = 0;\n  v23 = 0;\n  v5 = -1;\n  do\n    ++v5;\n  while ( CString[v5] );\n  sub_14003D230(Block, CString, v5);\n  if ( *(_DWORD *)(a1 + 688) == 3 )\n  {\n    v6 = Block;\n    if ( v23 > 0xF )\n      v6 = (void **)Block[0];\n    v7 = *(_QWORD *)(a1 + 664);\n    LocalScores = LevelLeaderboard::getLocalScores(a1);\n    (*(void (__fastcall **)(__int64, cocos2d::CCArray *, void **))(v7 + 16))(a1 + 664, LocalScores, v6);\n  }\n  else\n  {\n    v9 = Block;\n    if ( v23 > 0xF )\n      v9 = (void **)Block[0];\n    v10 = *(_QWORD *)&qword_14090BFB0;\n    if ( !*(_QWORD *)&qword_14090BFB0 )\n    {\n      v18 = operator new(0x690u);\n      *(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v18);\n      (*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);\n      v10 = *(_QWORD *)&qword_14090BFB0;\n    }\n    StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v10, v9);\n    if ( StoredOnlineLevels )\n    {\n      v12 = Block;\n      if ( v23 > 0xF )\n        v12 = (void **)Block[0];\n      (*(void (__fastcall **)(__int64, __int64, void **))(*(_QWORD *)(a1 + 664) + 16LL))(\n        a1 + 664,\n        StoredOnlineLevels,\n        v12);\n    }\n    else\n    {\n      v13 = *(_QWORD *)&qword_14090BFB0;\n      if ( !*(_QWORD *)&qword_14090BFB0 )\n      {\n        v19 = operator new(0x690u);\n        *(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v19);\n        (*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);\n        v13 = *(_QWORD *)&qword_14090BFB0;\n      }\n      GameLevelManager::makeTimeStamp(v13, \"upd_ll\");\n      LOBYTE(v14) = 1;\n      (*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 712) + 336LL))(*(_QWORD *)(a1 + 712), v14);\n      (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 720) + 336LL))(*(_QWORD *)(a1 + 720), 0);\n      LevelLeaderboard::setupLeaderboard(a1, 0);\n      v15 = *(_QWORD *)&qword_14090BFB0;\n      if ( !*(_QWORD *)&qword_14090BFB0 )\n      {\n        v20 = operator new(0x690u);\n        *(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v20);\n        (*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);\n        v15 = *(_QWORD *)&qword_14090BFB0;\n      }\n      *(_QWORD *)(v15 + 1424) = a1 + 664;\n      GameLevelManager::getLevelLeaderboard(v15, *(_QWORD *)(a1 + 680), *(_DWORD *)(a1 + 688), *(_DWORD *)(a1 + 692));\n    }\n  }\n  if ( v23 > 0xF )\n  {\n    v16 = Block[0];\n    if ( v23 + 1 >= 0x1000 )\n    {\n      v16 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v16 - 8) > 0x1F )\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free(v16);\n  }\n}", "assembly": "; \n; LevelLeaderboard::loadScores from 0x140429d00 to 0x140429fe8 (744 bytes)\n; \n; 3 xrefs:\n; > LevelLeaderboard::init @ 0x1404295bc\n; > LevelLeaderboard::updateUserScoreFinished @ 0x140429ff7\n; > <???> @ 0x140926a68\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:32:12 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x140429d00\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x140429d05\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x140429d0a\npush    rdi                                                            ; +0xf, 0x140429d0f\nsub     rsp, 60h                                                       ; +0x10, 0x140429d10\nmov     rax, cs:__security_cookie                                      ; +0x14, 0x140429d14\nxor     rax, rsp                                                       ; +0x1b, 0x140429d1b\nmov     [rsp+68h+var_10], rax                                          ; +0x1e, 0x140429d1e\nmov     rbp, rcx                                                       ; +0x23, 0x140429d23\nmov     rax, [rcx+2A8h]                                                ; +0x26, 0x140429d26\nmov     ebx, [rax+148h]                                                ; +0x2d, 0x140429d2d\nsub     ebx, [rax+14Ch]                                                ; +0x33, 0x140429d33\ncmp     cs:qword_14090BFB0, 0                                          ; +0x39, 0x140429d39\njnz     short loc_140429D6F                                            ; +0x41, 0x140429d41\nmov     ecx, 690h; Size                                                ; +0x43, 0x140429d43\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x48, 0x140429d48\nmov     [rsp+68h+var_38], rax                                          ; +0x4d, 0x140429d4d\nmov     rcx, rax                                                       ; +0x52, 0x140429d52\ncall    GameLevelManager__GameLevelManager                             ; +0x55, 0x140429d55\nnop                                                                    ; +0x5a, 0x140429d5a\nmov     cs:qword_14090BFB0, rax                                        ; +0x5b, 0x140429d5b\nmov     rcx, [rax]                                                     ; +0x62, 0x140429d62\nmov     r8, [rcx+48h]                                                  ; +0x65, 0x140429d65\nmov     rcx, rax                                                       ; +0x69, 0x140429d69\ncall    r8                                                             ; +0x6c, 0x140429d6c\nmov     r9d, [rbp+2B4h]                                                ; +0x6f, 0x140429d6f\nmov     r8d, [rbp+2B0h]                                                ; +0x76, 0x140429d76\nmov     edx, ebx                                                       ; +0x7d, 0x140429d7d\nlea     rcx, aLlIII; \"ll_%i_%i_%i\"                                     ; +0x7f, 0x140429d7f\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x86, 0x140429d86\nmov     rcx, rax                                                       ; +0x8c, 0x140429d8c\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x8f, 0x140429d8f\nxorps   xmm0, xmm0                                                     ; +0x95, 0x140429d95\nmovups  xmmword ptr [rsp+68h+Block], xmm0                              ; +0x98, 0x140429d98\nmov     [rsp+68h+var_20], 0                                            ; +0x9d, 0x140429d9d\nmov     [rsp+68h+var_18], 0                                            ; +0xa6, 0x140429da6\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xaf, 0x140429daf\ninc     r8                                                             ; +0xb6, 0x140429db6\ncmp     byte ptr [rax+r8], 0                                           ; +0xb9, 0x140429db9\njnz     short loc_140429DB6                                            ; +0xbe, 0x140429dbe\nmov     rdx, rax                                                       ; +0xc0, 0x140429dc0\nlea     rcx, [rsp+68h+Block]                                           ; +0xc3, 0x140429dc3\ncall    sub_14003D230                                                  ; +0xc8, 0x140429dc8\nnop                                                                    ; +0xcd, 0x140429dcd\ncmp     dword ptr [rbp+2B0h], 3                                        ; +0xce, 0x140429dce\njnz     short loc_140429E0C                                            ; +0xd5, 0x140429dd5\nlea     rsi, [rsp+68h+Block]                                           ; +0xd7, 0x140429dd7\ncmp     [rsp+68h+var_18], 0Fh                                          ; +0xdc, 0x140429ddc\ncmova   rsi, [rsp+68h+Block]                                           ; +0xe2, 0x140429de2\nmov     rbx, [rbp+298h]                                                ; +0xe8, 0x140429de8\nmov     rcx, rbp                                                       ; +0xef, 0x140429def\ncall    LevelLeaderboard__getLocalScores                               ; +0xf2, 0x140429df2\nmov     rdx, rax                                                       ; +0xf7, 0x140429df7\nmov     r8, rsi                                                        ; +0xfa, 0x140429dfa\nlea     rcx, [rbp+298h]                                                ; +0xfd, 0x140429dfd\ncall    qword ptr [rbx+10h]                                            ; +0x104, 0x140429e04\njmp     loc_140429F72                                                  ; +0x107, 0x140429e07\nlea     rbx, [rsp+68h+Block]                                           ; +0x10c, 0x140429e0c\ncmp     [rsp+68h+var_18], 0Fh                                          ; +0x111, 0x140429e11\ncmova   rbx, [rsp+68h+Block]                                           ; +0x117, 0x140429e17\nmov     rcx, cs:qword_14090BFB0                                        ; +0x11d, 0x140429e1d\ntest    rcx, rcx                                                       ; +0x124, 0x140429e24\njnz     short loc_140429E5C                                            ; +0x127, 0x140429e27\nmov     ecx, 690h; Size                                                ; +0x129, 0x140429e29\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x12e, 0x140429e2e\nmov     [rsp+68h+var_38], rax                                          ; +0x133, 0x140429e33\nmov     rcx, rax                                                       ; +0x138, 0x140429e38\ncall    GameLevelManager__GameLevelManager                             ; +0x13b, 0x140429e3b\nnop                                                                    ; +0x140, 0x140429e40\nmov     cs:qword_14090BFB0, rax                                        ; +0x141, 0x140429e41\nmov     rcx, [rax]                                                     ; +0x148, 0x140429e48\nmov     r8, [rcx+48h]                                                  ; +0x14b, 0x140429e4b\nmov     rcx, rax                                                       ; +0x14f, 0x140429e4f\ncall    r8                                                             ; +0x152, 0x140429e52\nmov     rcx, cs:qword_14090BFB0                                        ; +0x155, 0x140429e55\nmov     rdx, rbx                                                       ; +0x15c, 0x140429e5c\ncall    GameLevelManager__getStoredOnlineLevels                        ; +0x15f, 0x140429e5f\ntest    rax, rax                                                       ; +0x164, 0x140429e64\njz      short loc_140429E93                                            ; +0x167, 0x140429e67\nlea     r8, [rsp+68h+Block]                                            ; +0x169, 0x140429e69\ncmp     [rsp+68h+var_18], 0Fh                                          ; +0x16e, 0x140429e6e\ncmova   r8, [rsp+68h+Block]                                            ; +0x174, 0x140429e74\nlea     rcx, [rbp+298h]                                                ; +0x17a, 0x140429e7a\nmov     rdx, [rcx]                                                     ; +0x181, 0x140429e81\nmov     r9, [rdx+10h]                                                  ; +0x184, 0x140429e84\nmov     rdx, rax                                                       ; +0x188, 0x140429e88\ncall    r9                                                             ; +0x18b, 0x140429e8b\njmp     loc_140429F72                                                  ; +0x18e, 0x140429e8e\nmov     rcx, cs:qword_14090BFB0                                        ; +0x193, 0x140429e93\ntest    rcx, rcx                                                       ; +0x19a, 0x140429e9a\njnz     short loc_140429ED1                                            ; +0x19d, 0x140429e9d\nmov     ecx, 690h; Size                                                ; +0x19f, 0x140429e9f\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1a4, 0x140429ea4\nmov     [rsp+68h+var_38], rax                                          ; +0x1a9, 0x140429ea9\nmov     rcx, rax                                                       ; +0x1ae, 0x140429eae\ncall    GameLevelManager__GameLevelManager                             ; +0x1b1, 0x140429eb1\nnop                                                                    ; +0x1b6, 0x140429eb6\nmov     cs:qword_14090BFB0, rax                                        ; +0x1b7, 0x140429eb7\nmov     rcx, [rax]                                                     ; +0x1be, 0x140429ebe\nmov     rdx, [rcx+48h]                                                 ; +0x1c1, 0x140429ec1\nmov     rcx, rax                                                       ; +0x1c5, 0x140429ec5\ncall    rdx                                                            ; +0x1c8, 0x140429ec8\nmov     rcx, cs:qword_14090BFB0                                        ; +0x1ca, 0x140429eca\nlea     rdx, aUpdLl; \"upd_ll\"                                          ; +0x1d1, 0x140429ed1\ncall    GameLevelManager__makeTimeStamp                                ; +0x1d8, 0x140429ed8\nmov     rcx, [rbp+2C8h]                                                ; +0x1dd, 0x140429edd\nmov     rax, [rcx]                                                     ; +0x1e4, 0x140429ee4\nmov     dl, 1                                                          ; +0x1e7, 0x140429ee7\ncall    qword ptr [rax+150h]                                           ; +0x1e9, 0x140429ee9\nmov     rcx, [rbp+2D0h]                                                ; +0x1ef, 0x140429eef\nmov     rax, [rcx]                                                     ; +0x1f6, 0x140429ef6\nxor     edx, edx                                                       ; +0x1f9, 0x140429ef9\ncall    qword ptr [rax+150h]                                           ; +0x1fb, 0x140429efb\nxor     edx, edx                                                       ; +0x201, 0x140429f01\nmov     rcx, rbp                                                       ; +0x203, 0x140429f03\ncall    LevelLeaderboard__setupLeaderboard                             ; +0x206, 0x140429f06\nlea     rbx, [rbp+298h]                                                ; +0x20b, 0x140429f0b\nmov     rcx, cs:qword_14090BFB0                                        ; +0x212, 0x140429f12\ntest    rcx, rcx                                                       ; +0x219, 0x140429f19\njnz     short loc_140429F50                                            ; +0x21c, 0x140429f1c\nmov     ecx, 690h; Size                                                ; +0x21e, 0x140429f1e\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x223, 0x140429f23\nmov     [rsp+68h+var_38], rax                                          ; +0x228, 0x140429f28\nmov     rcx, rax                                                       ; +0x22d, 0x140429f2d\ncall    GameLevelManager__GameLevelManager                             ; +0x230, 0x140429f30\nnop                                                                    ; +0x235, 0x140429f35\nmov     cs:qword_14090BFB0, rax                                        ; +0x236, 0x140429f36\nmov     rcx, [rax]                                                     ; +0x23d, 0x140429f3d\nmov     rdx, [rcx+48h]                                                 ; +0x240, 0x140429f40\nmov     rcx, rax                                                       ; +0x244, 0x140429f44\ncall    rdx                                                            ; +0x247, 0x140429f47\nmov     rcx, cs:qword_14090BFB0                                        ; +0x249, 0x140429f49\nmov     [rcx+590h], rbx                                                ; +0x250, 0x140429f50\nmov     r9d, [rbp+2B4h]                                                ; +0x257, 0x140429f57\nmov     r8d, [rbp+2B0h]                                                ; +0x25e, 0x140429f5e\nmov     rdx, [rbp+2A8h]                                                ; +0x265, 0x140429f65\ncall    GameLevelManager__getLevelLeaderboard                          ; +0x26c, 0x140429f6c\nnop                                                                    ; +0x271, 0x140429f71\nmov     rdx, [rsp+68h+var_18]                                          ; +0x272, 0x140429f72\ncmp     rdx, 0Fh                                                       ; +0x277, 0x140429f77\njbe     short loc_140429FC5                                            ; +0x27b, 0x140429f7b\ninc     rdx                                                            ; +0x27d, 0x140429f7d\nmov     rcx, [rsp+68h+Block]; Block                                    ; +0x280, 0x140429f80\nmov     rax, rcx                                                       ; +0x285, 0x140429f85\ncmp     rdx, 1000h                                                     ; +0x288, 0x140429f88\njb      short loc_140429FC0                                            ; +0x28f, 0x140429f8f\nadd     rdx, 27h ; '''                                                 ; +0x291, 0x140429f91\nmov     rcx, [rcx-8]                                                   ; +0x295, 0x140429f95\nsub     rax, rcx                                                       ; +0x299, 0x140429f99\nsub     rax, 8                                                         ; +0x29c, 0x140429f9c\ncmp     rax, 1Fh                                                       ; +0x2a0, 0x140429fa0\njbe     short loc_140429FC0                                            ; +0x2a4, 0x140429fa4\nmov     [rsp+68h+Reserved], 0; Reserved                                ; +0x2a6, 0x140429fa6\nxor     r9d, r9d; LineNo                                               ; +0x2af, 0x140429faf\nxor     r8d, r8d; FileName                                             ; +0x2b2, 0x140429fb2\nxor     edx, edx; FunctionName                                         ; +0x2b5, 0x140429fb5\nxor     ecx, ecx; Expression                                           ; +0x2b7, 0x140429fb7\ncall    cs:_invoke_watson                                              ; +0x2b9, 0x140429fb9\nalign 20h                                                              ; +0x2bf, 0x140429fbf\ncall    j_j_free                                                       ; +0x2c0, 0x140429fc0\nmov     rcx, [rsp+68h+var_10]                                          ; +0x2c5, 0x140429fc5\nxor     rcx, rsp; StackCookie                                          ; +0x2ca, 0x140429fca\ncall    __security_check_cookie                                        ; +0x2cd, 0x140429fcd\nlea     r11, [rsp+68h+var_8]                                           ; +0x2d2, 0x140429fd2\nmov     rbx, [r11+18h]                                                 ; +0x2d7, 0x140429fd7\nmov     rbp, [r11+20h]                                                 ; +0x2db, 0x140429fdb\nmov     rsi, [r11+28h]                                                 ; +0x2df, 0x140429fdf\nmov     rsp, r11                                                       ; +0x2e3, 0x140429fe3\npop     rdi                                                            ; +0x2e6, 0x140429fe6\nretn                                                                   ; +0x2e7, 0x140429fe7", "xrefs": ["LevelLeaderboard::init @ 0x1404295bc", "LevelLeaderboard::updateUserScoreFinished @ 0x140429ff7", "<???> @ 0x140926a68"], "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"}