{"type": "func", "start": 5371941440, "end": 5371941977, "name": "MoreSearchLayer::onLegendary", "pseudocode": "// \n// MoreSearchLayer::onLegendary from 0x140315240 to 0x140315459 (537 bytes)\n// \n// 3 xrefs:\n// > MoreSearchLayer::init @ 0x140313cb9\n// > <???> @ 0x1406d48ec\n// > <???> @ 0x1406d48f8\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\nvoid MoreSearchLayer::onLegendary(MoreSearchLayer *a1, cocos2d::CCObject *a2)\n{\n  __int64 v2; // rbx\n  cocos2d::CCString *v3; // rax\n  BOOL v4; // edi\n  void *v5; // rcx\n  __int64 v6; // rbx\n  struct cocos2d::CCString *v7; // rax\n  void *v8; // rcx\n  void *v9; // [rsp+20h] [rbp-58h]\n  void *v10; // [rsp+20h] [rbp-58h]\n  void *Block[2]; // [rsp+28h] [rbp-50h] BYREF\n  __int64 v12; // [rsp+38h] [rbp-40h]\n  unsigned __int64 v13; // [rsp+40h] [rbp-38h]\n  void *v14[2]; // [rsp+48h] [rbp-30h] BYREF\n  __int64 v15; // [rsp+58h] [rbp-20h]\n  unsigned __int64 v16; // [rsp+60h] [rbp-18h]\n\n  v2 = qword_1406C2EC0;\n  if ( !qword_1406C2EC0 )\n  {\n    v9 = operator new(0x3D0u);\n    qword_1406C2EC0 = sub_140141280((__int64)v9);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n    v2 = qword_1406C2EC0;\n  }\n  *(_OWORD *)Block = 0;\n  Block[0] = sub_14003AA10(0x20u);\n  v12 = 16;\n  v13 = 31;\n  strcpy((char *)Block[0], \"legendary_filter\");\n  v3 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v2 + 344), Block);\n  v4 = cocos2d::CCString::boolValue(v3);\n  if ( v13 > 0xF )\n  {\n    v5 = Block[0];\n    if ( v13 + 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  v12 = 0;\n  v13 = 15;\n  LOBYTE(Block[0]) = 0;\n  v6 = qword_1406C2EC0;\n  if ( !qword_1406C2EC0 )\n  {\n    v10 = operator new(0x3D0u);\n    qword_1406C2EC0 = sub_140141280((__int64)v10);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);\n    v6 = qword_1406C2EC0;\n  }\n  *(_OWORD *)v14 = 0;\n  v15 = 0;\n  v16 = 15;\n  v14[0] = sub_14003AA10(0x20u);\n  v15 = 16;\n  v16 = 31;\n  strcpy((char *)v14[0], \"legendary_filter\");\n  v7 = cocos2d::CCString::createWithFormat(\"%i\", !v4);\n  cocos2d::CCDictionary::setObject(*(_QWORD *)(v6 + 344), v7, v14);\n  if ( v16 > 0xF )\n  {\n    v8 = v14[0];\n    if ( v16 + 1 >= 0x1000 )\n    {\n      v8 = *((void **)v14[0] - 1);\n      if ( (unsigned __int64)((char *)v14[0] - (char *)v8 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v8);\n  }\n}", "assembly": "; \n; MoreSearchLayer::onLegendary from 0x140315240 to 0x140315459 (537 bytes)\n; \n; 3 xrefs:\n; > MoreSearchLayer::init @ 0x140313cb9\n; > <???> @ 0x1406d48ec\n; > <???> @ 0x1406d48f8\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_0], rbx                                               ; +0x0, 0x140315240\npush    rdi                                                            ; +0x5, 0x140315245\nsub     rsp, 70h                                                       ; +0x6, 0x140315246\nmov     rax, cs:__security_cookie                                      ; +0xa, 0x14031524a\nxor     rax, rsp                                                       ; +0x11, 0x140315251\nmov     [rsp+78h+var_10], rax                                          ; +0x14, 0x140315254\nmov     rbx, cs:qword_1406C2EC0                                        ; +0x19, 0x140315259\ntest    rbx, rbx                                                       ; +0x20, 0x140315260\njnz     short loc_140315294                                            ; +0x23, 0x140315263\nmov     ecx, 3D0h; Size                                                ; +0x25, 0x140315265\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x2a, 0x14031526a\nmov     [rsp+78h+var_58], rax                                          ; +0x2f, 0x14031526f\nmov     rcx, rax                                                       ; +0x34, 0x140315274\ncall    sub_140141280                                                  ; +0x37, 0x140315277\nnop                                                                    ; +0x3c, 0x14031527c\nmov     cs:qword_1406C2EC0, rax                                        ; +0x3d, 0x14031527d\nmov     rdx, [rax]                                                     ; +0x44, 0x140315284\nmov     rcx, rax                                                       ; +0x47, 0x140315287\ncall    qword ptr [rdx+48h]                                            ; +0x4a, 0x14031528a\nmov     rbx, cs:qword_1406C2EC0                                        ; +0x4d, 0x14031528d\nxorps   xmm0, xmm0                                                     ; +0x54, 0x140315294\nmovups  xmmword ptr [rsp+78h+Block], xmm0                              ; +0x57, 0x140315297\nmov     [rsp+78h+var_40], 0                                            ; +0x5c, 0x14031529c\nmov     [rsp+78h+var_38], 0Fh                                          ; +0x65, 0x1403152a5\nmov     ecx, 20h ; ' '                                                 ; +0x6e, 0x1403152ae\ncall    sub_14003AA10                                                  ; +0x73, 0x1403152b3\nmov     [rsp+78h+Block], rax                                           ; +0x78, 0x1403152b8\nmov     [rsp+78h+var_40], 10h                                          ; +0x7d, 0x1403152bd\nmov     [rsp+78h+var_38], 1Fh                                          ; +0x86, 0x1403152c6\nmovups  xmm0, cs:xmmword_14058AC28                                     ; +0x8f, 0x1403152cf\nmovups  xmmword ptr [rax], xmm0                                        ; +0x96, 0x1403152d6\nmov     byte ptr [rax+10h], 0                                          ; +0x99, 0x1403152d9\nlea     rdx, [rsp+78h+Block]                                           ; +0x9d, 0x1403152dd\nmov     rcx, [rbx+158h]                                                ; +0xa2, 0x1403152e2\ncall    cs:?valueForKey@CCDictionary@cocos2d@@QEAAPEBVCCString@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::valueForKey(std::string const &) ; +0xa9, 0x1403152e9\nmov     rcx, rax                                                       ; +0xaf, 0x1403152ef\ncall    cs:?boolValue@CCString@cocos2d@@QEBA_NXZ; cocos2d::CCString::boolValue(void) ; +0xb2, 0x1403152f2\nmovzx   edi, al                                                        ; +0xb8, 0x1403152f8\nmov     rdx, [rsp+78h+var_38]                                          ; +0xbb, 0x1403152fb\ncmp     rdx, 0Fh                                                       ; +0xc0, 0x140315300\njbe     short loc_14031533B                                            ; +0xc4, 0x140315304\ninc     rdx                                                            ; +0xc6, 0x140315306\nmov     rcx, [rsp+78h+Block]; Block                                    ; +0xc9, 0x140315309\nmov     rax, rcx                                                       ; +0xce, 0x14031530e\ncmp     rdx, 1000h                                                     ; +0xd1, 0x140315311\njb      short loc_140315336                                            ; +0xd8, 0x140315318\nadd     rdx, 27h ; '''                                                 ; +0xda, 0x14031531a\nmov     rcx, [rcx-8]                                                   ; +0xde, 0x14031531e\nsub     rax, rcx                                                       ; +0xe2, 0x140315322\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xe5, 0x140315325\ncmp     rax, 1Fh                                                       ; +0xe9, 0x140315329\njbe     short loc_140315336                                            ; +0xed, 0x14031532d\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xef, 0x14031532f\nalign 2                                                                ; +0xf5, 0x140315335\ncall    j_j_free                                                       ; +0xf6, 0x140315336\nmov     [rsp+78h+var_40], 0                                            ; +0xfb, 0x14031533b\nmov     [rsp+78h+var_38], 0Fh                                          ; +0x104, 0x140315344\nmov     byte ptr [rsp+78h+Block], 0                                    ; +0x10d, 0x14031534d\nmov     rbx, cs:qword_1406C2EC0                                        ; +0x112, 0x140315352\ntest    rbx, rbx                                                       ; +0x119, 0x140315359\njnz     short loc_14031538D                                            ; +0x11c, 0x14031535c\nmov     ecx, 3D0h; Size                                                ; +0x11e, 0x14031535e\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x123, 0x140315363\nmov     [rsp+78h+var_58], rax                                          ; +0x128, 0x140315368\nmov     rcx, rax                                                       ; +0x12d, 0x14031536d\ncall    sub_140141280                                                  ; +0x130, 0x140315370\nnop                                                                    ; +0x135, 0x140315375\nmov     cs:qword_1406C2EC0, rax                                        ; +0x136, 0x140315376\nmov     rdx, [rax]                                                     ; +0x13d, 0x14031537d\nmov     rcx, rax                                                       ; +0x140, 0x140315380\ncall    qword ptr [rdx+48h]                                            ; +0x143, 0x140315383\nmov     rbx, cs:qword_1406C2EC0                                        ; +0x146, 0x140315386\nxorps   xmm0, xmm0                                                     ; +0x14d, 0x14031538d\nmovups  xmmword ptr [rsp+78h+var_30], xmm0                             ; +0x150, 0x140315390\nmov     [rsp+78h+var_20], 0                                            ; +0x155, 0x140315395\nmov     [rsp+78h+var_18], 0Fh                                          ; +0x15e, 0x14031539e\nmov     ecx, 20h ; ' '                                                 ; +0x167, 0x1403153a7\ncall    sub_14003AA10                                                  ; +0x16c, 0x1403153ac\nmov     [rsp+78h+var_30], rax                                          ; +0x171, 0x1403153b1\nmov     [rsp+78h+var_20], 10h                                          ; +0x176, 0x1403153b6\nmov     [rsp+78h+var_18], 1Fh                                          ; +0x17f, 0x1403153bf\nmovups  xmm0, cs:xmmword_14058AC28                                     ; +0x188, 0x1403153c8\nmovups  xmmword ptr [rax], xmm0                                        ; +0x18f, 0x1403153cf\nmov     byte ptr [rax+10h], 0                                          ; +0x192, 0x1403153d2\nmov     edx, edi                                                       ; +0x196, 0x1403153d6\nxor     edx, 1                                                         ; +0x198, 0x1403153d8\nlea     rcx, aI_11; \"%i\"                                               ; +0x19b, 0x1403153db\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x1a2, 0x1403153e2\nmov     rdx, rax                                                       ; +0x1a8, 0x1403153e8\nlea     r8, [rsp+78h+var_30]                                           ; +0x1ab, 0x1403153eb\nmov     rcx, [rbx+158h]                                                ; +0x1b0, 0x1403153f0\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 &) ; +0x1b7, 0x1403153f7\nnop                                                                    ; +0x1bd, 0x1403153fd\nmov     rdx, [rsp+78h+var_18]                                          ; +0x1be, 0x1403153fe\ncmp     rdx, 0Fh                                                       ; +0x1c3, 0x140315403\njbe     short loc_14031543E                                            ; +0x1c7, 0x140315407\ninc     rdx                                                            ; +0x1c9, 0x140315409\nmov     rcx, [rsp+78h+var_30]; Block                                   ; +0x1cc, 0x14031540c\nmov     rax, rcx                                                       ; +0x1d1, 0x140315411\ncmp     rdx, 1000h                                                     ; +0x1d4, 0x140315414\njb      short loc_140315439                                            ; +0x1db, 0x14031541b\nadd     rdx, 27h ; '''                                                 ; +0x1dd, 0x14031541d\nmov     rcx, [rcx-8]                                                   ; +0x1e1, 0x140315421\nsub     rax, rcx                                                       ; +0x1e5, 0x140315425\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x1e8, 0x140315428\ncmp     rax, 1Fh                                                       ; +0x1ec, 0x14031542c\njbe     short loc_140315439                                            ; +0x1f0, 0x140315430\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x1f2, 0x140315432\ndb 0CCh                                                                ; +0x1f8, 0x140315438\ncall    j_j_free                                                       ; +0x1f9, 0x140315439\nmov     rcx, [rsp+78h+var_10]                                          ; +0x1fe, 0x14031543e\nxor     rcx, rsp; StackCookie                                          ; +0x203, 0x140315443\ncall    __security_check_cookie                                        ; +0x206, 0x140315446\nmov     rbx, [rsp+78h+arg_0]                                           ; +0x20b, 0x14031544b\nadd     rsp, 70h                                                       ; +0x213, 0x140315453\npop     rdi                                                            ; +0x217, 0x140315457\nretn                                                                   ; +0x218, 0x140315458", "xrefs": ["MoreSearchLayer::init @ 0x140313cb9", "<???> @ 0x1406d48ec", "<???> @ 0x1406d48f8"], "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"}