{"type": "func", "start": 5371040896, "end": 5371041584, "name": "GameLevelManager::onGetLevelLeaderboardCompleted", "pseudocode": "// \n// GameLevelManager::onGetLevelLeaderboardCompleted from 0x140239480 to 0x140239730 (688 bytes)\n// \n// 3 xrefs:\n// > GameLevelManager::handleIt @ 0x14021a583\n// > <???> @ 0x14091c01c\n// > <???> @ 0x14091c028\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:28:34 +0000\n// \n\n// Hidden C++ exception states: #wind=4\nvoid __fastcall GameLevelManager::onGetLevelLeaderboardCompleted(_QWORD *a1, const char *a2, _QWORD *a3)\n{\n  _BYTE *v6; // r12\n  int v7; // esi\n  int v8; // r13d\n  __int64 *v9; // rax\n  char *v10; // rsi\n  char *v11; // rbx\n  const char *v12; // rcx\n  const char *v13; // rcx\n  const char *v14; // rcx\n  char *v15; // rax\n  const char *v16; // rcx\n  int v17; // ebx\n  __int64 v18; // rax\n  __int64 v19; // rcx\n  _QWORD *v20; // rax\n  __int64 Scores; // rbx\n  __int64 v22; // rcx\n  int v23; // [rsp+30h] [rbp-49h]\n  __int64 *v24; // [rsp+38h] [rbp-41h]\n  void *Block[2]; // [rsp+40h] [rbp-39h] BYREF\n  __int64 v26; // [rsp+50h] [rbp-29h]\n  __int64 v27; // [rsp+58h] [rbp-21h]\n  _BYTE v28[32]; // [rsp+60h] [rbp-19h] BYREF\n  const char *v29; // [rsp+80h] [rbp+7h]\n  _QWORD *v30; // [rsp+88h] [rbp+Fh]\n\n  v29 = a2;\n  v30 = a3;\n  v6 = a3;\n  if ( a3[3] > 0xFu )\n    v6 = (_BYTE *)*a3;\n  GameLevelManager::removeDLFromActive((__int64)a1, v6);\n  v7 = 0;\n  v23 = 0;\n  v8 = 0;\n  v9 = (__int64 *)sub_14003F4F0((__int64)v28, (__int64)a3);\n  v24 = v9;\n  if ( v9[2] )\n  {\n    *(_OWORD *)Block = 0;\n    v26 = 0;\n    sub_1401C5360(v9, \"_\", (__int64 *)Block);\n    v10 = (char *)Block[1];\n    v11 = (char *)Block[0];\n    if ( (((char *)Block[1] - (char *)Block[0]) & 0xFFFFFFFFFFFFFFE0uLL) == 0x80 )\n    {\n      v12 = (char *)Block[0] + 32;\n      if ( *((_QWORD *)Block[0] + 7) > 0xFu )\n        v12 = *(const char **)v12;\n      atoi(v12);\n      v13 = (char *)Block[0] + 64;\n      if ( *((_QWORD *)Block[0] + 11) > 0xFu )\n        v13 = *(const char **)v13;\n      v23 = atoi(v13);\n      v14 = (char *)Block[0] + 96;\n      if ( *((_QWORD *)Block[0] + 15) > 0xFu )\n        v14 = *(const char **)v14;\n      v8 = atoi(v14);\n      v10 = (char *)Block[1];\n      v11 = (char *)Block[0];\n    }\n    if ( v11 )\n    {\n      if ( v11 != v10 )\n      {\n        do\n        {\n          sub_14003D310((__int64)v11);\n          v11 += 32;\n        }\n        while ( v11 != v10 );\n        v11 = (char *)Block[0];\n      }\n      v15 = v11;\n      if ( ((v26 - (_QWORD)v11) & 0xFFFFFFFFFFFFFFE0uLL) >= 0x1000 )\n      {\n        v11 = *((char **)v11 - 1);\n        if ( (unsigned __int64)(v15 - v11 - 8) > 0x1F )\n          invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n      }\n      j_j_free(v11);\n      *(_OWORD *)Block = 0;\n      v26 = 0;\n    }\n    v9 = v24;\n    v7 = v23;\n  }\n  sub_14003D310((__int64)v9);\n  v16 = a2;\n  if ( *((_QWORD *)a2 + 3) > 0xFu )\n    v16 = *(const char **)a2;\n  v17 = atoi(v16);\n  if ( v7 == 4 )\n  {\n    v18 = cocos2d::CCDictionary::objectForKey(a1[158], a3);\n    if ( v18 && v17 >= 0 )\n    {\n      if ( v8 )\n      {\n        if ( v8 == 1 )\n          *(_BYTE *)(v18 + 1585) = 0;\n      }\n      else\n      {\n        *(_BYTE *)(v18 + 1584) = 0;\n      }\n    }\n    cocos2d::CCDictionary::removeObjectForKey(a1[158], a3);\n  }\n  else if ( v17 >= 0 )\n  {\n    v20 = (_QWORD *)sub_14003F4F0((__int64)v28, (__int64)a2);\n    Scores = GameLevelManager::createAndGetScores(a1, v20, 3);\n    *(_OWORD *)Block = 0;\n    v26 = 1;\n    v27 = 15;\n    LOWORD(Block[0]) = 32;\n    GameLevelManager::storeSearchResult((__int64)a1, Scores, Block, v6);\n    v22 = a1[178];\n    if ( v22 )\n      (*(void (__fastcall **)(__int64, __int64, _BYTE *))(*(_QWORD *)v22 + 16LL))(v22, Scores, v6);\n  }\n  else\n  {\n    v19 = a1[178];\n    if ( v19 )\n      (*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v19 + 24LL))(v19, v6);\n  }\n  sub_14003D310((__int64)a2);\n  sub_14003D310((__int64)a3);\n}", "assembly": "; \n; GameLevelManager::onGetLevelLeaderboardCompleted from 0x140239480 to 0x140239730 (688 bytes)\n; \n; 3 xrefs:\n; > GameLevelManager::handleIt @ 0x14021a583\n; > <???> @ 0x14091c01c\n; > <???> @ 0x14091c028\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:28:34 +0000\n; \nmov     [rsp-8+arg_18], rbx                                            ; +0x0, 0x140239480\npush    rbp                                                            ; +0x5, 0x140239485\npush    rsi                                                            ; +0x6, 0x140239486\npush    rdi                                                            ; +0x7, 0x140239487\npush    r12                                                            ; +0x8, 0x140239488\npush    r13                                                            ; +0xa, 0x14023948a\npush    r14                                                            ; +0xc, 0x14023948c\npush    r15                                                            ; +0xe, 0x14023948e\nlea     rbp, [rsp-27h]                                                 ; +0x10, 0x140239490\nsub     rsp, 0A0h                                                      ; +0x15, 0x140239495\nmov     rax, cs:__security_cookie                                      ; +0x1c, 0x14023949c\nxor     rax, rsp                                                       ; +0x23, 0x1402394a3\nmov     [rbp+57h+var_40], rax                                          ; +0x26, 0x1402394a6\nmov     rdi, r8                                                        ; +0x2a, 0x1402394aa\nmov     r14, rdx                                                       ; +0x2d, 0x1402394ad\nmov     r15, rcx                                                       ; +0x30, 0x1402394b0\nmov     [rbp+57h+var_50], rdx                                          ; +0x33, 0x1402394b3\nmov     [rbp+57h+var_48], r8                                           ; +0x37, 0x1402394b7\nmov     r12, r8                                                        ; +0x3b, 0x1402394bb\ncmp     qword ptr [r8+18h], 0Fh                                        ; +0x3e, 0x1402394be\njbe     short loc_1402394C8                                            ; +0x43, 0x1402394c3\nmov     r12, [r8]                                                      ; +0x45, 0x1402394c5\nmov     rdx, r12                                                       ; +0x48, 0x1402394c8\ncall    GameLevelManager__removeDLFromActive                           ; +0x4b, 0x1402394cb\nxor     esi, esi                                                       ; +0x50, 0x1402394d0\nmov     [rbp+57h+var_A0], esi                                          ; +0x52, 0x1402394d2\nxor     r13d, r13d                                                     ; +0x55, 0x1402394d5\nmov     rdx, rdi                                                       ; +0x58, 0x1402394d8\nlea     rcx, [rbp+57h+var_70]                                          ; +0x5b, 0x1402394db\ncall    sub_14003F4F0                                                  ; +0x5f, 0x1402394df\nmov     [rbp+57h+var_98], rax                                          ; +0x64, 0x1402394e4\ncmp     [rax+10h], r13                                                 ; +0x68, 0x1402394e8\njnz     short loc_1402394F3                                            ; +0x6c, 0x1402394ec\njmp     loc_14023960A                                                  ; +0x6e, 0x1402394ee\nxorps   xmm0, xmm0                                                     ; +0x73, 0x1402394f3\nmovdqu  xmmword ptr [rbp+57h+Block], xmm0                              ; +0x76, 0x1402394f6\nmov     [rbp+57h+var_80], 0                                            ; +0x7b, 0x1402394fb\nlea     r8, [rbp+57h+Block]                                            ; +0x83, 0x140239503\nlea     rdx, asc_14071413C; \"_\"                                        ; +0x87, 0x140239507\nmov     rcx, rax                                                       ; +0x8e, 0x14023950e\ncall    sub_1401C5360                                                  ; +0x91, 0x140239511\nmov     rsi, [rbp+57h+Block+8]                                         ; +0x96, 0x140239516\nmov     rax, rsi                                                       ; +0x9a, 0x14023951a\nmov     rbx, [rbp+57h+Block]                                           ; +0x9d, 0x14023951d\nsub     rax, rbx                                                       ; +0xa1, 0x140239521\nand     rax, 0FFFFFFFFFFFFFFE0h                                        ; +0xa4, 0x140239524\ncmp     rax, 80h                                                       ; +0xa8, 0x140239528\njnz     short loc_140239582                                            ; +0xae, 0x14023952e\nlea     rcx, [rbx+20h]                                                 ; +0xb0, 0x140239530\ncmp     qword ptr [rcx+18h], 0Fh                                       ; +0xb4, 0x140239534\njbe     short loc_14023953E                                            ; +0xb9, 0x140239539\nmov     rcx, [rcx]; String                                             ; +0xbb, 0x14023953b\ncall    cs:atoi                                                        ; +0xbe, 0x14023953e\nmov     rcx, [rbp+57h+Block]                                           ; +0xc4, 0x140239544\nadd     rcx, 40h ; '@'                                                 ; +0xc8, 0x140239548\ncmp     qword ptr [rcx+18h], 0Fh                                       ; +0xcc, 0x14023954c\njbe     short loc_140239556                                            ; +0xd1, 0x140239551\nmov     rcx, [rcx]; String                                             ; +0xd3, 0x140239553\ncall    cs:atoi                                                        ; +0xd6, 0x140239556\nmov     [rbp+57h+var_A0], eax                                          ; +0xdc, 0x14023955c\nmov     rcx, [rbp+57h+Block]                                           ; +0xdf, 0x14023955f\nadd     rcx, 60h ; '`'                                                 ; +0xe3, 0x140239563\ncmp     qword ptr [rcx+18h], 0Fh                                       ; +0xe7, 0x140239567\njbe     short loc_140239571                                            ; +0xec, 0x14023956c\nmov     rcx, [rcx]; String                                             ; +0xee, 0x14023956e\ncall    cs:atoi                                                        ; +0xf1, 0x140239571\nmov     r13d, eax                                                      ; +0xf7, 0x140239577\nmov     rsi, [rbp+57h+Block+8]                                         ; +0xfa, 0x14023957a\nmov     rbx, [rbp+57h+Block]                                           ; +0xfe, 0x14023957e\ntest    rbx, rbx                                                       ; +0x102, 0x140239582\njz      short loc_140239603                                            ; +0x105, 0x140239585\ncmp     rbx, rsi                                                       ; +0x107, 0x140239587\njz      short loc_1402395A5                                            ; +0x10a, 0x14023958a\nnop     dword ptr [rax+00h]                                            ; +0x10c, 0x14023958c\nmov     rcx, rbx                                                       ; +0x110, 0x140239590\ncall    sub_14003D310                                                  ; +0x113, 0x140239593\nadd     rbx, 20h ; ' '                                                 ; +0x118, 0x140239598\ncmp     rbx, rsi                                                       ; +0x11c, 0x14023959c\njnz     short loc_140239590                                            ; +0x11f, 0x14023959f\nmov     rbx, [rbp+57h+Block]                                           ; +0x121, 0x1402395a1\nmov     rdx, [rbp+57h+var_80]                                          ; +0x125, 0x1402395a5\nsub     rdx, rbx                                                       ; +0x129, 0x1402395a9\nand     rdx, 0FFFFFFFFFFFFFFE0h                                        ; +0x12c, 0x1402395ac\nmov     rax, rbx                                                       ; +0x130, 0x1402395b0\ncmp     rdx, 1000h                                                     ; +0x133, 0x1402395b3\njb      short loc_1402395EB                                            ; +0x13a, 0x1402395ba\nadd     rdx, 27h ; '''                                                 ; +0x13c, 0x1402395bc\nmov     rbx, [rbx-8]                                                   ; +0x140, 0x1402395c0\nsub     rax, rbx                                                       ; +0x144, 0x1402395c4\nsub     rax, 8                                                         ; +0x147, 0x1402395c7\ncmp     rax, 1Fh                                                       ; +0x14b, 0x1402395cb\njbe     short loc_1402395EB                                            ; +0x14f, 0x1402395cf\nmov     [rsp+0D0h+Reserved], 0; Reserved                               ; +0x151, 0x1402395d1\nxor     r9d, r9d; LineNo                                               ; +0x15a, 0x1402395da\nxor     r8d, r8d; FileName                                             ; +0x15d, 0x1402395dd\nxor     edx, edx; FunctionName                                         ; +0x160, 0x1402395e0\nxor     ecx, ecx; Expression                                           ; +0x162, 0x1402395e2\ncall    cs:_invoke_watson                                              ; +0x164, 0x1402395e4\ndb 0CCh                                                                ; +0x16a, 0x1402395ea\nmov     rcx, rbx; Block                                                ; +0x16b, 0x1402395eb\ncall    j_j_free                                                       ; +0x16e, 0x1402395ee\nxorps   xmm0, xmm0                                                     ; +0x173, 0x1402395f3\nmovdqu  xmmword ptr [rbp+57h+Block], xmm0                              ; +0x176, 0x1402395f6\nmov     [rbp+57h+var_80], 0                                            ; +0x17b, 0x1402395fb\nmov     rax, [rbp+57h+var_98]                                          ; +0x183, 0x140239603\nmov     esi, [rbp+57h+var_A0]                                          ; +0x187, 0x140239607\nmov     rcx, rax                                                       ; +0x18a, 0x14023960a\ncall    sub_14003D310                                                  ; +0x18d, 0x14023960d\nmov     rcx, r14                                                       ; +0x192, 0x140239612\ncmp     qword ptr [r14+18h], 0Fh                                       ; +0x195, 0x140239615\njbe     short loc_14023961F                                            ; +0x19a, 0x14023961a\nmov     rcx, [r14]; String                                             ; +0x19c, 0x14023961c\ncall    cs:atoi                                                        ; +0x19f, 0x14023961f\nmov     ebx, eax                                                       ; +0x1a5, 0x140239625\ncmp     esi, 4                                                         ; +0x1a7, 0x140239627\njnz     short loc_140239675                                            ; +0x1aa, 0x14023962a\nmov     rdx, rdi                                                       ; +0x1ac, 0x14023962c\nmov     rcx, [r15+4F0h]                                                ; +0x1af, 0x14023962f\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0x1b6, 0x140239636\ntest    rax, rax                                                       ; +0x1bc, 0x14023963c\njz      short loc_140239660                                            ; +0x1bf, 0x14023963f\ntest    ebx, ebx                                                       ; +0x1c1, 0x140239641\njs      short loc_140239660                                            ; +0x1c3, 0x140239643\ntest    r13d, r13d                                                     ; +0x1c5, 0x140239645\njnz     short loc_140239653                                            ; +0x1c8, 0x140239648\nmov     [rax+630h], r13b                                               ; +0x1ca, 0x14023964a\njmp     short loc_140239660                                            ; +0x1d1, 0x140239651\ncmp     r13d, 1                                                        ; +0x1d3, 0x140239653\njnz     short loc_140239660                                            ; +0x1d7, 0x140239657\nmov     byte ptr [rax+631h], 0                                         ; +0x1d9, 0x140239659\nmov     rdx, rdi                                                       ; +0x1e0, 0x140239660\nmov     rcx, [r15+4F0h]                                                ; +0x1e3, 0x140239663\ncall    cs:?removeObjectForKey@CCDictionary@cocos2d@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::removeObjectForKey(std::string const &) ; +0x1ea, 0x14023966a\njmp     loc_1402396F8                                                  ; +0x1f0, 0x140239670\ntest    ebx, ebx                                                       ; +0x1f5, 0x140239675\njns     short loc_140239690                                            ; +0x1f7, 0x140239677\nmov     rcx, [r15+590h]                                                ; +0x1f9, 0x140239679\ntest    rcx, rcx                                                       ; +0x200, 0x140239680\njz      short loc_1402396F8                                            ; +0x203, 0x140239683\nmov     rax, [rcx]                                                     ; +0x205, 0x140239685\nmov     rdx, r12                                                       ; +0x208, 0x140239688\ncall    qword ptr [rax+18h]                                            ; +0x20b, 0x14023968b\njmp     short loc_1402396F8                                            ; +0x20e, 0x14023968e\nmov     rdx, r14                                                       ; +0x210, 0x140239690\nlea     rcx, [rbp+57h+var_70]                                          ; +0x213, 0x140239693\ncall    sub_14003F4F0                                                  ; +0x217, 0x140239697\nmov     r8d, 3                                                         ; +0x21c, 0x14023969c\nmov     rdx, rax                                                       ; +0x222, 0x1402396a2\nmov     rcx, r15                                                       ; +0x225, 0x1402396a5\ncall    GameLevelManager__createAndGetScores                           ; +0x228, 0x1402396a8\nmov     rbx, rax                                                       ; +0x22d, 0x1402396ad\nxorps   xmm0, xmm0                                                     ; +0x230, 0x1402396b0\nmovups  xmmword ptr [rbp+57h+Block], xmm0                              ; +0x233, 0x1402396b3\nmov     [rbp+57h+var_80], 1                                            ; +0x237, 0x1402396b7\nmov     [rbp+57h+var_78], 0Fh                                          ; +0x23f, 0x1402396bf\nmov     word ptr [rbp+57h+Block], 20h ; ' '                            ; +0x247, 0x1402396c7\nmov     r9, r12                                                        ; +0x24d, 0x1402396cd\nlea     r8, [rbp+57h+Block]                                            ; +0x250, 0x1402396d0\nmov     rdx, rax                                                       ; +0x254, 0x1402396d4\nmov     rcx, r15                                                       ; +0x257, 0x1402396d7\ncall    GameLevelManager__storeSearchResult                            ; +0x25a, 0x1402396da\nmov     rcx, [r15+590h]                                                ; +0x25f, 0x1402396df\ntest    rcx, rcx                                                       ; +0x266, 0x1402396e6\njz      short loc_1402396F8                                            ; +0x269, 0x1402396e9\nmov     rax, [rcx]                                                     ; +0x26b, 0x1402396eb\nmov     r8, r12                                                        ; +0x26e, 0x1402396ee\nmov     rdx, rbx                                                       ; +0x271, 0x1402396f1\ncall    qword ptr [rax+10h]                                            ; +0x274, 0x1402396f4\nnop                                                                    ; +0x277, 0x1402396f7\nmov     rcx, r14                                                       ; +0x278, 0x1402396f8\ncall    sub_14003D310                                                  ; +0x27b, 0x1402396fb\nnop                                                                    ; +0x280, 0x140239700\nmov     rcx, rdi                                                       ; +0x281, 0x140239701\ncall    sub_14003D310                                                  ; +0x284, 0x140239704\nmov     rcx, [rbp+57h+var_40]                                          ; +0x289, 0x140239709\nxor     rcx, rsp; StackCookie                                          ; +0x28d, 0x14023970d\ncall    __security_check_cookie                                        ; +0x290, 0x140239710\nmov     rbx, [rsp+0D0h+arg_18]                                         ; +0x295, 0x140239715\nadd     rsp, 0A0h                                                      ; +0x29d, 0x14023971d\npop     r15                                                            ; +0x2a4, 0x140239724\npop     r14                                                            ; +0x2a6, 0x140239726\npop     r13                                                            ; +0x2a8, 0x140239728\npop     r12                                                            ; +0x2aa, 0x14023972a\npop     rdi                                                            ; +0x2ac, 0x14023972c\npop     rsi                                                            ; +0x2ad, 0x14023972d\npop     rbp                                                            ; +0x2ae, 0x14023972e\nretn                                                                   ; +0x2af, 0x14023972f", "xrefs": ["GameLevelManager::handleIt @ 0x14021a583", "<???> @ 0x14091c01c", "<???> @ 0x14091c028"], "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"}