{"type": "func", "start": 6442494416, "end": 6442494677, "name": "cocos2d::CCDictionary::randomObject", "pseudocode": "// \n// cocos2d::CCDictionary::randomObject from 0x18000a9d0 to 0x18000aad5 (261 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801b7d38\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 11:21:19 +0000\n// \n\nstruct cocos2d::CCObject *__fastcall cocos2d::CCDictionary::randomObject(cocos2d::CCDictionary *this)\n{\n  cocos2d::CCArray *v2; // rax\n  int *v3; // rax\n  int v4; // ecx\n  char *CString; // rax\n  __int64 v7; // rbx\n  void *v8; // r8\n  void *Block[3]; // [rsp+30h] [rbp-38h] BYREF\n  unsigned __int64 v10; // [rsp+48h] [rbp-20h]\n\n  if ( !*((_DWORD *)this + 16) )\n    return nullptr;\n  v2 = cocos2d::CCDictionary::allKeys(this);\n  v3 = (int *)cocos2d::CCArray::randomObject(v2);\n  v4 = *((_DWORD *)this + 16);\n  if ( v4 == 2 )\n    return cocos2d::CCDictionary::objectForKey(this, v3[14]);\n  if ( v4 != 1 )\n    return nullptr;\n  CString = (char *)cocos2d::CCString::getCString((cocos2d::CCString *)v3);\n  sub_180005A10(Block, CString);\n  v7 = cocos2d::CCDictionary::objectForKey((__int64)this, (__int64)Block);\n  if ( v10 > 0xF )\n  {\n    v8 = Block[0];\n    if ( v10 + 1 >= 0x1000 )\n    {\n      v8 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free_0(v8);\n  }\n  return (struct cocos2d::CCObject *)v7;\n}", "assembly": "; \n; cocos2d::CCDictionary::randomObject from 0x18000a9d0 to 0x18000aad5 (261 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801b7d38\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 11:21:19 +0000\n; \npush    rbx                                                            ; +0x0, 0x18000a9d0\nsub     rsp, 60h                                                       ; +0x2, 0x18000a9d2\nmov     rax, cs:__security_cookie                                      ; +0x6, 0x18000a9d6\nxor     rax, rsp                                                       ; +0xd, 0x18000a9dd\nmov     [rsp+68h+var_18], rax                                          ; +0x10, 0x18000a9e0\ncmp     dword ptr [rcx+40h], 0                                         ; +0x15, 0x18000a9e5\nmov     rbx, rcx                                                       ; +0x19, 0x18000a9e9\njz      loc_18000AAC0                                                  ; +0x1c, 0x18000a9ec\ncall    ?allKeys@CCDictionary@cocos2d@@QEAAPEAVCCArray@2@XZ; cocos2d::CCDictionary::allKeys(void) ; +0x22, 0x18000a9f2\nmov     rcx, rax; this                                                 ; +0x27, 0x18000a9f7\ncall    ?randomObject@CCArray@cocos2d@@QEAAPEAVCCObject@2@XZ; cocos2d::CCArray::randomObject(void) ; +0x2a, 0x18000a9fa\nmov     ecx, [rbx+40h]                                                 ; +0x2f, 0x18000a9ff\ncmp     ecx, 2                                                         ; +0x32, 0x18000aa02\njnz     short loc_18000AA26                                            ; +0x35, 0x18000aa05\nmovsxd  rdx, dword ptr [rax+38h]; __int64                              ; +0x37, 0x18000aa07\nmov     rcx, rbx; this                                                 ; +0x3b, 0x18000aa0b\ncall    ?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@_J@Z; cocos2d::CCDictionary::objectForKey(__int64) ; +0x3e, 0x18000aa0e\nmov     rcx, [rsp+68h+var_18]                                          ; +0x43, 0x18000aa13\nxor     rcx, rsp; StackCookie                                          ; +0x48, 0x18000aa18\ncall    __security_check_cookie                                        ; +0x4b, 0x18000aa1b\nadd     rsp, 60h                                                       ; +0x50, 0x18000aa20\npop     rbx                                                            ; +0x54, 0x18000aa24\nretn                                                                   ; +0x55, 0x18000aa25\ncmp     ecx, 1                                                         ; +0x56, 0x18000aa26\njnz     loc_18000AAC0                                                  ; +0x59, 0x18000aa29\nmov     rcx, rax; this                                                 ; +0x5f, 0x18000aa2f\ncall    ?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x62, 0x18000aa32\nmov     rdx, rax; Str                                                  ; +0x67, 0x18000aa37\nlea     rcx, [rsp+68h+Block]; void *                                   ; +0x6a, 0x18000aa3a\ncall    sub_180005A10                                                  ; +0x6f, 0x18000aa3f\nlea     rdx, [rsp+68h+Block]                                           ; +0x74, 0x18000aa44\nmov     rcx, rbx                                                       ; +0x79, 0x18000aa49\ncall    ?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0x7c, 0x18000aa4c\nmov     rdx, [rsp+68h+var_20]                                          ; +0x81, 0x18000aa51\nmov     rbx, rax                                                       ; +0x86, 0x18000aa56\ncmp     rdx, 0Fh                                                       ; +0x89, 0x18000aa59\njbe     short loc_18000AAAA                                            ; +0x8d, 0x18000aa5d\nmov     r8, [rsp+68h+Block]                                            ; +0x8f, 0x18000aa5f\ninc     rdx                                                            ; +0x94, 0x18000aa64\nmov     rcx, r8                                                        ; +0x97, 0x18000aa67\ncmp     rdx, 1000h                                                     ; +0x9a, 0x18000aa6a\njb      short loc_18000AAA2                                            ; +0xa1, 0x18000aa71\nmov     r8, [r8-8]                                                     ; +0xa3, 0x18000aa73\nadd     rdx, 27h ; '''                                                 ; +0xa7, 0x18000aa77\nsub     rcx, r8                                                        ; +0xab, 0x18000aa7b\nsub     rcx, 8                                                         ; +0xae, 0x18000aa7e\ncmp     rcx, 1Fh                                                       ; +0xb2, 0x18000aa82\njbe     short loc_18000AAA2                                            ; +0xb6, 0x18000aa86\nxor     r9d, r9d; LineNo                                               ; +0xb8, 0x18000aa88\nmov     [rsp+68h+Reserved], 0; Reserved                                ; +0xbb, 0x18000aa8b\nxor     r8d, r8d; FileName                                             ; +0xc4, 0x18000aa94\nxor     edx, edx; FunctionName                                         ; +0xc7, 0x18000aa97\nxor     ecx, ecx; Expression                                           ; +0xc9, 0x18000aa99\ncall    cs:_invoke_watson                                              ; +0xcb, 0x18000aa9b\nalign 2                                                                ; +0xd1, 0x18000aaa1\nmov     rcx, r8; Block                                                 ; +0xd2, 0x18000aaa2\ncall    j_j_free_0                                                     ; +0xd5, 0x18000aaa5\nmov     rax, rbx                                                       ; +0xda, 0x18000aaaa\nmov     rcx, [rsp+68h+var_18]                                          ; +0xdd, 0x18000aaad\nxor     rcx, rsp; StackCookie                                          ; +0xe2, 0x18000aab2\ncall    __security_check_cookie                                        ; +0xe5, 0x18000aab5\nadd     rsp, 60h                                                       ; +0xea, 0x18000aaba\npop     rbx                                                            ; +0xee, 0x18000aabe\nretn                                                                   ; +0xef, 0x18000aabf\nxor     eax, eax                                                       ; +0xf0, 0x18000aac0\nmov     rcx, [rsp+68h+var_18]                                          ; +0xf2, 0x18000aac2\nxor     rcx, rsp; StackCookie                                          ; +0xf7, 0x18000aac7\ncall    __security_check_cookie                                        ; +0xfa, 0x18000aaca\nadd     rsp, 60h                                                       ; +0xff, 0x18000aacf\npop     rbx                                                            ; +0x103, 0x18000aad3\nretn                                                                   ; +0x104, 0x18000aad4", "xrefs": ["<???> @ 0x18014cf68", "<???> @ 0x1801b7d38"], "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"}