{"type": "func", "start": 5370190656, "end": 5370191414, "name": "GameLevelManager::onRestoreItemsCompleted", "pseudocode": "// \n// GameLevelManager::onRestoreItemsCompleted from 0x140169b40 to 0x140169e36 (758 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::handleIt @ 0x1401434e8\n// > <???> @ 0x1406cad1c\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=5\nvoid __fastcall GameLevelManager::onRestoreItemsCompleted(__int64 a1, const void **a2, __int64 a3)\n{\n  void *v5; // rcx\n  const void *v6; // rcx\n  unsigned __int64 v7; // rbx\n  size_t v8; // r8\n  __int64 v9; // rax\n  FLAlertLayer *v10; // rbx\n  __int64 v11; // rax\n  __int64 v12; // rax\n  FLAlertLayer *v13; // rbx\n  _BYTE v14[32]; // [rsp+60h] [rbp-19h] BYREF\n  const void **v15; // [rsp+80h] [rbp+7h]\n  __int64 v16; // [rsp+88h] [rbp+Fh]\n  void *Block[2]; // [rsp+90h] [rbp+17h] BYREF\n  __int64 v18; // [rsp+A0h] [rbp+27h]\n  unsigned __int64 v19; // [rsp+A8h] [rbp+2Fh]\n\n  v15 = a2;\n  v16 = a3;\n  Block[1] = (void *)31077;\n  v18 = 10;\n  v19 = 15;\n  Block[0] = (void *)0x4B65726F74736572LL;\n  cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(a1 + 584), Block);\n  if ( v19 > 0xF )\n  {\n    v5 = Block[0];\n    if ( v19 + 1 >= 0x1000 )\n    {\n      v5 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v5);\n  }\n  *(_OWORD *)Block = 0;\n  v18 = 2;\n  v19 = 15;\n  strcpy((char *)Block, \"-1\");\n  v6 = a2;\n  if ( (unsigned __int64)a2[3] > 0xF )\n    v6 = *a2;\n  v7 = (unsigned __int64)a2[2];\n  v8 = v7;\n  if ( v7 > 2 )\n    v8 = 2;\n  if ( !memcmp(v6, Block, v8) && v7 == 2 )\n  {\n    *(_OWORD *)Block = 0;\n    v18 = 0;\n    v19 = 15;\n    Block[0] = sub_14003AA10(0x20u);\n    v18 = 22;\n    v19 = 31;\n    strcpy((char *)Block[0], \"No restore data found.\");\n    v12 = sub_14003BDB0((__int64)v14, (__int64)Block);\n    v13 = FLAlertLayer::create(0, (int)\"Error\", v12, (__int64)\"OK\", 0, 1133903872, 0, 0, 1065353216);\n    sub_14003A830((__int64)Block);\n    v13->show(v13);\n  }\n  else\n  {\n    *(_OWORD *)Block = 0;\n    v18 = 0;\n    v19 = 15;\n    Block[0] = sub_14003AA10(0x20u);\n    v18 = 28;\n    v19 = 31;\n    strcpy((char *)Block[0], \"Your data has been restored.\");\n    v9 = sub_14003BDB0((__int64)v14, (__int64)Block);\n    v10 = FLAlertLayer::create(0, (int)\"Data restored\", v9, (__int64)\"OK\", 0, 1133903872, 0, 0, 1065353216);\n    sub_14003A830((__int64)Block);\n    v10->show(v10);\n    v11 = sub_14003BDB0((__int64)v14, (__int64)a2);\n    sub_14003A830(v11);\n  }\n  sub_14003A830((__int64)a2);\n  sub_14003A830(a3);\n}", "assembly": "; \n; GameLevelManager::onRestoreItemsCompleted from 0x140169b40 to 0x140169e36 (758 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::handleIt @ 0x1401434e8\n; > <???> @ 0x1406cad1c\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-8+arg_18], rbx                                            ; +0x0, 0x140169b40\npush    rbp                                                            ; +0x5, 0x140169b45\npush    rsi                                                            ; +0x6, 0x140169b46\npush    rdi                                                            ; +0x7, 0x140169b47\nlea     rbp, [rsp-47h]                                                 ; +0x8, 0x140169b48\nsub     rsp, 0C0h                                                      ; +0xd, 0x140169b4d\nmov     rax, cs:__security_cookie                                      ; +0x14, 0x140169b54\nxor     rax, rsp                                                       ; +0x1b, 0x140169b5b\nmov     [rbp+57h+var_20], rax                                          ; +0x1e, 0x140169b5e\nmov     rsi, r8                                                        ; +0x22, 0x140169b62\nmov     rdi, rdx                                                       ; +0x25, 0x140169b65\nmov     [rbp+57h+var_50], rdx                                          ; +0x28, 0x140169b68\nmov     [rbp+57h+var_48], r8                                           ; +0x2c, 0x140169b6c\nxorps   xmm0, xmm0                                                     ; +0x30, 0x140169b70\nmovups  xmmword ptr [rbp+57h+Block], xmm0                              ; +0x33, 0x140169b73\nmov     [rbp+57h+var_30], 0Ah                                          ; +0x37, 0x140169b77\nmov     [rbp+57h+var_28], 0Fh                                          ; +0x3f, 0x140169b7f\nmovsd   xmm0, cs:qword_14055A410                                       ; +0x47, 0x140169b87\nmovsd   [rbp+57h+Block], xmm0                                          ; +0x4f, 0x140169b8f\nmovzx   eax, cs:word_14055A418                                         ; +0x54, 0x140169b94\nmov     word ptr [rbp+57h+Block+8], ax                                 ; +0x5b, 0x140169b9b\nmov     byte ptr [rbp+57h+Block+0Ah], 0                                ; +0x5f, 0x140169b9f\nlea     rdx, [rbp+57h+Block]                                           ; +0x63, 0x140169ba3\nmov     rcx, [rcx+248h]                                                ; +0x67, 0x140169ba7\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 &) ; +0x6e, 0x140169bae\nnop                                                                    ; +0x74, 0x140169bb4\nmov     rdx, [rbp+57h+var_28]                                          ; +0x75, 0x140169bb5\ncmp     rdx, 0Fh                                                       ; +0x79, 0x140169bb9\njbe     short loc_140169BF3                                            ; +0x7d, 0x140169bbd\ninc     rdx                                                            ; +0x7f, 0x140169bbf\nmov     rcx, [rbp+57h+Block]; Block                                    ; +0x82, 0x140169bc2\nmov     rax, rcx                                                       ; +0x86, 0x140169bc6\ncmp     rdx, 1000h                                                     ; +0x89, 0x140169bc9\njb      short loc_140169BEE                                            ; +0x90, 0x140169bd0\nadd     rdx, 27h ; '''                                                 ; +0x92, 0x140169bd2\nmov     rcx, [rcx-8]                                                   ; +0x96, 0x140169bd6\nsub     rax, rcx                                                       ; +0x9a, 0x140169bda\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x9d, 0x140169bdd\ncmp     rax, 1Fh                                                       ; +0xa1, 0x140169be1\njbe     short loc_140169BEE                                            ; +0xa5, 0x140169be5\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xa7, 0x140169be7\nalign 2                                                                ; +0xad, 0x140169bed\ncall    j_j_free                                                       ; +0xae, 0x140169bee\nxorps   xmm0, xmm0                                                     ; +0xb3, 0x140169bf3\nmovups  xmmword ptr [rbp+57h+Block], xmm0                              ; +0xb6, 0x140169bf6\nmov     edx, 2                                                         ; +0xba, 0x140169bfa\nmov     [rbp+57h+var_30], rdx                                          ; +0xbf, 0x140169bff\nmov     [rbp+57h+var_28], 0Fh                                          ; +0xc3, 0x140169c03\nmov     eax, 312Dh                                                     ; +0xcb, 0x140169c0b\nmov     word ptr [rbp+57h+Block], ax                                   ; +0xd0, 0x140169c10\nmov     byte ptr [rbp+57h+Block+2], 0                                  ; +0xd4, 0x140169c14\nmov     rcx, rdi                                                       ; +0xd8, 0x140169c18\ncmp     qword ptr [rdi+18h], 0Fh                                       ; +0xdb, 0x140169c1b\njbe     short loc_140169C25                                            ; +0xe0, 0x140169c20\nmov     rcx, [rdi]; Buf1                                               ; +0xe2, 0x140169c22\nmov     rbx, [rdi+10h]                                                 ; +0xe5, 0x140169c25\nmov     r8, rbx                                                        ; +0xe9, 0x140169c29\ncmp     rbx, rdx                                                       ; +0xec, 0x140169c2c\ncmova   r8, rdx; Size                                                  ; +0xef, 0x140169c2f\nlea     rdx, [rbp+57h+Block]; Buf2                                     ; +0xf3, 0x140169c33\ncall    memcmp                                                         ; +0xf7, 0x140169c37\ntest    eax, eax                                                       ; +0xfc, 0x140169c3c\njnz     short loc_140169C60                                            ; +0xfe, 0x140169c3e\ncmp     rbx, 2                                                         ; +0x100, 0x140169c40\njnb     short loc_140169C4D                                            ; +0x104, 0x140169c44\nmov     eax, 0FFFFFFFFh                                                ; +0x106, 0x140169c46\njmp     short loc_140169C58                                            ; +0x10b, 0x140169c4b\njbe     loc_140169D40                                                  ; +0x10d, 0x140169c4d\nmov     eax, 1                                                         ; +0x113, 0x140169c53\ntest    eax, eax                                                       ; +0x118, 0x140169c58\njz      loc_140169D40                                                  ; +0x11a, 0x140169c5a\nxorps   xmm0, xmm0                                                     ; +0x120, 0x140169c60\nmovups  xmmword ptr [rbp+57h+Block], xmm0                              ; +0x123, 0x140169c63\nxor     ebx, ebx                                                       ; +0x127, 0x140169c67\nmov     [rbp+57h+var_30], rbx                                          ; +0x129, 0x140169c69\nmov     [rbp+57h+var_28], 0Fh                                          ; +0x12d, 0x140169c6d\nlea     ecx, [rbx+20h]                                                 ; +0x135, 0x140169c75\ncall    sub_14003AA10                                                  ; +0x138, 0x140169c78\nmov     [rbp+57h+Block], rax                                           ; +0x13d, 0x140169c7d\nmov     [rbp+57h+var_30], 1Ch                                          ; +0x141, 0x140169c81\nmov     [rbp+57h+var_28], 1Fh                                          ; +0x149, 0x140169c89\nmovups  xmm0, cs:xmmword_14055A468                                     ; +0x151, 0x140169c91\nmovups  xmmword ptr [rax], xmm0                                        ; +0x158, 0x140169c98\nmovsd   xmm0, cs:qword_14055A478                                       ; +0x15b, 0x140169c9b\nmovsd   qword ptr [rax+10h], xmm0                                      ; +0x163, 0x140169ca3\nmov     ecx, cs:dword_14055A480                                        ; +0x168, 0x140169ca8\nmov     [rax+18h], ecx                                                 ; +0x16e, 0x140169cae\nmov     [rax+1Ch], bl                                                  ; +0x171, 0x140169cb1\nlea     rax, [rbp+57h+Block]                                           ; +0x174, 0x140169cb4\nmov     [rbp+57h+var_78], rax                                          ; +0x178, 0x140169cb8\nlea     rdx, [rbp+57h+Block]                                           ; +0x17c, 0x140169cbc\nlea     rcx, [rbp+57h+var_70]                                          ; +0x180, 0x140169cc0\ncall    sub_14003BDB0                                                  ; +0x184, 0x140169cc4\nmovss   xmm0, cs:flt_140622C24                                         ; +0x189, 0x140169cc9\nmovss   [rsp+0D0h+var_90], xmm0                                        ; +0x191, 0x140169cd1\nxorps   xmm1, xmm1                                                     ; +0x197, 0x140169cd7\nmovss   [rsp+0D0h+var_98], xmm1                                        ; +0x19a, 0x140169cda\nmov     [rsp+0D0h+var_A0], bl                                          ; +0x1a0, 0x140169ce0\nmovss   xmm0, cs:dword_14062343C                                       ; +0x1a4, 0x140169ce4\nmovss   [rsp+0D0h+var_A8], xmm0                                        ; +0x1ac, 0x140169cec\nmov     [rsp+0D0h+var_B0], rbx                                         ; +0x1b2, 0x140169cf2\nlea     r9, aOk; \"OK\"                                                  ; +0x1b7, 0x140169cf7\nmov     r8, rax                                                        ; +0x1be, 0x140169cfe\nlea     rdx, aDataRestored; \"Data restored\"                            ; +0x1c1, 0x140169d01\nxor     ecx, ecx                                                       ; +0x1c8, 0x140169d08\ncall    FLAlertLayer__create                                           ; +0x1ca, 0x140169d0a\nmov     rbx, rax                                                       ; +0x1cf, 0x140169d0f\nlea     rcx, [rbp+57h+Block]                                           ; +0x1d2, 0x140169d12\ncall    sub_14003A830                                                  ; +0x1d6, 0x140169d16\nmov     rdx, [rbx]                                                     ; +0x1db, 0x140169d1b\nmov     rcx, rbx                                                       ; +0x1de, 0x140169d1e\ncall    qword ptr [rdx+410h]                                           ; +0x1e1, 0x140169d21\nmov     rdx, rdi                                                       ; +0x1e7, 0x140169d27\nlea     rcx, [rbp+57h+var_70]                                          ; +0x1ea, 0x140169d2a\ncall    sub_14003BDB0                                                  ; +0x1ee, 0x140169d2e\nmov     rcx, rax                                                       ; +0x1f3, 0x140169d33\ncall    sub_14003A830                                                  ; +0x1f6, 0x140169d36\njmp     loc_140169E06                                                  ; +0x1fb, 0x140169d3b\nxorps   xmm0, xmm0                                                     ; +0x200, 0x140169d40\nmovups  xmmword ptr [rbp+57h+Block], xmm0                              ; +0x203, 0x140169d43\nxor     ebx, ebx                                                       ; +0x207, 0x140169d47\nmov     [rbp+57h+var_30], rbx                                          ; +0x209, 0x140169d49\nmov     [rbp+57h+var_28], 0Fh                                          ; +0x20d, 0x140169d4d\nlea     ecx, [rbx+20h]                                                 ; +0x215, 0x140169d55\ncall    sub_14003AA10                                                  ; +0x218, 0x140169d58\nmov     [rbp+57h+Block], rax                                           ; +0x21d, 0x140169d5d\nmov     [rbp+57h+var_30], 16h                                          ; +0x221, 0x140169d61\nmov     [rbp+57h+var_28], 1Fh                                          ; +0x229, 0x140169d69\nmovups  xmm0, cs:xmmword_14055A450                                     ; +0x231, 0x140169d71\nmovups  xmmword ptr [rax], xmm0                                        ; +0x238, 0x140169d78\nmov     ecx, cs:dword_14055A460                                        ; +0x23b, 0x140169d7b\nmov     [rax+10h], ecx                                                 ; +0x241, 0x140169d81\nmovzx   ecx, cs:word_14055A464                                         ; +0x244, 0x140169d84\nmov     [rax+14h], cx                                                  ; +0x24b, 0x140169d8b\nmov     [rax+16h], bl                                                  ; +0x24f, 0x140169d8f\nlea     rax, [rbp+57h+Block]                                           ; +0x252, 0x140169d92\nmov     [rbp+57h+var_80], rax                                          ; +0x256, 0x140169d96\nlea     rdx, [rbp+57h+Block]                                           ; +0x25a, 0x140169d9a\nlea     rcx, [rbp+57h+var_70]                                          ; +0x25e, 0x140169d9e\ncall    sub_14003BDB0                                                  ; +0x262, 0x140169da2\nmovss   xmm0, cs:flt_140622C24                                         ; +0x267, 0x140169da7\nmovss   [rsp+0D0h+var_90], xmm0                                        ; +0x26f, 0x140169daf\nxorps   xmm1, xmm1                                                     ; +0x275, 0x140169db5\nmovss   [rsp+0D0h+var_98], xmm1                                        ; +0x278, 0x140169db8\nmov     [rsp+0D0h+var_A0], bl                                          ; +0x27e, 0x140169dbe\nmovss   xmm0, cs:dword_14062343C                                       ; +0x282, 0x140169dc2\nmovss   [rsp+0D0h+var_A8], xmm0                                        ; +0x28a, 0x140169dca\nmov     [rsp+0D0h+var_B0], rbx                                         ; +0x290, 0x140169dd0\nlea     r9, aOk; \"OK\"                                                  ; +0x295, 0x140169dd5\nmov     r8, rax                                                        ; +0x29c, 0x140169ddc\nlea     rdx, aError; \"Error\"                                           ; +0x29f, 0x140169ddf\nxor     ecx, ecx                                                       ; +0x2a6, 0x140169de6\ncall    FLAlertLayer__create                                           ; +0x2a8, 0x140169de8\nmov     rbx, rax                                                       ; +0x2ad, 0x140169ded\nlea     rcx, [rbp+57h+Block]                                           ; +0x2b0, 0x140169df0\ncall    sub_14003A830                                                  ; +0x2b4, 0x140169df4\nmov     rdx, [rbx]                                                     ; +0x2b9, 0x140169df9\nmov     rcx, rbx                                                       ; +0x2bc, 0x140169dfc\ncall    qword ptr [rdx+410h]                                           ; +0x2bf, 0x140169dff\nnop                                                                    ; +0x2c5, 0x140169e05\nmov     rcx, rdi                                                       ; +0x2c6, 0x140169e06\ncall    sub_14003A830                                                  ; +0x2c9, 0x140169e09\nnop                                                                    ; +0x2ce, 0x140169e0e\nmov     rcx, rsi                                                       ; +0x2cf, 0x140169e0f\ncall    sub_14003A830                                                  ; +0x2d2, 0x140169e12\nmov     rcx, [rbp+57h+var_20]                                          ; +0x2d7, 0x140169e17\nxor     rcx, rsp; StackCookie                                          ; +0x2db, 0x140169e1b\ncall    __security_check_cookie                                        ; +0x2de, 0x140169e1e\nmov     rbx, [rsp+0D0h+arg_18]                                         ; +0x2e3, 0x140169e23\nadd     rsp, 0C0h                                                      ; +0x2eb, 0x140169e2b\npop     rdi                                                            ; +0x2f2, 0x140169e32\npop     rsi                                                            ; +0x2f3, 0x140169e33\npop     rbp                                                            ; +0x2f4, 0x140169e34\nretn                                                                   ; +0x2f5, 0x140169e35", "xrefs": ["GameLevelManager::handleIt @ 0x1401434e8", "<???> @ 0x1406cad1c"], "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"}