{"type": "func", "start": 5370073760, "end": 5370074280, "name": "GameLevelManager::onUploadLevelCompleted", "pseudocode": "// \n// GameLevelManager::onUploadLevelCompleted from 0x14014d2a0 to 0x14014d4a8 (520 bytes)\n// \n// 3 xrefs:\n// > GameLevelManager::handleIt @ 0x14014307b\n// > <???> @ 0x1406ca7a0\n// > <???> @ 0x1406ca7ac\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=3\nvoid __fastcall GameLevelManager::onUploadLevelCompleted(__int64 a1, const void **a2, _QWORD *a3)\n{\n  _BYTE *v6; // rbx\n  size_t v7; // r8\n  void *v8; // rcx\n  int v9; // r15d\n  const void *v10; // rcx\n  unsigned __int64 v11; // r14\n  unsigned __int64 v12; // rbx\n  size_t v13; // r8\n  GameLevelManager *v14; // rcx\n  __int64 *v15; // rbx\n  __int64 v16; // rbx\n  GJGameLevel *LocalLevel; // rax\n  const char *v18; // rcx\n  int v19; // r14d\n  GameLevelManager *v20; // rcx\n  GJGameLevel *v21; // rax\n  GJGameLevel *v22; // rbx\n  float v23; // xmm0_4\n  void (__fastcall ***v24)(_QWORD, GJGameLevel *); // rcx\n  void *Block[2]; // [rsp+30h] [rbp-58h] BYREF\n  __int128 v26; // [rsp+40h] [rbp-48h]\n\n  v6 = a3;\n  if ( a3[3] > 0xFu )\n    v6 = (_BYTE *)*a3;\n  *(_OWORD *)Block = 0;\n  v26 = 0;\n  v7 = -1;\n  do\n    ++v7;\n  while ( v6[v7] );\n  sub_14003A930(Block, v6, v7);\n  cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(a1 + 592), Block);\n  if ( *((_QWORD *)&v26 + 1) > 0xFu )\n  {\n    v8 = Block[0];\n    if ( (unsigned __int64)(*((_QWORD *)&v26 + 1) + 1LL) >= 0x1000 )\n    {\n      v8 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v8);\n  }\n  v9 = atoi(v6);\n  *(_OWORD *)Block = 0;\n  *(_QWORD *)&v26 = 2;\n  *((_QWORD *)&v26 + 1) = 15;\n  strcpy((char *)Block, \"-1\");\n  v10 = a2;\n  v11 = (unsigned __int64)a2[3];\n  if ( v11 > 0xF )\n    v10 = *a2;\n  v12 = (unsigned __int64)a2[2];\n  v13 = v12;\n  if ( v12 > 2 )\n    v13 = 2;\n  if ( !memcmp(v10, Block, v13) && v12 == 2 )\n  {\n    v15 = *(__int64 **)(a1 + 752);\n    if ( v15 )\n    {\n      v16 = *v15;\n      LocalLevel = GameLevelManager::getLocalLevel(v14, v9);\n      (*(void (__fastcall **)(_QWORD, GJGameLevel *))(v16 + 8))(*(_QWORD *)(a1 + 752), LocalLevel);\n    }\n  }\n  else\n  {\n    v18 = (const char *)a2;\n    if ( v11 > 0xF )\n      v18 = (const char *)*a2;\n    v19 = atoi(v18);\n    v21 = GameLevelManager::getLocalLevel(v20, v9);\n    v22 = v21;\n    if ( v21 )\n    {\n      v21->m_levelID.value = v19;\n      v23 = (float)((float)rand() / 32767.0) * 1000.0;\n      v22->m_levelID.seed = (int)v23;\n      v22->m_levelID.random = (int)v23 + v19;\n      v22->m_isUploaded = 1;\n    }\n    v24 = *(void (__fastcall ****)(_QWORD, GJGameLevel *))(a1 + 752);\n    if ( v24 )\n      (**v24)(v24, v22);\n  }\n  sub_14003A830((__int64)a2);\n  sub_14003A830((__int64)a3);\n}", "assembly": "; \n; GameLevelManager::onUploadLevelCompleted from 0x14014d2a0 to 0x14014d4a8 (520 bytes)\n; \n; 3 xrefs:\n; > GameLevelManager::handleIt @ 0x14014307b\n; > <???> @ 0x1406ca7a0\n; > <???> @ 0x1406ca7ac\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+arg_18], rbx                                              ; +0x0, 0x14014d2a0\npush    rbp                                                            ; +0x5, 0x14014d2a5\npush    rsi                                                            ; +0x6, 0x14014d2a6\npush    rdi                                                            ; +0x7, 0x14014d2a7\npush    r14                                                            ; +0x8, 0x14014d2a8\npush    r15                                                            ; +0xa, 0x14014d2aa\nsub     rsp, 60h                                                       ; +0xc, 0x14014d2ac\nmov     rax, cs:__security_cookie                                      ; +0x10, 0x14014d2b0\nxor     rax, rsp                                                       ; +0x17, 0x14014d2b7\nmov     [rsp+88h+var_38], rax                                          ; +0x1a, 0x14014d2ba\nmov     rsi, r8                                                        ; +0x1f, 0x14014d2bf\nmov     rdi, rdx                                                       ; +0x22, 0x14014d2c2\nmov     rbp, rcx                                                       ; +0x25, 0x14014d2c5\nmov     [rsp+88h+var_68], rdx                                          ; +0x28, 0x14014d2c8\nmov     [rsp+88h+var_60], r8                                           ; +0x2d, 0x14014d2cd\nmov     rbx, r8                                                        ; +0x32, 0x14014d2d2\ncmp     qword ptr [r8+18h], 0Fh                                        ; +0x35, 0x14014d2d5\njbe     short loc_14014D2DF                                            ; +0x3a, 0x14014d2da\nmov     rbx, [r8]                                                      ; +0x3c, 0x14014d2dc\nxorps   xmm0, xmm0                                                     ; +0x3f, 0x14014d2df\nmovups  xmmword ptr [rsp+88h+Block], xmm0                              ; +0x42, 0x14014d2e2\nxorps   xmm1, xmm1                                                     ; +0x47, 0x14014d2e7\nmovdqu  [rsp+88h+var_48], xmm1                                         ; +0x4a, 0x14014d2ea\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x50, 0x14014d2f0\nnop     word ptr [rax+rax+00000000h]                                   ; +0x57, 0x14014d2f7\ninc     r8                                                             ; +0x60, 0x14014d300\ncmp     byte ptr [rbx+r8], 0                                           ; +0x63, 0x14014d303\njnz     short loc_14014D300                                            ; +0x68, 0x14014d308\nmov     rdx, rbx                                                       ; +0x6a, 0x14014d30a\nlea     rcx, [rsp+88h+Block]                                           ; +0x6d, 0x14014d30d\ncall    sub_14003A930                                                  ; +0x72, 0x14014d312\nnop                                                                    ; +0x77, 0x14014d317\nlea     rdx, [rsp+88h+Block]                                           ; +0x78, 0x14014d318\nmov     rcx, [rbp+250h]                                                ; +0x7d, 0x14014d31d\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 &) ; +0x84, 0x14014d324\nnop                                                                    ; +0x8a, 0x14014d32a\nmov     rdx, qword ptr [rsp+88h+var_48+8]                              ; +0x8b, 0x14014d32b\ncmp     rdx, 0Fh                                                       ; +0x90, 0x14014d330\njbe     short loc_14014D36B                                            ; +0x94, 0x14014d334\ninc     rdx                                                            ; +0x96, 0x14014d336\nmov     rcx, [rsp+88h+Block]; Block                                    ; +0x99, 0x14014d339\nmov     rax, rcx                                                       ; +0x9e, 0x14014d33e\ncmp     rdx, 1000h                                                     ; +0xa1, 0x14014d341\njb      short loc_14014D366                                            ; +0xa8, 0x14014d348\nadd     rdx, 27h ; '''                                                 ; +0xaa, 0x14014d34a\nmov     rcx, [rcx-8]                                                   ; +0xae, 0x14014d34e\nsub     rax, rcx                                                       ; +0xb2, 0x14014d352\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xb5, 0x14014d355\ncmp     rax, 1Fh                                                       ; +0xb9, 0x14014d359\njbe     short loc_14014D366                                            ; +0xbd, 0x14014d35d\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xbf, 0x14014d35f\nalign 2                                                                ; +0xc5, 0x14014d365\ncall    j_j_free                                                       ; +0xc6, 0x14014d366\nmov     rcx, rbx; String                                               ; +0xcb, 0x14014d36b\ncall    cs:atoi                                                        ; +0xce, 0x14014d36e\nmov     r15d, eax                                                      ; +0xd4, 0x14014d374\nxorps   xmm0, xmm0                                                     ; +0xd7, 0x14014d377\nmovups  xmmword ptr [rsp+88h+Block], xmm0                              ; +0xda, 0x14014d37a\nmov     edx, 2                                                         ; +0xdf, 0x14014d37f\nmov     qword ptr [rsp+88h+var_48], rdx                                ; +0xe4, 0x14014d384\nmov     qword ptr [rsp+88h+var_48+8], 0Fh                              ; +0xe9, 0x14014d389\nmov     eax, 312Dh                                                     ; +0xf2, 0x14014d392\nmov     word ptr [rsp+88h+Block], ax                                   ; +0xf7, 0x14014d397\nmov     byte ptr [rsp+88h+Block+2], 0                                  ; +0xfc, 0x14014d39c\nmov     rcx, rdi                                                       ; +0x101, 0x14014d3a1\nmov     r14, [rdi+18h]                                                 ; +0x104, 0x14014d3a4\ncmp     r14, 0Fh                                                       ; +0x108, 0x14014d3a8\njbe     short loc_14014D3B1                                            ; +0x10c, 0x14014d3ac\nmov     rcx, [rdi]; Buf1                                               ; +0x10e, 0x14014d3ae\nmov     rbx, [rdi+10h]                                                 ; +0x111, 0x14014d3b1\nmov     r8, rbx                                                        ; +0x115, 0x14014d3b5\ncmp     rbx, rdx                                                       ; +0x118, 0x14014d3b8\ncmova   r8, rdx; Size                                                  ; +0x11b, 0x14014d3bb\nlea     rdx, [rsp+88h+Block]; Buf2                                     ; +0x11f, 0x14014d3bf\ncall    memcmp                                                         ; +0x124, 0x14014d3c4\ntest    eax, eax                                                       ; +0x129, 0x14014d3c9\njnz     short loc_14014D3FD                                            ; +0x12b, 0x14014d3cb\ncmp     rbx, 2                                                         ; +0x12d, 0x14014d3cd\njnz     short loc_14014D3FD                                            ; +0x131, 0x14014d3d1\nmov     rbx, [rbp+2F0h]                                                ; +0x133, 0x14014d3d3\ntest    rbx, rbx                                                       ; +0x13a, 0x14014d3da\njz      loc_14014D476                                                  ; +0x13d, 0x14014d3dd\nmov     rbx, [rbx]                                                     ; +0x143, 0x14014d3e3\nmov     edx, r15d                                                      ; +0x146, 0x14014d3e6\ncall    GameLevelManager__getLocalLevel                                ; +0x149, 0x14014d3e9\nmov     rdx, rax                                                       ; +0x14e, 0x14014d3ee\nmov     rcx, [rbp+2F0h]                                                ; +0x151, 0x14014d3f1\ncall    qword ptr [rbx+8]                                              ; +0x158, 0x14014d3f8\njmp     short loc_14014D476                                            ; +0x15b, 0x14014d3fb\nmov     rcx, rdi                                                       ; +0x15d, 0x14014d3fd\ncmp     r14, 0Fh                                                       ; +0x160, 0x14014d400\njbe     short loc_14014D409                                            ; +0x164, 0x14014d404\nmov     rcx, [rdi]; String                                             ; +0x166, 0x14014d406\ncall    cs:atoi                                                        ; +0x169, 0x14014d409\nmov     r14d, eax                                                      ; +0x16f, 0x14014d40f\nmov     edx, r15d                                                      ; +0x172, 0x14014d412\ncall    GameLevelManager__getLocalLevel                                ; +0x175, 0x14014d415\nmov     rbx, rax                                                       ; +0x17a, 0x14014d41a\ntest    rax, rax                                                       ; +0x17d, 0x14014d41d\njz      short loc_14014D461                                            ; +0x180, 0x14014d420\nmov     [rax+150h], r14d                                               ; +0x182, 0x14014d422\ncall    cs:rand                                                        ; +0x189, 0x14014d429\nmovd    xmm0, eax                                                      ; +0x18f, 0x14014d42f\ncvtdq2ps xmm0, xmm0                                                    ; +0x193, 0x14014d433\ndivss   xmm0, cs:dword_140623644                                       ; +0x196, 0x14014d436\nmulss   xmm0, cs:dword_14062350C                                       ; +0x19e, 0x14014d43e\ncvttss2si ecx, xmm0                                                    ; +0x1a6, 0x14014d446\nmov     [rbx+14Ch], ecx                                                ; +0x1aa, 0x14014d44a\nlea     eax, [rcx+r14]                                                 ; +0x1b0, 0x14014d450\nmov     [rbx+148h], eax                                                ; +0x1b4, 0x14014d454\nmov     byte ptr [rbx+2E5h], 1                                         ; +0x1ba, 0x14014d45a\nmov     rcx, [rbp+2F0h]                                                ; +0x1c1, 0x14014d461\ntest    rcx, rcx                                                       ; +0x1c8, 0x14014d468\njz      short loc_14014D476                                            ; +0x1cb, 0x14014d46b\nmov     rax, [rcx]                                                     ; +0x1cd, 0x14014d46d\nmov     rdx, rbx                                                       ; +0x1d0, 0x14014d470\ncall    qword ptr [rax]                                                ; +0x1d3, 0x14014d473\nnop                                                                    ; +0x1d5, 0x14014d475\nmov     rcx, rdi                                                       ; +0x1d6, 0x14014d476\ncall    sub_14003A830                                                  ; +0x1d9, 0x14014d479\nnop                                                                    ; +0x1de, 0x14014d47e\nmov     rcx, rsi                                                       ; +0x1df, 0x14014d47f\ncall    sub_14003A830                                                  ; +0x1e2, 0x14014d482\nmov     rcx, [rsp+88h+var_38]                                          ; +0x1e7, 0x14014d487\nxor     rcx, rsp; StackCookie                                          ; +0x1ec, 0x14014d48c\ncall    __security_check_cookie                                        ; +0x1ef, 0x14014d48f\nmov     rbx, [rsp+88h+arg_18]                                          ; +0x1f4, 0x14014d494\nadd     rsp, 60h                                                       ; +0x1fc, 0x14014d49c\npop     r15                                                            ; +0x200, 0x14014d4a0\npop     r14                                                            ; +0x202, 0x14014d4a2\npop     rdi                                                            ; +0x204, 0x14014d4a4\npop     rsi                                                            ; +0x205, 0x14014d4a5\npop     rbp                                                            ; +0x206, 0x14014d4a6\nretn                                                                   ; +0x207, 0x14014d4a7", "xrefs": ["GameLevelManager::handleIt @ 0x14014307b", "<???> @ 0x1406ca7a0", "<???> @ 0x1406ca7ac"], "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"}