{"type": "func", "start": 6443129936, "end": 6443130299, "name": "cocos2d::CCTexture2D::initWithString", "pseudocode": "// \n// cocos2d::CCTexture2D::initWithString from 0x1800a5c50 to 0x1800a5dbb (363 bytes)\n// \n// 3 xrefs:\n// > cocos2d::CCLabelTTF::updateTexture @ 0x18004e980\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b7c80\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\nchar __fastcall cocos2d::CCTexture2D::initWithString(\n        cocos2d::CCTexture2D *this,\n        const char *a2,\n        char *a3,\n        float a4,\n        const struct cocos2d::CCSize *a5,\n        enum cocos2d::CCTextAlignment a6,\n        enum cocos2d::CCVerticalTextAlignment a7)\n{\n  char v10; // si\n  cocos2d::CCImage *v11; // rdi\n  int v12; // ebx\n  cocos2d::CCImage *v13; // rax\n  unsigned int m_nWidth; // esi\n  unsigned int m_nHeight; // ebx\n  cocos2d::CCInteger *v16; // rax\n  unsigned int Value; // eax\n  char inited; // si\n\n  v10 = 0;\n  v11 = nullptr;\n  if ( a7 )\n  {\n    if ( a7 == kCCVerticalTextAlignmentCenter )\n    {\n      if ( a6 == kCCTextAlignmentCenter )\n        v12 = 51;\n      else\n        v12 = (a6 != kCCTextAlignmentLeft) + 49;\n    }\n    else\n    {\n      if ( a7 != kCCVerticalTextAlignmentBottom )\n        return 0;\n      if ( a6 == kCCTextAlignmentCenter )\n        v12 = 35;\n      else\n        v12 = (a6 != kCCTextAlignmentLeft) + 33;\n    }\n  }\n  else if ( a6 == kCCTextAlignmentCenter )\n  {\n    v12 = 19;\n  }\n  else\n  {\n    v12 = (a6 != kCCTextAlignmentLeft) + 17;\n  }\n  v13 = (cocos2d::CCImage *)operator new(0x50u);\n  if ( v13 )\n    v11 = cocos2d::CCImage::CCImage(v13);\n  if ( v11 )\n  {\n    v10 = cocos2d::CCImage::initWithString((__int64)v11, a2, (int)a5->width, (int)a5->height, v12, a3, (int)a4);\n    if ( v10 )\n    {\n      m_nWidth = v11->m_nWidth;\n      m_nHeight = v11->m_nHeight;\n      v16 = (cocos2d::CCInteger *)cocos2d::CCConfiguration::sharedConfiguration();\n      Value = cocos2d::CCInteger::getValue(v16);\n      if ( m_nWidth <= Value && m_nHeight <= Value )\n      {\n        inited = cocos2d::CCTexture2D::initPremultipliedATextureWithImage(this, v11, m_nWidth, m_nHeight);\n        cocos2d::CCObject::release(v11);\n        return inited;\n      }\n      v10 = 0;\n      cocos2d::CCObject::release(v11);\n    }\n  }\n  return v10;\n}", "assembly": "; \n; cocos2d::CCTexture2D::initWithString from 0x1800a5c50 to 0x1800a5dbb (363 bytes)\n; \n; 3 xrefs:\n; > cocos2d::CCLabelTTF::updateTexture @ 0x18004e980\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b7c80\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, 0x1800a5c50\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x1800a5c55\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x1800a5c5a\npush    rdi                                                            ; +0xf, 0x1800a5c5f\npush    r14                                                            ; +0x10, 0x1800a5c60\npush    r15                                                            ; +0x12, 0x1800a5c62\nsub     rsp, 60h                                                       ; +0x14, 0x1800a5c64\nmovaps  [rsp+78h+var_28], xmm6                                         ; +0x18, 0x1800a5c68\nmovaps  xmm6, xmm3                                                     ; +0x1d, 0x1800a5c6d\nmov     r14, r8                                                        ; +0x20, 0x1800a5c70\nmov     r15, rdx                                                       ; +0x23, 0x1800a5c73\nmov     rbp, rcx                                                       ; +0x26, 0x1800a5c76\nxor     sil, sil                                                       ; +0x29, 0x1800a5c79\nxor     edi, edi                                                       ; +0x2c, 0x1800a5c7c\nmov     eax, [rsp+78h+arg_30]                                          ; +0x2e, 0x1800a5c7e\ntest    eax, eax                                                       ; +0x35, 0x1800a5c85\njnz     short loc_1800A5CA6                                            ; +0x37, 0x1800a5c87\nmov     eax, [rsp+78h+arg_28]                                          ; +0x39, 0x1800a5c89\ncmp     eax, 1                                                         ; +0x40, 0x1800a5c90\njnz     short loc_1800A5C9A                                            ; +0x43, 0x1800a5c93\nlea     ebx, [rdi+13h]                                                 ; +0x45, 0x1800a5c95\njmp     short loc_1800A5CEC                                            ; +0x48, 0x1800a5c98\nmov     ebx, edi                                                       ; +0x4a, 0x1800a5c9a\ntest    eax, eax                                                       ; +0x4c, 0x1800a5c9c\nsetnz   bl                                                             ; +0x4e, 0x1800a5c9e\nadd     ebx, 11h                                                       ; +0x51, 0x1800a5ca1\njmp     short loc_1800A5CEC                                            ; +0x54, 0x1800a5ca4\ncmp     eax, 1                                                         ; +0x56, 0x1800a5ca6\njnz     short loc_1800A5CC8                                            ; +0x59, 0x1800a5ca9\nmov     eax, [rsp+78h+arg_28]                                          ; +0x5b, 0x1800a5cab\ncmp     eax, 1                                                         ; +0x62, 0x1800a5cb2\njnz     short loc_1800A5CBC                                            ; +0x65, 0x1800a5cb5\nlea     ebx, [rax+32h]                                                 ; +0x67, 0x1800a5cb7\njmp     short loc_1800A5CEC                                            ; +0x6a, 0x1800a5cba\nmov     ebx, edi                                                       ; +0x6c, 0x1800a5cbc\ntest    eax, eax                                                       ; +0x6e, 0x1800a5cbe\nsetnz   bl                                                             ; +0x70, 0x1800a5cc0\nadd     ebx, 31h ; '1'                                                 ; +0x73, 0x1800a5cc3\njmp     short loc_1800A5CEC                                            ; +0x76, 0x1800a5cc6\ncmp     eax, 2                                                         ; +0x78, 0x1800a5cc8\njnz     loc_1800A5D9A                                                  ; +0x7b, 0x1800a5ccb\nmov     eax, [rsp+78h+arg_28]                                          ; +0x81, 0x1800a5cd1\ncmp     eax, 1                                                         ; +0x88, 0x1800a5cd8\njnz     short loc_1800A5CE2                                            ; +0x8b, 0x1800a5cdb\nlea     ebx, [rax+22h]                                                 ; +0x8d, 0x1800a5cdd\njmp     short loc_1800A5CEC                                            ; +0x90, 0x1800a5ce0\nmov     ebx, edi                                                       ; +0x92, 0x1800a5ce2\ntest    eax, eax                                                       ; +0x94, 0x1800a5ce4\nsetnz   bl                                                             ; +0x96, 0x1800a5ce6\nadd     ebx, 21h ; '!'                                                 ; +0x99, 0x1800a5ce9\nmov     ecx, 50h ; 'P'; Size                                           ; +0x9c, 0x1800a5cec\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xa1, 0x1800a5cf1\nmov     [rsp+78h+var_38], rax                                          ; +0xa6, 0x1800a5cf6\ntest    rax, rax                                                       ; +0xab, 0x1800a5cfb\njz      short loc_1800A5D0B                                            ; +0xae, 0x1800a5cfe\nmov     rcx, rax; this                                                 ; +0xb0, 0x1800a5d00\ncall    ??0CCImage@cocos2d@@QEAA@XZ; cocos2d::CCImage::CCImage(void)   ; +0xb3, 0x1800a5d03\nmov     rdi, rax                                                       ; +0xb8, 0x1800a5d08\ntest    rdi, rdi                                                       ; +0xbb, 0x1800a5d0b\njz      loc_1800A5D94                                                  ; +0xbe, 0x1800a5d0e\ncvttss2si ecx, xmm6                                                    ; +0xc4, 0x1800a5d14\nmov     rax, [rsp+78h+arg_20]                                          ; +0xc8, 0x1800a5d18\ncvttss2si r9d, dword ptr [rax+4]                                       ; +0xd0, 0x1800a5d20\ncvttss2si r8d, dword ptr [rax]                                         ; +0xd6, 0x1800a5d26\nmov     [rsp+78h+var_48], ecx                                          ; +0xdb, 0x1800a5d2b\nmov     [rsp+78h+var_50], r14                                          ; +0xdf, 0x1800a5d2f\nmov     [rsp+78h+var_58], ebx                                          ; +0xe4, 0x1800a5d34\nmov     rdx, r15                                                       ; +0xe8, 0x1800a5d38\nmov     rcx, rdi                                                       ; +0xeb, 0x1800a5d3b\ncall    ?initWithString@CCImage@cocos2d@@QEAA_NPEBDHHW4ETextAlign@12@0H@Z; cocos2d::CCImage::initWithString(char const *,int,int,cocos2d::CCImage::ETextAlign,char const *,int) ; +0xee, 0x1800a5d3e\nmovzx   esi, al                                                        ; +0xf3, 0x1800a5d43\ntest    al, al                                                         ; +0xf6, 0x1800a5d46\njz      short loc_1800A5D94                                            ; +0xf8, 0x1800a5d48\nmovzx   esi, word ptr [rdi+38h]                                        ; +0xfa, 0x1800a5d4a\nmovzx   ebx, word ptr [rdi+3Ah]                                        ; +0xfe, 0x1800a5d4e\ncall    ?sharedConfiguration@CCConfiguration@cocos2d@@SAPEAV12@XZ; cocos2d::CCConfiguration::sharedConfiguration(void) ; +0x102, 0x1800a5d52\nmov     rcx, rax; this                                                 ; +0x107, 0x1800a5d57\ncall    ?getValue@CCInteger@cocos2d@@QEBAHXZ; cocos2d::CCInteger::getValue(void) ; +0x10a, 0x1800a5d5a\ncmp     esi, eax                                                       ; +0x10f, 0x1800a5d5f\nja      short loc_1800A5D89                                            ; +0x111, 0x1800a5d61\ncmp     ebx, eax                                                       ; +0x113, 0x1800a5d63\nja      short loc_1800A5D89                                            ; +0x115, 0x1800a5d65\nmov     r9d, ebx; unsigned int                                         ; +0x117, 0x1800a5d67\nmov     r8d, esi; unsigned int                                         ; +0x11a, 0x1800a5d6a\nmov     rdx, rdi; struct cocos2d::CCImage *                            ; +0x11d, 0x1800a5d6d\nmov     rcx, rbp; this                                                 ; +0x120, 0x1800a5d70\ncall    ?initPremultipliedATextureWithImage@CCTexture2D@cocos2d@@AEAA_NPEAVCCImage@2@II@Z; cocos2d::CCTexture2D::initPremultipliedATextureWithImage(cocos2d::CCImage *,uint,uint) ; +0x123, 0x1800a5d73\nmovzx   esi, al                                                        ; +0x128, 0x1800a5d78\nmov     rcx, rdi; this                                                 ; +0x12b, 0x1800a5d7b\ncall    ?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x12e, 0x1800a5d7e\nmovzx   eax, sil                                                       ; +0x133, 0x1800a5d83\njmp     short loc_1800A5D9C                                            ; +0x137, 0x1800a5d87\nxor     sil, sil                                                       ; +0x139, 0x1800a5d89\nmov     rcx, rdi; this                                                 ; +0x13c, 0x1800a5d8c\ncall    ?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x13f, 0x1800a5d8f\nmovzx   eax, sil                                                       ; +0x144, 0x1800a5d94\njmp     short loc_1800A5D9C                                            ; +0x148, 0x1800a5d98\nxor     al, al                                                         ; +0x14a, 0x1800a5d9a\nlea     r11, [rsp+78h+var_18]                                          ; +0x14c, 0x1800a5d9c\nmov     rbx, [r11+20h]                                                 ; +0x151, 0x1800a5da1\nmov     rbp, [r11+28h]                                                 ; +0x155, 0x1800a5da5\nmov     rsi, [r11+30h]                                                 ; +0x159, 0x1800a5da9\nmovaps  xmm6, [rsp+78h+var_28]                                         ; +0x15d, 0x1800a5dad\nmov     rsp, r11                                                       ; +0x162, 0x1800a5db2\npop     r15                                                            ; +0x165, 0x1800a5db5\npop     r14                                                            ; +0x167, 0x1800a5db7\npop     rdi                                                            ; +0x169, 0x1800a5db9\nretn                                                                   ; +0x16a, 0x1800a5dba", "xrefs": ["cocos2d::CCLabelTTF::updateTexture @ 0x18004e980", "<???> @ 0x1801438a8", "<???> @ 0x1801b7c80"], "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"}