{"type": "func", "start": 6443146496, "end": 6443146660, "name": "cocos2d::CCTextureCache::textureForKey", "pseudocode": "// \n// cocos2d::CCTextureCache::textureForKey from 0x1800a9d00 to 0x1800a9da4 (164 bytes)\n// \n// 5 xrefs:\n// > sub_180063AC0 @ 0x180063ad9\n// > cocos2d::CCSprite::setTexture @ 0x18008cad6\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b7efc\n// > <???> @ 0x1801b7f08\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=1\nstruct cocos2d::CCTexture2D *__fastcall cocos2d::CCTextureCache::textureForKey(\n        cocos2d::CCTextureCache *this,\n        const char *a2)\n{\n  struct cocos2d::CCFileUtils *v4; // rax\n  unsigned __int8 *v5; // rax\n  __int64 v6; // rbx\n  _BYTE *v7; // rcx\n  void *Block; // [rsp+20h] [rbp-38h] BYREF\n  unsigned __int64 v10; // [rsp+38h] [rbp-20h]\n\n  v4 = cocos2d::CCFileUtils::sharedFileUtils();\n  v5 = (unsigned __int8 *)((__int64 (__fastcall *)(struct cocos2d::CCFileUtils *, void **, const char *, _QWORD))v4->createCCArrayWithContentsOfFile)(\n                            v4,\n                            &Block,\n                            a2,\n                            0);\n  v6 = cocos2d::CCDictionary::objectForKey((__int64)this->m_pTextures, v5);\n  if ( v10 > 0xF )\n  {\n    v7 = Block;\n    if ( v10 + 1 >= 0x1000 )\n    {\n      v7 = *((_BYTE **)Block - 1);\n      if ( (unsigned __int64)((_BYTE *)Block - v7 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free_0(v7);\n  }\n  return (struct cocos2d::CCTexture2D *)v6;\n}", "assembly": "; \n; cocos2d::CCTextureCache::textureForKey from 0x1800a9d00 to 0x1800a9da4 (164 bytes)\n; \n; 5 xrefs:\n; > sub_180063AC0 @ 0x180063ad9\n; > cocos2d::CCSprite::setTexture @ 0x18008cad6\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b7efc\n; > <???> @ 0x1801b7f08\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_10], rbx                                              ; +0x0, 0x1800a9d00\npush    rdi                                                            ; +0x5, 0x1800a9d05\nsub     rsp, 50h                                                       ; +0x6, 0x1800a9d06\nmov     rax, cs:__security_cookie                                      ; +0xa, 0x1800a9d0a\nxor     rax, rsp                                                       ; +0x11, 0x1800a9d11\nmov     [rsp+58h+var_18], rax                                          ; +0x14, 0x1800a9d14\nmov     rbx, rdx                                                       ; +0x19, 0x1800a9d19\nmov     rdi, rcx                                                       ; +0x1c, 0x1800a9d1c\ncall    ?sharedFileUtils@CCFileUtils@cocos2d@@SAPEAV12@XZ; cocos2d::CCFileUtils::sharedFileUtils(void) ; +0x1f, 0x1800a9d1f\nmov     r10, [rax]                                                     ; +0x24, 0x1800a9d24\nxor     r9d, r9d                                                       ; +0x27, 0x1800a9d27\nmov     r8, rbx                                                        ; +0x2a, 0x1800a9d2a\nlea     rdx, [rsp+58h+Block]                                           ; +0x2d, 0x1800a9d2d\nmov     rcx, rax                                                       ; +0x32, 0x1800a9d32\ncall    qword ptr [r10+28h]                                            ; +0x35, 0x1800a9d35\nnop                                                                    ; +0x39, 0x1800a9d39\nmov     rdx, rax                                                       ; +0x3a, 0x1800a9d3a\nmov     rcx, [rdi+38h]                                                 ; +0x3d, 0x1800a9d3d\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 &) ; +0x41, 0x1800a9d41\nmov     rbx, rax                                                       ; +0x46, 0x1800a9d46\nmov     rdx, [rsp+58h+var_20]                                          ; +0x49, 0x1800a9d49\ncmp     rdx, 0Fh                                                       ; +0x4e, 0x1800a9d4e\njbe     short loc_1800A9D89                                            ; +0x52, 0x1800a9d52\ninc     rdx                                                            ; +0x54, 0x1800a9d54\nmov     rcx, [rsp+58h+Block]; Block                                    ; +0x57, 0x1800a9d57\nmov     rax, rcx                                                       ; +0x5c, 0x1800a9d5c\ncmp     rdx, 1000h                                                     ; +0x5f, 0x1800a9d5f\njb      short loc_1800A9D84                                            ; +0x66, 0x1800a9d66\nadd     rdx, 27h ; '''                                                 ; +0x68, 0x1800a9d68\nmov     rcx, [rcx-8]                                                   ; +0x6c, 0x1800a9d6c\nsub     rax, rcx                                                       ; +0x70, 0x1800a9d70\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x73, 0x1800a9d73\ncmp     rax, 1Fh                                                       ; +0x77, 0x1800a9d77\njbe     short loc_1800A9D84                                            ; +0x7b, 0x1800a9d7b\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x7d, 0x1800a9d7d\nalign 4                                                                ; +0x83, 0x1800a9d83\ncall    j_j_free_0                                                     ; +0x84, 0x1800a9d84\nmov     rax, rbx                                                       ; +0x89, 0x1800a9d89\nmov     rcx, [rsp+58h+var_18]                                          ; +0x8c, 0x1800a9d8c\nxor     rcx, rsp; StackCookie                                          ; +0x91, 0x1800a9d91\ncall    __security_check_cookie                                        ; +0x94, 0x1800a9d94\nmov     rbx, [rsp+58h+arg_10]                                          ; +0x99, 0x1800a9d99\nadd     rsp, 50h                                                       ; +0x9e, 0x1800a9d9e\npop     rdi                                                            ; +0xa2, 0x1800a9da2\nretn                                                                   ; +0xa3, 0x1800a9da3", "xrefs": ["sub_180063AC0 @ 0x180063ad9", "cocos2d::CCSprite::setTexture @ 0x18008cad6", "<???> @ 0x1801438a8", "<???> @ 0x1801b7efc", "<???> @ 0x1801b7f08"], "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"}