{"type": "func", "start": 4300370352, "end": 4300370758, "name": "GameLevelManager::onLikeItemCompleted", "pseudocode": "// \n// GameLevelManager::onLikeItemCompleted from 0x1005271b0 to 0x100527346 (406 bytes)\n// \n// 1 xrefs:\n// > GameLevelManager::handleIt @ 0x10051f4c5\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 12:31:46 +0000\n// \n\nvoid __fastcall GameLevelManager::onLikeItemCompleted(__int64 a1, unsigned __int8 *a2, __int64 a3)\n{\n  __int64 v3; // r15\n  const char *v4; // r13\n  int v5; // r12d\n  const void *v6; // rdi\n  unsigned __int64 v7; // rcx\n  char *v8; // r14\n  size_t v9; // rdx\n  size_t v10; // rax\n  size_t v11; // rbx\n  __int64 v12; // rax\n  size_t v13; // r15\n  __int64 SavedLevel; // rax\n  __int64 v15; // [rsp+8h] [rbp-58h]\n  __int64 v16; // [rsp+10h] [rbp-50h]\n  unsigned int v17; // [rsp+18h] [rbp-48h]\n  int v18; // [rsp+1Ch] [rbp-44h]\n  _QWORD __s2[2]; // [rsp+20h] [rbp-40h] BYREF\n  void *__p; // [rsp+30h] [rbp-30h]\n\n  v3 = a1;\n  if ( (*(_BYTE *)a3 & 1) != 0 )\n    v4 = *(const char **)(a3 + 16);\n  else\n    v4 = (const char *)(a3 + 1);\n  v5 = sub_10057F230(a1, v4);\n  v17 = sub_10057F330(a1, v4);\n  v18 = sub_10057F430(a1, v4);\n  *(_WORD *)((char *)__s2 + 1) = 12589;\n  BYTE3(__s2[0]) = 0;\n  v6 = a2 + 1;\n  v7 = *a2 >> 1;\n  if ( (*a2 & 1) != 0 )\n    v6 = *((const void **)a2 + 2);\n  v8 = (char *)__s2 + 1;\n  if ( (*a2 & 1) != 0 )\n    v7 = *((_QWORD *)a2 + 1);\n  v9 = 2;\n  if ( v7 < 2 )\n    v9 = v7;\n  if ( !((v7 != 2) | (memcmp(v6, (char *)__s2 + 1, v9) != 0)) )\n  {\n    v15 = *(_QWORD *)(v3 + 800);\n    v10 = strlen(v4);\n    if ( v10 >= 0xFFFFFFFFFFFFFFF8LL )\n      sub_100003630();\n    v11 = v10;\n    if ( v10 >= 0x17 )\n    {\n      v16 = v3;\n      v13 = 26;\n      if ( (v10 | 7) != 0x17 )\n        v13 = (v10 | 7) + 1;\n      v8 = (char *)operator new(v13);\n      __p = v8;\n      __s2[0] = v13 + 1;\n      v3 = v16;\n      __s2[1] = v11;\n    }\n    else\n    {\n      LOBYTE(__s2[0]) = 2 * v10;\n      if ( !v10 )\n        goto LABEL_21;\n    }\n    memmove(v8, v4, v11);\nLABEL_21:\n    v8[v11] = 0;\n    cocos2d::CCDictionary::removeObjectForKey(v15, (char *)__s2);\n    if ( (__s2[0] & 1) != 0 )\n      operator delete(__p);\n    if ( v5 == 1 )\n    {\n      SavedLevel = GameLevelManager::getSavedLevel(v3, v17);\n      if ( SavedLevel )\n      {\n        if ( v18 )\n          --*(_DWORD *)(SavedLevel + 892);\n        else\n          --*(_DWORD *)(SavedLevel + 896);\n      }\n    }\n    return;\n  }\n  if ( v5 == 1 )\n  {\n    v12 = GameStatsManager::sharedState();\n    GameStatsManager::incrementStat_1(v12, (__int64)\"10\");\n  }\n}", "assembly": "; \n; GameLevelManager::onLikeItemCompleted from 0x1005271b0 to 0x100527346 (406 bytes)\n; \n; 1 xrefs:\n; > GameLevelManager::handleIt @ 0x10051f4c5\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 12:31:46 +0000\n; \npush    rbp                                                            ; +0x0, 0x1005271b0\nmov     rbp, rsp                                                       ; +0x1, 0x1005271b1\npush    r15                                                            ; +0x4, 0x1005271b4\npush    r14                                                            ; +0x6, 0x1005271b6\npush    r13                                                            ; +0x8, 0x1005271b8\npush    r12                                                            ; +0xa, 0x1005271ba\npush    rbx                                                            ; +0xc, 0x1005271bc\nsub     rsp, 38h                                                       ; +0xd, 0x1005271bd\nmov     r13, rdx                                                       ; +0x11, 0x1005271c1\nmov     rbx, rsi                                                       ; +0x14, 0x1005271c4\nmov     r15, rdi                                                       ; +0x17, 0x1005271c7\ntest    byte ptr [rdx], 1                                              ; +0x1a, 0x1005271ca\njnz     short loc_1005271D4                                            ; +0x1d, 0x1005271cd\ninc     r13                                                            ; +0x1f, 0x1005271cf\njmp     short loc_1005271D8                                            ; +0x22, 0x1005271d2\nmov     r13, [r13+10h]                                                 ; +0x24, 0x1005271d4\nmov     rsi, r13                                                       ; +0x28, 0x1005271d8\ncall    sub_10057F230                                                  ; +0x2b, 0x1005271db\nmov     r12d, eax                                                      ; +0x30, 0x1005271e0\nmov     rsi, r13                                                       ; +0x33, 0x1005271e3\ncall    sub_10057F330                                                  ; +0x36, 0x1005271e6\nmov     [rbp+var_48], eax                                              ; +0x3b, 0x1005271eb\nmov     rsi, r13                                                       ; +0x3e, 0x1005271ee\ncall    sub_10057F430                                                  ; +0x41, 0x1005271f1\nmov     [rbp+var_44], eax                                              ; +0x46, 0x1005271f6\nmov     word ptr [rbp+__s2+1], 312Dh                                   ; +0x49, 0x1005271f9\nmov     byte ptr [rbp+__s2+3], 0                                       ; +0x4f, 0x1005271ff\nmovzx   eax, byte ptr [rbx]                                            ; +0x53, 0x100527203\nlea     rdi, [rbx+1]                                                   ; +0x56, 0x100527206\nmov     ecx, eax                                                       ; +0x5a, 0x10052720a\nshr     ecx, 1                                                         ; +0x5c, 0x10052720c\ntest    al, 1                                                          ; +0x5e, 0x10052720e\ncmovnz  rdi, [rbx+10h]; __s1                                           ; +0x60, 0x100527210\nlea     r14, [rbp+__s2+1]                                              ; +0x65, 0x100527215\ncmovnz  rcx, [rbx+8]                                                   ; +0x69, 0x100527219\ncmp     rcx, 2                                                         ; +0x6e, 0x10052721e\nmov     edx, 2                                                         ; +0x72, 0x100527222\ncmovb   rdx, rcx; __n                                                  ; +0x77, 0x100527227\nsetnz   bl                                                             ; +0x7b, 0x10052722b\nmov     rsi, r14; __s2                                                 ; +0x7e, 0x10052722e\ncall    _memcmp                                                        ; +0x81, 0x100527231\ntest    eax, eax                                                       ; +0x86, 0x100527236\nsetnz   al                                                             ; +0x88, 0x100527238\nor      al, bl                                                         ; +0x8b, 0x10052723b\njnz     short loc_100527272                                            ; +0x8d, 0x10052723d\nmov     rax, [r15+320h]                                                ; +0x8f, 0x10052723f\nmov     [rbp+var_58], rax                                              ; +0x96, 0x100527246\nmov     rdi, r13; __s                                                  ; +0x9a, 0x10052724a\ncall    _strlen                                                        ; +0x9d, 0x10052724d\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xa2, 0x100527252\njnb     loc_100527341                                                  ; +0xa6, 0x100527256\nmov     rbx, rax                                                       ; +0xac, 0x10052725c\ncmp     rax, 17h                                                       ; +0xaf, 0x10052725f\njnb     short loc_10052729E                                            ; +0xb3, 0x100527263\nlea     eax, [rbx+rbx]                                                 ; +0xb5, 0x100527265\nmov     byte ptr [rbp+__s2], al                                        ; +0xb8, 0x100527268\ntest    rbx, rbx                                                       ; +0xbb, 0x10052726b\njnz     short loc_1005272D9                                            ; +0xbe, 0x10052726e\njmp     short loc_1005272E7                                            ; +0xc0, 0x100527270\ncmp     r12d, 1                                                        ; +0xc2, 0x100527272\njnz     loc_100527332                                                  ; +0xc6, 0x100527276\ncall    GameStatsManager__sharedState                                  ; +0xcc, 0x10052727c\nlea     rsi, a10; \"10\"                                                 ; +0xd1, 0x100527281\nmov     rdi, rax                                                       ; +0xd8, 0x100527288\nadd     rsp, 38h                                                       ; +0xdb, 0x10052728b\npop     rbx                                                            ; +0xdf, 0x10052728f\npop     r12                                                            ; +0xe0, 0x100527290\npop     r13                                                            ; +0xe2, 0x100527292\npop     r14                                                            ; +0xe4, 0x100527294\npop     r15                                                            ; +0xe6, 0x100527296\npop     rbp                                                            ; +0xe8, 0x100527298\njmp     GameStatsManager__incrementStat_1                              ; +0xe9, 0x100527299\nmov     rax, rbx                                                       ; +0xee, 0x10052729e\nor      rax, 7                                                         ; +0xf1, 0x1005272a1\nlea     rcx, [rax+1]                                                   ; +0xf5, 0x1005272a5\ncmp     rax, 17h                                                       ; +0xf9, 0x1005272a9\nmov     [rbp+var_50], r15                                              ; +0xfd, 0x1005272ad\nmov     r15d, 1Ah                                                      ; +0x101, 0x1005272b1\ncmovnz  r15, rcx                                                       ; +0x107, 0x1005272b7\nmov     rdi, r15; __sz                                                 ; +0x10b, 0x1005272bb\ncall    __Znwm; operator new(ulong)                                    ; +0x10e, 0x1005272be\nmov     r14, rax                                                       ; +0x113, 0x1005272c3\nmov     [rbp+__p], rax                                                 ; +0x116, 0x1005272c6\ninc     r15                                                            ; +0x11a, 0x1005272ca\nmov     [rbp+__s2], r15                                                ; +0x11d, 0x1005272cd\nmov     r15, [rbp+var_50]                                              ; +0x121, 0x1005272d1\nmov     [rbp+var_38], rbx                                              ; +0x125, 0x1005272d5\nmov     rdi, r14; __dst                                                ; +0x129, 0x1005272d9\nmov     rsi, r13; __src                                                ; +0x12c, 0x1005272dc\nmov     rdx, rbx; __len                                                ; +0x12f, 0x1005272df\ncall    _memmove                                                       ; +0x132, 0x1005272e2\nmov     byte ptr [r14+rbx], 0                                          ; +0x137, 0x1005272e7\nlea     rsi, [rbp+__s2]                                                ; +0x13c, 0x1005272ec\nmov     rdi, [rbp+var_58]                                              ; +0x140, 0x1005272f0\ncall    cocos2d__CCDictionary__removeObjectForKey                      ; +0x144, 0x1005272f4\ntest    byte ptr [rbp+__s2], 1                                         ; +0x149, 0x1005272f9\njz      short loc_100527308                                            ; +0x14d, 0x1005272fd\nmov     rdi, [rbp+__p]; __p                                            ; +0x14f, 0x1005272ff\ncall    __ZdlPv; operator delete(void *)                               ; +0x153, 0x100527303\ncmp     r12d, 1                                                        ; +0x158, 0x100527308\njnz     short loc_100527332                                            ; +0x15c, 0x10052730c\nmov     rdi, r15                                                       ; +0x15e, 0x10052730e\nmov     esi, [rbp+var_48]                                              ; +0x161, 0x100527311\ncall    GameLevelManager__getSavedLevel                                ; +0x164, 0x100527314\ntest    rax, rax                                                       ; +0x169, 0x100527319\njz      short loc_100527332                                            ; +0x16c, 0x10052731c\ncmp     [rbp+var_44], 0                                                ; +0x16e, 0x10052731e\njz      short loc_10052732C                                            ; +0x172, 0x100527322\ndec     dword ptr [rax+37Ch]                                           ; +0x174, 0x100527324\njmp     short loc_100527332                                            ; +0x17a, 0x10052732a\ndec     dword ptr [rax+380h]                                           ; +0x17c, 0x10052732c\nadd     rsp, 38h                                                       ; +0x182, 0x100527332\npop     rbx                                                            ; +0x186, 0x100527336\npop     r12                                                            ; +0x187, 0x100527337\npop     r13                                                            ; +0x189, 0x100527339\npop     r14                                                            ; +0x18b, 0x10052733b\npop     r15                                                            ; +0x18d, 0x10052733d\npop     rbp                                                            ; +0x18f, 0x10052733f\nretn                                                                   ; +0x190, 0x100527340\ncall    sub_100003630                                                  ; +0x191, 0x100527341", "xrefs": ["GameLevelManager::handleIt @ 0x10051f4c5"], "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"}