{"type": "func", "start": 6442763616, "end": 6442763874, "name": "cocos2d::CCLabelBMFont::setFntFile", "pseudocode": "// \n// cocos2d::CCLabelBMFont::setFntFile from 0x18004c560 to 0x18004c662 (258 bytes)\n// \n// 4 xrefs:\n// > <???> @ 0x180137a60\n// > <???> @ 0x180137a94\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b1a40\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 __fastcall cocos2d::CCLabelBMFont::setFntFile(cocos2d::CCLabelBMFont *this, cocos2d *a2)\n{\n  std::string *p_m_sFntFile; // r8\n  cocos2d *v5; // rax\n  signed __int64 v6; // r8\n  int v7; // ecx\n  const char *v8; // rdx\n  struct cocos2d::CCBMFontConfiguration *File; // rsi\n  size_t v10; // r8\n  cocos2d::CCBMFontConfiguration *m_pConfiguration; // rcx\n  std::string *p_m_sAtlasName; // rsi\n  cocos2d::CCTextureProtocol_vtbl *v13; // rdi\n  cocos2d::CCTextureCache *v14; // rax\n  struct cocos2d::CCTexture2D *v15; // rax\n\n  if ( a2 )\n  {\n    p_m_sFntFile = &this->m_sFntFile;\n    if ( this->m_sFntFile.m_data.m_capacity > 0xF )\n      p_m_sFntFile = (std::string *)this->m_sFntFile.m_data.m_bigStorage;\n    v5 = a2;\n    v6 = (char *)p_m_sFntFile - (char *)a2;\n    do\n    {\n      v7 = *((unsigned __int8 *)v5 + v6);\n      v8 = (const char *)((unsigned int)*(unsigned __int8 *)v5 - v7);\n      if ( (_DWORD)v8 )\n        break;\n      v5 = (cocos2d *)((char *)v5 + 1);\n    }\n    while ( v7 );\n    if ( (_DWORD)v8 )\n    {\n      File = cocos2d::FNTConfigLoadFile(a2, v8);\n      v10 = -1;\n      do\n        ++v10;\n      while ( *((_BYTE *)a2 + v10) );\n      sub_180010050((void **)&this->m_sFntFile, a2, v10);\n      if ( File )\n        cocos2d::CCObject::retain(File);\n      m_pConfiguration = this->m_pConfiguration;\n      if ( m_pConfiguration )\n        cocos2d::CCObject::release(m_pConfiguration);\n      this->m_pConfiguration = File;\n      p_m_sAtlasName = &File->m_sAtlasName;\n      if ( p_m_sAtlasName->m_data.m_capacity > 0xF )\n        p_m_sAtlasName = (std::string *)p_m_sAtlasName->m_data.m_bigStorage;\n      v13 = this->cocos2d::CCSpriteBatchNode::cocos2d::CCTextureProtocol::cocos2d::CCBlendProtocol::__vftable;\n      v14 = cocos2d::CCTextureCache::sharedTextureCache();\n      v15 = cocos2d::CCTextureCache::addImage(v14, p_m_sAtlasName->m_data.m_smallStorage._Elems, 0);\n      ((void (__fastcall *)(cocos2d::CCTextureProtocol *, struct cocos2d::CCTexture2D *))v13->setTexture)(\n        &this->cocos2d::CCTextureProtocol,\n        v15);\n      cocos2d::CCLabelBMFont::createFontChars(this);\n    }\n  }\n}", "assembly": "; \n; cocos2d::CCLabelBMFont::setFntFile from 0x18004c560 to 0x18004c662 (258 bytes)\n; \n; 4 xrefs:\n; > <???> @ 0x180137a60\n; > <???> @ 0x180137a94\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b1a40\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\ntest    rdx, rdx                                                       ; +0x0, 0x18004c560\njz      locret_18004C661                                               ; +0x3, 0x18004c563\nmov     [rsp+arg_10], rbx                                              ; +0x9, 0x18004c569\npush    rbp                                                            ; +0xe, 0x18004c56e\nsub     rsp, 20h                                                       ; +0xf, 0x18004c56f\ncmp     qword ptr [rcx+198h], 0Fh                                      ; +0x13, 0x18004c573\nlea     r8, [rcx+180h]                                                 ; +0x1b, 0x18004c57b\nmov     rbx, rdx                                                       ; +0x22, 0x18004c582\nmov     [rsp+28h+arg_8], rdi                                           ; +0x25, 0x18004c585\nmov     rbp, rcx                                                       ; +0x2a, 0x18004c58a\njbe     short loc_18004C596                                            ; +0x2d, 0x18004c58d\nmov     r8, [rcx+180h]                                                 ; +0x2f, 0x18004c58f\nmov     rax, rbx                                                       ; +0x36, 0x18004c596\nsub     r8, rbx                                                        ; +0x39, 0x18004c599\nnop     dword ptr [rax+00h]                                            ; +0x3c, 0x18004c59c\nmovzx   edx, byte ptr [rax]                                            ; +0x40, 0x18004c5a0\nmovzx   ecx, byte ptr [rax+r8]                                         ; +0x43, 0x18004c5a3\nsub     edx, ecx; char *                                               ; +0x48, 0x18004c5a8\njnz     short loc_18004C5B3                                            ; +0x4a, 0x18004c5aa\ninc     rax                                                            ; +0x4c, 0x18004c5ac\ntest    ecx, ecx                                                       ; +0x4f, 0x18004c5af\njnz     short loc_18004C5A0                                            ; +0x51, 0x18004c5b1\ntest    edx, edx                                                       ; +0x53, 0x18004c5b3\njz      loc_18004C652                                                  ; +0x55, 0x18004c5b5\nmov     rcx, rbx; this                                                 ; +0x5b, 0x18004c5bb\nmov     [rsp+28h+arg_0], rsi                                           ; +0x5e, 0x18004c5be\ncall    ?FNTConfigLoadFile@cocos2d@@YAPEAVCCBMFontConfiguration@1@PEBD@Z; cocos2d::FNTConfigLoadFile(char const *) ; +0x63, 0x18004c5c3\nmov     rsi, rax                                                       ; +0x68, 0x18004c5c8\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x6b, 0x18004c5cb\ninc     r8; Size                                                       ; +0x72, 0x18004c5d2\ncmp     byte ptr [rbx+r8], 0                                           ; +0x75, 0x18004c5d5\njnz     short loc_18004C5D2                                            ; +0x7a, 0x18004c5da\nmov     rdx, rbx; Src                                                  ; +0x7c, 0x18004c5dc\nlea     rcx, [rbp+180h]; void *                                        ; +0x7f, 0x18004c5df\ncall    sub_180010050                                                  ; +0x86, 0x18004c5e6\ntest    rsi, rsi                                                       ; +0x8b, 0x18004c5eb\njz      short loc_18004C5F8                                            ; +0x8e, 0x18004c5ee\nmov     rcx, rsi; this                                                 ; +0x90, 0x18004c5f0\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x93, 0x18004c5f3\nmov     rcx, [rbp+1D0h]; this                                          ; +0x98, 0x18004c5f8\ntest    rcx, rcx                                                       ; +0x9f, 0x18004c5ff\njz      short loc_18004C609                                            ; +0xa2, 0x18004c602\ncall    ?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0xa4, 0x18004c604\nmov     [rbp+1D0h], rsi                                                ; +0xa9, 0x18004c609\nadd     rsi, 58h ; 'X'                                                 ; +0xb0, 0x18004c610\ncmp     qword ptr [rsi+18h], 0Fh                                       ; +0xb4, 0x18004c614\njbe     short loc_18004C61E                                            ; +0xb9, 0x18004c619\nmov     rsi, [rsi]                                                     ; +0xbb, 0x18004c61b\nmov     rdi, [rbp+140h]                                                ; +0xbe, 0x18004c61e\ncall    ?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0xc5, 0x18004c625\nmov     rcx, rax; this                                                 ; +0xca, 0x18004c62a\nxor     r8d, r8d; bool                                                 ; +0xcd, 0x18004c62d\nmov     rdx, rsi; char *                                               ; +0xd0, 0x18004c630\ncall    ?addImage@CCTextureCache@cocos2d@@QEAAPEAVCCTexture2D@2@PEBD_N@Z; cocos2d::CCTextureCache::addImage(char const *,bool) ; +0xd3, 0x18004c633\nmov     rdx, rax                                                       ; +0xd8, 0x18004c638\nlea     rcx, [rbp+140h]                                                ; +0xdb, 0x18004c63b\ncall    qword ptr [rdi+18h]                                            ; +0xe2, 0x18004c642\nmov     rcx, rbp; this                                                 ; +0xe5, 0x18004c645\ncall    ?createFontChars@CCLabelBMFont@cocos2d@@QEAAXXZ; cocos2d::CCLabelBMFont::createFontChars(void) ; +0xe8, 0x18004c648\nmov     rsi, [rsp+28h+arg_0]                                           ; +0xed, 0x18004c64d\nmov     rdi, [rsp+28h+arg_8]                                           ; +0xf2, 0x18004c652\nmov     rbx, [rsp+28h+arg_10]                                          ; +0xf7, 0x18004c657\nadd     rsp, 20h                                                       ; +0xfc, 0x18004c65c\npop     rbp                                                            ; +0x100, 0x18004c660\nretn                                                                   ; +0x101, 0x18004c661", "xrefs": ["<???> @ 0x180137a60", "<???> @ 0x180137a94", "<???> @ 0x1801438a8", "<???> @ 0x1801b1a40"], "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"}