{"type": "func", "start": 5371390768, "end": 5371391271, "name": "SelectFontLayer::updateFontLabel", "pseudocode": "// \n// SelectFontLayer::updateFontLabel from 0x14028eb30 to 0x14028ed27 (503 bytes)\n// \n// 3 xrefs:\n// > SelectFontLayer::init @ 0x14028eafd\n// > SelectFontLayer::onChangeFont @ 0x14028edb8\n// > <???> @ 0x1406d18a4\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=3\nvoid SelectFontLayer::updateFontLabel(SelectFontLayer *a1)\n{\n  float v1; // xmm0_4\n  int m_fontIndex; // ebx\n  cocos2d::CCLabelBMFont *m_fontLabel; // rcx\n  cocos2d::CCString *v5; // rax\n  const char *CString; // rsi\n  GameManager *v7; // rcx\n  GameManager *v8; // rcx\n  GameManager *v9; // rbx\n  int m_loadedFont; // eax\n  int v11; // ebx\n  cocos2d::CCString *v12; // rax\n  const char *v13; // rax\n  cocos2d::CCLabelBMFont *v14; // rax\n  __int64 v15; // rcx\n  cocos2d::CCDirector *v16; // rax\n  cocos2d::CCLabelBMFont_vtbl *v17; // rbx\n  const cocos2d::CCPoint *v18; // rax\n  float v19; // [rsp+30h] [rbp+8h]\n  void *v20; // [rsp+38h] [rbp+10h]\n  void *v21; // [rsp+38h] [rbp+10h]\n  void *v22; // [rsp+38h] [rbp+10h]\n\n  m_fontIndex = a1->m_editorLayer->m_levelSettings->m_fontIndex;\n  if ( a1->m_font != m_fontIndex )\n  {\n    m_fontLabel = a1->m_fontLabel;\n    if ( m_fontLabel )\n    {\n      m_fontLabel->removeFromParent(m_fontLabel);\n      a1->m_fontLabel = nullptr;\n    }\n    a1->m_font = m_fontIndex;\n    v5 = cocos2d::CCString::createWithFormat(\"Font %i\", m_fontIndex + 1);\n    CString = cocos2d::CCString::getCString(v5);\n    v7 = (GameManager *)qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v20 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00((__int64)v20);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v7 = (GameManager *)qword_1406C2ED8;\n    }\n    GameManager::loadFont(v7, a1->m_font);\n    v8 = (GameManager *)qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v21 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00((__int64)v21);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v8 = (GameManager *)qword_1406C2ED8;\n    }\n    v9 = v8;\n    if ( !v8 )\n    {\n      v22 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00((__int64)v22);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v8 = (GameManager *)qword_1406C2ED8;\n    }\n    m_loadedFont = v9->m_loadedFont;\n    v11 = 59;\n    if ( m_loadedFont < 59 )\n      v11 = m_loadedFont;\n    if ( v11 <= 0 )\n    {\n      GameManager::loadFont(v8, 0);\n      v13 = (const char *)&qword_14052A4D8;\n    }\n    else\n    {\n      GameManager::loadFont(v8, v11);\n      v12 = cocos2d::CCString::createWithFormat(\"gjFont%02d.fnt\", v11);\n      v13 = cocos2d::CCString::getCString(v12);\n    }\n    v14 = cocos2d::CCLabelBMFont::create(CString, v13);\n    a1->m_fontLabel = v14;\n    a1->addChild_1(a1, v14);\n    v16 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v15);\n    cocos2d::CCDirector::getWinSize(v16);\n    v17 = a1->m_fontLabel->__vftable;\n    cocos2d::CCPoint::CCPoint(v1, v19 * 0.5);\n    v17->setPosition_0(a1->m_fontLabel, v18);\n  }\n}", "assembly": "; \n; SelectFontLayer::updateFontLabel from 0x14028eb30 to 0x14028ed27 (503 bytes)\n; \n; 3 xrefs:\n; > SelectFontLayer::init @ 0x14028eafd\n; > SelectFontLayer::onChangeFont @ 0x14028edb8\n; > <???> @ 0x1406d18a4\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, 0x14028eb30\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x14028eb35\npush    rdi                                                            ; +0xa, 0x14028eb3a\nsub     rsp, 20h                                                       ; +0xb, 0x14028eb3b\nmov     rdi, rcx                                                       ; +0xf, 0x14028eb3f\nmov     rax, [rcx+280h]                                                ; +0x12, 0x14028eb42\nmov     rdx, [rax+0DB0h]                                               ; +0x19, 0x14028eb49\nmov     ebx, [rdx+168h]                                                ; +0x20, 0x14028eb50\ncmp     [rcx+278h], ebx                                                ; +0x26, 0x14028eb56\njz      loc_14028ED17                                                  ; +0x2c, 0x14028eb5c\nmov     rcx, [rcx+288h]                                                ; +0x32, 0x14028eb62\ntest    rcx, rcx                                                       ; +0x39, 0x14028eb69\njz      short loc_14028EB82                                            ; +0x3c, 0x14028eb6c\nmov     rax, [rcx]                                                     ; +0x3e, 0x14028eb6e\ncall    qword ptr [rax+1F0h]                                           ; +0x41, 0x14028eb71\nmov     qword ptr [rdi+288h], 0                                        ; +0x47, 0x14028eb77\nmov     [rdi+278h], ebx                                                ; +0x52, 0x14028eb82\nlea     edx, [rbx+1]                                                   ; +0x58, 0x14028eb88\nlea     rcx, aFontI; \"Font %i\"                                         ; +0x5b, 0x14028eb8b\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x62, 0x14028eb92\nmov     rcx, rax                                                       ; +0x68, 0x14028eb98\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x6b, 0x14028eb9b\nmov     rsi, rax                                                       ; +0x71, 0x14028eba1\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x74, 0x14028eba4\ntest    rcx, rcx                                                       ; +0x7b, 0x14028ebab\njnz     short loc_14028EBDF                                            ; +0x7e, 0x14028ebae\nmov     ecx, 668h; Size                                                ; +0x80, 0x14028ebb0\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x85, 0x14028ebb5\nmov     [rsp+28h+arg_8], rax                                           ; +0x8a, 0x14028ebba\nmov     rcx, rax                                                       ; +0x8f, 0x14028ebbf\ncall    sub_14017AB00                                                  ; +0x92, 0x14028ebc2\nnop                                                                    ; +0x97, 0x14028ebc7\nmov     cs:qword_1406C2ED8, rax                                        ; +0x98, 0x14028ebc8\nmov     rdx, [rax]                                                     ; +0x9f, 0x14028ebcf\nmov     rcx, rax                                                       ; +0xa2, 0x14028ebd2\ncall    qword ptr [rdx+48h]                                            ; +0xa5, 0x14028ebd5\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xa8, 0x14028ebd8\nmov     edx, [rdi+278h]                                                ; +0xaf, 0x14028ebdf\ncall    GameManager__loadFont                                          ; +0xb5, 0x14028ebe5\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xba, 0x14028ebea\ntest    rcx, rcx                                                       ; +0xc1, 0x14028ebf1\njnz     short loc_14028EC25                                            ; +0xc4, 0x14028ebf4\nmov     ecx, 668h; Size                                                ; +0xc6, 0x14028ebf6\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xcb, 0x14028ebfb\nmov     [rsp+28h+arg_8], rax                                           ; +0xd0, 0x14028ec00\nmov     rcx, rax                                                       ; +0xd5, 0x14028ec05\ncall    sub_14017AB00                                                  ; +0xd8, 0x14028ec08\nnop                                                                    ; +0xdd, 0x14028ec0d\nmov     cs:qword_1406C2ED8, rax                                        ; +0xde, 0x14028ec0e\nmov     rdx, [rax]                                                     ; +0xe5, 0x14028ec15\nmov     rcx, rax                                                       ; +0xe8, 0x14028ec18\ncall    qword ptr [rdx+48h]                                            ; +0xeb, 0x14028ec1b\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xee, 0x14028ec1e\nmov     rbx, rcx                                                       ; +0xf5, 0x14028ec25\ntest    rcx, rcx                                                       ; +0xf8, 0x14028ec28\njnz     short loc_14028EC5C                                            ; +0xfb, 0x14028ec2b\nmov     ecx, 668h; Size                                                ; +0xfd, 0x14028ec2d\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x102, 0x14028ec32\nmov     [rsp+28h+arg_8], rax                                           ; +0x107, 0x14028ec37\nmov     rcx, rax                                                       ; +0x10c, 0x14028ec3c\ncall    sub_14017AB00                                                  ; +0x10f, 0x14028ec3f\nnop                                                                    ; +0x114, 0x14028ec44\nmov     cs:qword_1406C2ED8, rax                                        ; +0x115, 0x14028ec45\nmov     rdx, [rax]                                                     ; +0x11c, 0x14028ec4c\nmov     rcx, rax                                                       ; +0x11f, 0x14028ec4f\ncall    qword ptr [rdx+48h]                                            ; +0x122, 0x14028ec52\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x125, 0x14028ec55\nmov     eax, [rbx+3CCh]                                                ; +0x12c, 0x14028ec5c\nmov     ebx, 3Bh ; ';'                                                 ; +0x132, 0x14028ec62\ncmp     eax, ebx                                                       ; +0x137, 0x14028ec67\ncmovl   ebx, eax                                                       ; +0x139, 0x14028ec69\ntest    ebx, ebx                                                       ; +0x13c, 0x14028ec6c\njle     short loc_14028EC91                                            ; +0x13e, 0x14028ec6e\nmov     edx, ebx                                                       ; +0x140, 0x14028ec70\ncall    GameManager__loadFont                                          ; +0x142, 0x14028ec72\nmov     edx, ebx                                                       ; +0x147, 0x14028ec77\nlea     rcx, aGjfont02dFnt; \"gjFont%02d.fnt\"                           ; +0x149, 0x14028ec79\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x150, 0x14028ec80\nmov     rcx, rax                                                       ; +0x156, 0x14028ec86\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x159, 0x14028ec89\njmp     short loc_14028EC9F                                            ; +0x15f, 0x14028ec8f\nxor     edx, edx                                                       ; +0x161, 0x14028ec91\ncall    GameManager__loadFont                                          ; +0x163, 0x14028ec93\nlea     rax, qword_14052A4D8                                           ; +0x168, 0x14028ec98\nmov     rdx, rax                                                       ; +0x16f, 0x14028ec9f\nmov     rcx, rsi                                                       ; +0x172, 0x14028eca2\ncall    cs:?create@CCLabelBMFont@cocos2d@@SAPEAV12@PEBD0@Z; cocos2d::CCLabelBMFont::create(char const *,char const *) ; +0x175, 0x14028eca5\nmov     [rdi+288h], rax                                                ; +0x17b, 0x14028ecab\nmov     r8, [rdi]                                                      ; +0x182, 0x14028ecb2\nmov     rdx, rax                                                       ; +0x185, 0x14028ecb5\nmov     rcx, rdi                                                       ; +0x188, 0x14028ecb8\ncall    qword ptr [r8+1C0h]                                            ; +0x18b, 0x14028ecbb\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x192, 0x14028ecc2\nmov     rcx, rax                                                       ; +0x198, 0x14028ecc8\nlea     rdx, [rsp+28h+arg_0]                                           ; +0x19b, 0x14028eccb\ncall    cs:?getWinSize@CCDirector@cocos2d@@QEAA?AVCCSize@2@XZ; cocos2d::CCDirector::getWinSize(void) ; +0x1a0, 0x14028ecd0\nmov     rax, [rdi+288h]                                                ; +0x1a6, 0x14028ecd6\nmov     rbx, [rax]                                                     ; +0x1ad, 0x14028ecdd\nmovss   xmm2, [rsp+28h+arg_4]                                          ; +0x1b0, 0x14028ece0\nmulss   xmm2, cs:dword_140622B08                                       ; +0x1b6, 0x14028ece6\nmovss   xmm1, [rsp+28h+arg_0]                                          ; +0x1be, 0x14028ecee\nmulss   xmm1, cs:dword_140622B08                                       ; +0x1c4, 0x14028ecf4\nlea     rcx, [rsp+28h+arg_8]                                           ; +0x1cc, 0x14028ecfc\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x1d1, 0x14028ed01\nmov     rdx, rax                                                       ; +0x1d7, 0x14028ed07\nmov     rcx, [rdi+288h]                                                ; +0x1da, 0x14028ed0a\ncall    qword ptr [rbx+0B8h]                                           ; +0x1e1, 0x14028ed11\nmov     rbx, [rsp+28h+arg_10]                                          ; +0x1e7, 0x14028ed17\nmov     rsi, [rsp+28h+arg_18]                                          ; +0x1ec, 0x14028ed1c\nadd     rsp, 20h                                                       ; +0x1f1, 0x14028ed21\npop     rdi                                                            ; +0x1f5, 0x14028ed25\nretn                                                                   ; +0x1f6, 0x14028ed26", "xrefs": ["SelectFontLayer::init @ 0x14028eafd", "SelectFontLayer::onChangeFont @ 0x14028edb8", "<???> @ 0x1406d18a4"], "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"}