{"type": "func", "start": 5370170384, "end": 5370170752, "name": "GameLevelManager::markItemAsLiked", "pseudocode": "// \n// GameLevelManager::markItemAsLiked from 0x140164c10 to 0x140164d80 (368 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::likeItem @ 0x140163d29\n// > <???> @ 0x1406cac98\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=2\nvoid GameLevelManager::markItemAsLiked(GameLevelManager *a1, LikeItemType a2, int a3, bool a4, int a5)\n{\n  BOOL v5; // esi\n  cocos2d::CCString *v9; // rax\n  char *CString; // rax\n  size_t v11; // r8\n  cocos2d::CCString *v12; // rax\n  void *v13; // rcx\n  void *Block[2]; // [rsp+30h] [rbp-78h] BYREF\n  __m128i si128; // [rsp+40h] [rbp-68h]\n  _BYTE v16[32]; // [rsp+50h] [rbp-58h] BYREF\n\n  v5 = a4;\n  if ( cocos2d::CCDictionary::count(a1->m_likedLevels) >= 0x3E8 )\n  {\n    cocos2d::CCDictionary::getFirstKey(a1->m_likedLevels, v16);\n    cocos2d::CCDictionary::removeObjectForKey(a1->m_likedLevels, v16);\n    sub_14003A830((__int64)v16);\n  }\n  *(_OWORD *)Block = 0;\n  si128 = _mm_load_si128((const __m128i *)&xmmword_140623F30);\n  LOBYTE(Block[0]) = 0;\n  if ( a2 == AccountComment )\n  {\n    v9 = cocos2d::CCString::createWithFormat(\"like_%i_%i_%i_%i\", 3, a3, v5, a5);\n    CString = (char *)cocos2d::CCString::getCString(v9);\n    v11 = -1;\n    do\n      ++v11;\n    while ( CString[v11] );\n  }\n  else\n  {\n    v12 = cocos2d::CCString::createWithFormat(\"like_%i_%i_%i_%i\", a2, a3, v5, a5);\n    CString = (char *)cocos2d::CCString::getCString(v12);\n    v11 = -1;\n    do\n      ++v11;\n    while ( CString[v11] );\n  }\n  sub_14003CCE0(Block, CString, v11);\n  cocos2d::CCDictionary::setObject(a1->m_likedLevels, a1->m_trueString, Block);\n  if ( si128.m128i_i64[1] > 0xFuLL )\n  {\n    v13 = Block[0];\n    if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )\n    {\n      v13 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v13 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v13);\n  }\n}", "assembly": "; \n; GameLevelManager::markItemAsLiked from 0x140164c10 to 0x140164d80 (368 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::likeItem @ 0x140163d29\n; > <???> @ 0x1406cac98\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\npush    rbx                                                            ; +0x0, 0x140164c10\npush    rbp                                                            ; +0x2, 0x140164c12\npush    rsi                                                            ; +0x3, 0x140164c13\npush    rdi                                                            ; +0x4, 0x140164c14\npush    r14                                                            ; +0x5, 0x140164c15\nsub     rsp, 80h                                                       ; +0x7, 0x140164c17\nmov     rax, cs:__security_cookie                                      ; +0xe, 0x140164c1e\nxor     rax, rsp                                                       ; +0x15, 0x140164c25\nmov     [rsp+0A8h+var_38], rax                                         ; +0x18, 0x140164c28\nmovzx   esi, r9b                                                       ; +0x1d, 0x140164c2d\nmov     ebp, r8d                                                       ; +0x21, 0x140164c31\nmov     edi, edx                                                       ; +0x24, 0x140164c34\nmov     rbx, rcx                                                       ; +0x26, 0x140164c36\nmov     r14d, [rsp+0A8h+arg_20]                                        ; +0x29, 0x140164c39\nmov     rcx, [rcx+188h]                                                ; +0x31, 0x140164c41\ncall    cs:?count@CCDictionary@cocos2d@@QEAAIXZ; cocos2d::CCDictionary::count(void) ; +0x38, 0x140164c48\ncmp     eax, 3E8h                                                      ; +0x3e, 0x140164c4e\njb      short loc_140164C85                                            ; +0x43, 0x140164c53\nlea     rdx, [rsp+0A8h+var_58]                                         ; +0x45, 0x140164c55\nmov     rcx, [rbx+188h]                                                ; +0x4a, 0x140164c5a\ncall    cs:?getFirstKey@CCDictionary@cocos2d@@QEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ; cocos2d::CCDictionary::getFirstKey(void) ; +0x51, 0x140164c61\nnop                                                                    ; +0x57, 0x140164c67\nlea     rdx, [rsp+0A8h+var_58]                                         ; +0x58, 0x140164c68\nmov     rcx, [rbx+188h]                                                ; +0x5d, 0x140164c6d\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 &) ; +0x64, 0x140164c74\nnop                                                                    ; +0x6a, 0x140164c7a\nlea     rcx, [rsp+0A8h+var_58]                                         ; +0x6b, 0x140164c7b\ncall    sub_14003A830                                                  ; +0x70, 0x140164c80\nxorps   xmm0, xmm0                                                     ; +0x75, 0x140164c85\nmovups  xmmword ptr [rsp+0A8h+Block], xmm0                             ; +0x78, 0x140164c88\nmovdqa  xmm1, cs:xmmword_140623F30                                     ; +0x7d, 0x140164c8d\nmovdqu  [rsp+0A8h+var_68], xmm1                                        ; +0x85, 0x140164c95\nmov     byte ptr [rsp+0A8h+Block], 0                                   ; +0x8b, 0x140164c9b\nmov     r9d, esi                                                       ; +0x90, 0x140164ca0\nmov     [rsp+0A8h+var_88], r14d                                        ; +0x93, 0x140164ca3\nmov     r8d, ebp                                                       ; +0x98, 0x140164ca8\nlea     rcx, aLikeIIII; \"like_%i_%i_%i_%i\"                             ; +0x9b, 0x140164cab\ncmp     edi, 3                                                         ; +0xa2, 0x140164cb2\njnz     short loc_140164CDC                                            ; +0xa5, 0x140164cb5\nmov     edx, edi                                                       ; +0xa7, 0x140164cb7\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xa9, 0x140164cb9\nmov     rcx, rax                                                       ; +0xaf, 0x140164cbf\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xb2, 0x140164cc2\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xb8, 0x140164cc8\nnop                                                                    ; +0xbf, 0x140164ccf\ninc     r8                                                             ; +0xc0, 0x140164cd0\ncmp     byte ptr [rax+r8], 0                                           ; +0xc3, 0x140164cd3\njnz     short loc_140164CD0                                            ; +0xc8, 0x140164cd8\njmp     short loc_140164CFE                                            ; +0xca, 0x140164cda\nmov     edx, edi                                                       ; +0xcc, 0x140164cdc\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xce, 0x140164cde\nmov     rcx, rax                                                       ; +0xd4, 0x140164ce4\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xd7, 0x140164ce7\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xdd, 0x140164ced\ninc     r8; Size                                                       ; +0xe4, 0x140164cf4\ncmp     byte ptr [rax+r8], 0                                           ; +0xe7, 0x140164cf7\njnz     short loc_140164CF4                                            ; +0xec, 0x140164cfc\nmov     rdx, rax; Src                                                  ; +0xee, 0x140164cfe\nlea     rcx, [rsp+0A8h+Block]; void *                                  ; +0xf1, 0x140164d01\ncall    sub_14003CCE0                                                  ; +0xf6, 0x140164d06\nlea     r8, [rsp+0A8h+Block]                                           ; +0xfb, 0x140164d0b\nmov     rdx, [rbx+3B0h]                                                ; +0x100, 0x140164d10\nmov     rcx, [rbx+188h]                                                ; +0x107, 0x140164d17\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const &) ; +0x10e, 0x140164d1e\nnop                                                                    ; +0x114, 0x140164d24\nmov     rdx, qword ptr [rsp+0A8h+var_68+8]                             ; +0x115, 0x140164d25\ncmp     rdx, 0Fh                                                       ; +0x11a, 0x140164d2a\njbe     short loc_140164D65                                            ; +0x11e, 0x140164d2e\ninc     rdx                                                            ; +0x120, 0x140164d30\nmov     rcx, [rsp+0A8h+Block]; Block                                   ; +0x123, 0x140164d33\nmov     rax, rcx                                                       ; +0x128, 0x140164d38\ncmp     rdx, 1000h                                                     ; +0x12b, 0x140164d3b\njb      short loc_140164D60                                            ; +0x132, 0x140164d42\nadd     rdx, 27h ; '''                                                 ; +0x134, 0x140164d44\nmov     rcx, [rcx-8]                                                   ; +0x138, 0x140164d48\nsub     rax, rcx                                                       ; +0x13c, 0x140164d4c\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x13f, 0x140164d4f\ncmp     rax, 1Fh                                                       ; +0x143, 0x140164d53\njbe     short loc_140164D60                                            ; +0x147, 0x140164d57\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x149, 0x140164d59\nalign 20h                                                              ; +0x14f, 0x140164d5f\ncall    j_j_free                                                       ; +0x150, 0x140164d60\nmov     rcx, [rsp+0A8h+var_38]                                         ; +0x155, 0x140164d65\nxor     rcx, rsp; StackCookie                                          ; +0x15a, 0x140164d6a\ncall    __security_check_cookie                                        ; +0x15d, 0x140164d6d\nadd     rsp, 80h                                                       ; +0x162, 0x140164d72\npop     r14                                                            ; +0x169, 0x140164d79\npop     rdi                                                            ; +0x16b, 0x140164d7b\npop     rsi                                                            ; +0x16c, 0x140164d7c\npop     rbp                                                            ; +0x16d, 0x140164d7d\npop     rbx                                                            ; +0x16e, 0x140164d7e\nretn                                                                   ; +0x16f, 0x140164d7f", "xrefs": ["GameLevelManager::likeItem @ 0x140163d29", "<???> @ 0x1406cac98"], "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"}