{"type": "func", "start": 5370115664, "end": 5370116465, "name": "GameLevelManager::onUpdateUserScoreCompleted", "pseudocode": "// \n// GameLevelManager::onUpdateUserScoreCompleted from 0x140157650 to 0x140157971 (801 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::handleIt @ 0x14014334b\n// > <???> @ 0x1406ca968\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\n// Hidden C++ exception states: #wind=6\nvoid __fastcall GameLevelManager::onUpdateUserScoreCompleted(\n        char *a1,\n        const wchar_t *a2,\n        __int64 a3,\n        struct __crt_locale_pointers *a4)\n{\n  void *v7; // rcx\n  const wchar_t *v8; // rcx\n  unsigned __int64 v9; // r14\n  size_t v10; // r8\n  int v11; // edi\n  __int64 v12; // rcx\n  const wchar_t *v13; // rcx\n  unsigned __int64 v14; // r14\n  size_t v15; // r8\n  int v16; // edi\n  GameLevelManager *v17; // rcx\n  const char *v18; // rcx\n  int v19; // esi\n  _DWORD *v20; // rdi\n  float v21; // xmm0_4\n  __int64 v22; // rax\n  void (__fastcall ***v23)(_QWORD); // rcx\n  __int64 v24; // rcx\n  void *v25; // [rsp+20h] [rbp-60h]\n  void *v26; // [rsp+20h] [rbp-60h]\n  void *v27; // [rsp+20h] [rbp-60h]\n  __int128 Buf2; // [rsp+38h] [rbp-48h] BYREF\n  __int64 v29; // [rsp+48h] [rbp-38h]\n  __int64 v30; // [rsp+50h] [rbp-30h]\n  void *Block[2]; // [rsp+58h] [rbp-28h] BYREF\n  __int64 v32; // [rsp+68h] [rbp-18h]\n  unsigned __int64 v33; // [rsp+70h] [rbp-10h]\n\n  v32 = 10;\n  v33 = 15;\n  Block[0] = *(void **)\"user_score\";\n  Block[1] = (void *)*(unsigned __int16 *)\"re\";\n  BYTE2(Block[1]) = 0;\n  cocos2d::CCDictionary::removeObjectForKey(*((_QWORD *)a1 + 73), Block);\n  if ( v33 > 0xF )\n  {\n    v7 = Block[0];\n    if ( v33 + 1 >= 0x1000 )\n    {\n      v7 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v7);\n  }\n  v32 = 0;\n  v33 = 15;\n  LOBYTE(Block[0]) = 0;\n  Buf2 = 0;\n  v29 = 2;\n  v30 = 15;\n  strcpy((char *)&Buf2, \"-1\");\n  v8 = a2;\n  if ( *((_QWORD *)a2 + 3) > 0xFu )\n    v8 = *(const wchar_t **)a2;\n  v9 = *((_QWORD *)a2 + 2);\n  v10 = v9;\n  if ( v9 > 2 )\n    v10 = 2;\n  v11 = memcmp(v8, &Buf2, v10);\n  if ( !v11 )\n  {\n    if ( v9 >= 2 )\n      v11 = v9 > 2;\n    else\n      v11 = -1;\n  }\n  if ( v11 )\n  {\n    Buf2 = 0;\n    v29 = 2;\n    v30 = 15;\n    strcpy((char *)&Buf2, \"-9\");\n    v13 = a2;\n    if ( *((_QWORD *)a2 + 3) > 0xFu )\n      v13 = *(const wchar_t **)a2;\n    v14 = *((_QWORD *)a2 + 2);\n    v15 = v14;\n    if ( v14 > 2 )\n      v15 = 2;\n    v16 = memcmp(v13, &Buf2, v15);\n    if ( !v16 )\n    {\n      if ( v14 >= 2 )\n        v16 = v14 > 2;\n      else\n        v16 = -1;\n    }\n    if ( v16 )\n    {\n      v18 = (const char *)a2;\n      if ( *((_QWORD *)a2 + 3) > 0xFu )\n        v18 = *(const char **)a2;\n      v19 = atoi(v18);\n      v20 = (_DWORD *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v26 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00(v26);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v20 = (_DWORD *)qword_1406C2ED8;\n      }\n      v20[165] = v19;\n      v21 = (float)((float)rand() / 32767.0) * 1000.0;\n      v20[164] = (int)v21;\n      v20[163] = v19 + (int)v21;\n    }\n    else\n    {\n      v17 = (GameLevelManager *)qword_1406C2EC0;\n      if ( !qword_1406C2EC0 )\n      {\n        v25 = operator new(0x3D0u);\n        qword_1406C2EC0 = sub_140141280((__int64)v25);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n        v17 = (GameLevelManager *)qword_1406C2EC0;\n      }\n      GameLevelManager::submitUserInfo(v17);\n    }\n    v22 = qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v27 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00(v27);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v22 = qword_1406C2ED8;\n    }\n    *(_BYTE *)(v22 + 648) = 1;\n    v23 = *((void (__fastcall ****)(_QWORD))a1 + 97);\n    if ( v23 )\n      (**v23)(v23);\n    v24 = *((_QWORD *)a1 + 92);\n    if ( v24 )\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)v24 + 16LL))(v24);\n  }\n  else\n  {\n    v12 = *((_QWORD *)a1 + 97);\n    if ( v12 )\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)v12 + 8LL))(v12);\n  }\n  sub_14003A830((__int64)a2);\n  sub_14003A830(a3);\n}", "assembly": "; \n; GameLevelManager::onUpdateUserScoreCompleted from 0x140157650 to 0x140157971 (801 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::handleIt @ 0x14014334b\n; > <???> @ 0x1406ca968\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-38h+arg_18], rbx                                          ; +0x0, 0x140157650\npush    rbp                                                            ; +0x5, 0x140157655\npush    rsi                                                            ; +0x6, 0x140157656\npush    rdi                                                            ; +0x7, 0x140157657\npush    r12                                                            ; +0x8, 0x140157658\npush    r13                                                            ; +0xa, 0x14015765a\npush    r14                                                            ; +0xc, 0x14015765c\npush    r15                                                            ; +0xe, 0x14015765e\nmov     rbp, rsp                                                       ; +0x10, 0x140157660\nsub     rsp, 80h                                                       ; +0x13, 0x140157663\nmov     rax, cs:__security_cookie                                      ; +0x1a, 0x14015766a\nxor     rax, rsp                                                       ; +0x21, 0x140157671\nmov     [rbp+var_8], rax                                               ; +0x24, 0x140157674\nmov     r13, r8                                                        ; +0x28, 0x140157678\nmov     rbx, rdx                                                       ; +0x2b, 0x14015767b\nmov     r15, rcx                                                       ; +0x2e, 0x14015767e\nmov     [rbp+var_58], rdx                                              ; +0x31, 0x140157681\nmov     [rbp+var_50], r8                                               ; +0x35, 0x140157685\nxorps   xmm0, xmm0                                                     ; +0x39, 0x140157689\nmovups  xmmword ptr [rbp+Block], xmm0                                  ; +0x3c, 0x14015768c\nmov     [rbp+var_18], 0Ah                                              ; +0x40, 0x140157690\nmov     edi, 0Fh                                                       ; +0x48, 0x140157698\nmov     [rbp+var_10], rdi                                              ; +0x4d, 0x14015769d\nmovsd   xmm0, qword ptr cs:aUserScore                                  ; +0x51, 0x1401576a1\nmovsd   [rbp+Block], xmm0                                              ; +0x59, 0x1401576a9\nmovzx   eax, word ptr cs:aUserScore+8                                  ; +0x5e, 0x1401576ae\nmov     word ptr [rbp+Block+8], ax                                     ; +0x65, 0x1401576b5\nmov     byte ptr [rbp+Block+0Ah], 0                                    ; +0x69, 0x1401576b9\nlea     rdx, [rbp+Block]                                               ; +0x6d, 0x1401576bd\nmov     rcx, [rcx+248h]                                                ; +0x71, 0x1401576c1\ncall    cs:?removeObjectForKey@CCDictionary@cocos2d@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z ; +0x78, 0x1401576c8\nnop                                                                    ; +0x7e, 0x1401576ce\nmov     rdx, [rbp+var_10]                                              ; +0x7f, 0x1401576cf\ncmp     rdx, rdi                                                       ; +0x83, 0x1401576d3\njbe     short loc_14015770C                                            ; +0x86, 0x1401576d6\ninc     rdx                                                            ; +0x88, 0x1401576d8\nmov     rcx, [rbp+Block]; Block                                        ; +0x8b, 0x1401576db\nmov     rax, rcx                                                       ; +0x8f, 0x1401576df\ncmp     rdx, 1000h                                                     ; +0x92, 0x1401576e2\njb      short loc_140157707                                            ; +0x99, 0x1401576e9\nadd     rdx, 27h ; '''                                                 ; +0x9b, 0x1401576eb\nmov     rcx, [rcx-8]                                                   ; +0x9f, 0x1401576ef\nsub     rax, rcx                                                       ; +0xa3, 0x1401576f3\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xa6, 0x1401576f6\ncmp     rax, 1Fh                                                       ; +0xaa, 0x1401576fa\njbe     short loc_140157707                                            ; +0xae, 0x1401576fe\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xb0, 0x140157700\ndb 0CCh                                                                ; +0xb6, 0x140157706\ncall    j_j_free                                                       ; +0xb7, 0x140157707\nmov     [rbp+var_18], 0                                                ; +0xbc, 0x14015770c\nmov     [rbp+var_10], rdi                                              ; +0xc4, 0x140157714\nmov     byte ptr [rbp+Block], 0                                        ; +0xc8, 0x140157718\nxorps   xmm0, xmm0                                                     ; +0xcc, 0x14015771c\nmovups  [rbp+Buf2], xmm0                                               ; +0xcf, 0x14015771f\nmov     r9d, 2                                                         ; +0xd3, 0x140157723\nmov     [rbp+var_38], r9                                               ; +0xd9, 0x140157729\nmov     [rbp+var_30], rdi                                              ; +0xdd, 0x14015772d\nmovzx   eax, cs:word_1405334A0                                         ; +0xe1, 0x140157731\nmov     word ptr [rbp+Buf2], ax                                        ; +0xe8, 0x140157738\nmov     byte ptr [rbp+Buf2+2], 0                                       ; +0xec, 0x14015773c\nlea     rdx, [rbp+Buf2]; Buf2                                          ; +0xf0, 0x140157740\nmov     rcx, rbx                                                       ; +0xf4, 0x140157744\ncmp     qword ptr [rbx+18h], 0Fh                                       ; +0xf7, 0x140157747\njbe     short loc_140157751                                            ; +0xfc, 0x14015774c\nmov     rcx, [rbx]; Buf1                                               ; +0xfe, 0x14015774e\nmov     r14, [rbx+10h]                                                 ; +0x101, 0x140157751\nmov     r8, r14                                                        ; +0x105, 0x140157755\ncmp     r9, r14                                                        ; +0x108, 0x140157758\ncmovb   r8, r9; Size                                                   ; +0x10b, 0x14015775b\ncall    memcmp                                                         ; +0x10f, 0x14015775f\nmov     edi, eax                                                       ; +0x114, 0x140157764\ntest    eax, eax                                                       ; +0x116, 0x140157766\njnz     short loc_14015777F                                            ; +0x118, 0x140157768\ncmp     r14, 2                                                         ; +0x11a, 0x14015776a\njnb     short loc_140157775                                            ; +0x11e, 0x14015776e\nlea     edi, [rax-1]                                                   ; +0x120, 0x140157770\njmp     short loc_14015777F                                            ; +0x123, 0x140157773\nxor     edi, edi                                                       ; +0x125, 0x140157775\ncmp     r14, 2                                                         ; +0x127, 0x140157777\nsetnbe  dil                                                            ; +0x12b, 0x14015777b\nmov     r14d, 0Fh                                                      ; +0x12f, 0x14015777f\ntest    edi, edi                                                       ; +0x135, 0x140157785\njnz     short loc_1401577A4                                            ; +0x137, 0x140157787\nmov     rcx, [r15+308h]                                                ; +0x139, 0x140157789\ntest    rcx, rcx                                                       ; +0x140, 0x140157790\njz      loc_140157939                                                  ; +0x143, 0x140157793\nmov     rax, [rcx]                                                     ; +0x149, 0x140157799\ncall    qword ptr [rax+8]                                              ; +0x14c, 0x14015779c\njmp     loc_140157939                                                  ; +0x14f, 0x14015779f\nxorps   xmm0, xmm0                                                     ; +0x154, 0x1401577a4\nmovups  [rbp+Buf2], xmm0                                               ; +0x157, 0x1401577a7\nmov     r12d, 2                                                        ; +0x15b, 0x1401577ab\nmov     [rbp+var_38], r12                                              ; +0x161, 0x1401577b1\nmov     [rbp+var_30], r14                                              ; +0x165, 0x1401577b5\nmovzx   eax, cs:word_1405593EC                                         ; +0x169, 0x1401577b9\nmov     word ptr [rbp+Buf2], ax                                        ; +0x170, 0x1401577c0\nmov     byte ptr [rbp+Buf2+2], 0                                       ; +0x174, 0x1401577c4\nlea     rdx, [rbp+Buf2]; Buf2                                          ; +0x178, 0x1401577c8\nmov     rcx, rbx                                                       ; +0x17c, 0x1401577cc\ncmp     [rbx+18h], r14                                                 ; +0x17f, 0x1401577cf\njbe     short loc_1401577D8                                            ; +0x183, 0x1401577d3\nmov     rcx, [rbx]; Buf1                                               ; +0x185, 0x1401577d5\nmov     r14, [rbx+10h]                                                 ; +0x188, 0x1401577d8\nmov     r8, r14                                                        ; +0x18c, 0x1401577dc\ncmp     r12, r14                                                       ; +0x18f, 0x1401577df\ncmovb   r8, r12; Size                                                  ; +0x192, 0x1401577e2\ncall    memcmp                                                         ; +0x196, 0x1401577e6\nmov     edi, eax                                                       ; +0x19b, 0x1401577eb\ntest    eax, eax                                                       ; +0x19d, 0x1401577ed\njnz     short loc_140157804                                            ; +0x19f, 0x1401577ef\ncmp     r14, r12                                                       ; +0x1a1, 0x1401577f1\njnb     short loc_1401577FB                                            ; +0x1a4, 0x1401577f4\nlea     edi, [rax-1]                                                   ; +0x1a6, 0x1401577f6\njmp     short loc_140157804                                            ; +0x1a9, 0x1401577f9\nxor     edi, edi                                                       ; +0x1ab, 0x1401577fb\ncmp     r14, r12                                                       ; +0x1ad, 0x1401577fd\nsetnbe  dil                                                            ; +0x1b0, 0x140157800\nmov     edx, 0Fh                                                       ; +0x1b4, 0x140157804\ntest    edi, edi                                                       ; +0x1b9, 0x140157809\njnz     short loc_140157851                                            ; +0x1bb, 0x14015780b\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x1bd, 0x14015780d\ntest    rcx, rcx                                                       ; +0x1c4, 0x140157814\njnz     short loc_140157847                                            ; +0x1c7, 0x140157817\nmov     ecx, 3D0h; Size                                                ; +0x1c9, 0x140157819\ncall    ??2@YAPEAX_K@Z                                                 ; +0x1ce, 0x14015781e\nmov     [rbp+var_60], rax                                              ; +0x1d3, 0x140157823\nmov     rcx, rax                                                       ; +0x1d7, 0x140157827\ncall    sub_140141280                                                  ; +0x1da, 0x14015782a\nnop                                                                    ; +0x1df, 0x14015782f\nmov     cs:qword_1406C2EC0, rax                                        ; +0x1e0, 0x140157830\nmov     rdx, [rax]                                                     ; +0x1e7, 0x140157837\nmov     rcx, rax                                                       ; +0x1ea, 0x14015783a\ncall    qword ptr [rdx+48h]                                            ; +0x1ed, 0x14015783d\nmov     rcx, cs:qword_1406C2EC0                                        ; +0x1f0, 0x140157840\ncall    GameLevelManager__submitUserInfo                               ; +0x1f7, 0x140157847\njmp     loc_1401578D4                                                  ; +0x1fc, 0x14015784c\nmov     rcx, rbx                                                       ; +0x201, 0x140157851\ncmp     [rbx+18h], rdx                                                 ; +0x204, 0x140157854\njbe     short loc_14015785D                                            ; +0x208, 0x140157858\nmov     rcx, [rbx]; String                                             ; +0x20a, 0x14015785a\ncall    cs:atoi                                                        ; +0x20d, 0x14015785d\nmov     esi, eax                                                       ; +0x213, 0x140157863\nmov     rdi, cs:qword_1406C2ED8                                        ; +0x215, 0x140157865\ntest    rdi, rdi                                                       ; +0x21c, 0x14015786c\njnz     short loc_14015789F                                            ; +0x21f, 0x14015786f\nmov     ecx, 668h; Size                                                ; +0x221, 0x140157871\ncall    ??2@YAPEAX_K@Z                                                 ; +0x226, 0x140157876\nmov     [rbp+var_60], rax                                              ; +0x22b, 0x14015787b\nmov     rcx, rax                                                       ; +0x22f, 0x14015787f\ncall    sub_14017AB00                                                  ; +0x232, 0x140157882\nnop                                                                    ; +0x237, 0x140157887\nmov     cs:qword_1406C2ED8, rax                                        ; +0x238, 0x140157888\nmov     rdx, [rax]                                                     ; +0x23f, 0x14015788f\nmov     rcx, rax                                                       ; +0x242, 0x140157892\ncall    qword ptr [rdx+48h]                                            ; +0x245, 0x140157895\nmov     rdi, cs:qword_1406C2ED8                                        ; +0x248, 0x140157898\nmov     [rdi+294h], esi                                                ; +0x24f, 0x14015789f\ncall    cs:rand                                                        ; +0x255, 0x1401578a5\nmovd    xmm0, eax                                                      ; +0x25b, 0x1401578ab\ncvtdq2ps xmm0, xmm0                                                    ; +0x25f, 0x1401578af\ndivss   xmm0, cs:dword_140623644                                       ; +0x262, 0x1401578b2\nmulss   xmm0, cs:dword_14062350C                                       ; +0x26a, 0x1401578ba\ncvttss2si eax, xmm0                                                    ; +0x272, 0x1401578c2\nmov     [rdi+290h], eax                                                ; +0x276, 0x1401578c6\nadd     eax, esi                                                       ; +0x27c, 0x1401578cc\nmov     [rdi+28Ch], eax                                                ; +0x27e, 0x1401578ce\nmov     rax, cs:qword_1406C2ED8                                        ; +0x284, 0x1401578d4\ntest    rax, rax                                                       ; +0x28b, 0x1401578db\njnz     short loc_14015790E                                            ; +0x28e, 0x1401578de\nmov     ecx, 668h; Size                                                ; +0x290, 0x1401578e0\ncall    ??2@YAPEAX_K@Z                                                 ; +0x295, 0x1401578e5\nmov     [rbp+var_60], rax                                              ; +0x29a, 0x1401578ea\nmov     rcx, rax                                                       ; +0x29e, 0x1401578ee\ncall    sub_14017AB00                                                  ; +0x2a1, 0x1401578f1\nnop                                                                    ; +0x2a6, 0x1401578f6\nmov     cs:qword_1406C2ED8, rax                                        ; +0x2a7, 0x1401578f7\nmov     rdx, [rax]                                                     ; +0x2ae, 0x1401578fe\nmov     rcx, rax                                                       ; +0x2b1, 0x140157901\ncall    qword ptr [rdx+48h]                                            ; +0x2b4, 0x140157904\nmov     rax, cs:qword_1406C2ED8                                        ; +0x2b7, 0x140157907\nmov     byte ptr [rax+288h], 1                                         ; +0x2be, 0x14015790e\nmov     rcx, [r15+308h]                                                ; +0x2c5, 0x140157915\ntest    rcx, rcx                                                       ; +0x2cc, 0x14015791c\njz      short loc_140157926                                            ; +0x2cf, 0x14015791f\nmov     rax, [rcx]                                                     ; +0x2d1, 0x140157921\ncall    qword ptr [rax]                                                ; +0x2d4, 0x140157924\nmov     rcx, [r15+2E0h]                                                ; +0x2d6, 0x140157926\ntest    rcx, rcx                                                       ; +0x2dd, 0x14015792d\njz      short loc_140157939                                            ; +0x2e0, 0x140157930\nmov     rax, [rcx]                                                     ; +0x2e2, 0x140157932\ncall    qword ptr [rax+10h]                                            ; +0x2e5, 0x140157935\nnop                                                                    ; +0x2e8, 0x140157938\nmov     rcx, rbx                                                       ; +0x2e9, 0x140157939\ncall    sub_14003A830                                                  ; +0x2ec, 0x14015793c\nnop                                                                    ; +0x2f1, 0x140157941\nmov     rcx, r13                                                       ; +0x2f2, 0x140157942\ncall    sub_14003A830                                                  ; +0x2f5, 0x140157945\nmov     rcx, [rbp+var_8]                                               ; +0x2fa, 0x14015794a\nxor     rcx, rsp; StackCookie                                          ; +0x2fe, 0x14015794e\ncall    __security_check_cookie                                        ; +0x301, 0x140157951\nmov     rbx, [rsp+80h+arg_18]                                          ; +0x306, 0x140157956\nadd     rsp, 80h                                                       ; +0x30e, 0x14015795e\npop     r15                                                            ; +0x315, 0x140157965\npop     r14                                                            ; +0x317, 0x140157967\npop     r13                                                            ; +0x319, 0x140157969\npop     r12                                                            ; +0x31b, 0x14015796b\npop     rdi                                                            ; +0x31d, 0x14015796d\npop     rsi                                                            ; +0x31e, 0x14015796e\npop     rbp                                                            ; +0x31f, 0x14015796f\nretn                                                                   ; +0x320, 0x140157970", "xrefs": ["GameLevelManager::handleIt @ 0x14014334b", "<???> @ 0x1406ca968"], "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"}