{"type": "func", "start": 4146296, "end": 4146740, "name": "EmoteSprite::attachToLabel", "pseudocode": "// \n// EmoteSprite::attachToLabel from 0x3f4478 to 0x3f4634 (444 bytes)\n// \n// 6 xrefs:\n// > CCTextInputNode::updateLabel @ 0x3e3162\n// > CommentCell::loadFromComment @ 0x433362\n// > NewsPopup::rebuildPage @ 0x6c1ea8\n// > InvitesPopup::buildRows @ 0x759736\n// > EditorSoundConfigUploadPopup::init @ 0x7897b8\n// > ReportPopup::init @ 0x7a0b06\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:47:16 +0000\n// \n\nint __fastcall EmoteSprite::attachToLabel(int result, int a2, _DWORD *a3, float a4)\n{\n  int v6; // r4\n  float v7; // s16\n  float *v8; // r0\n  float v9; // s16\n  unsigned int v10; // r5\n  float v11; // s17\n  float v12; // s15\n  float v13; // s18\n  int v14; // r0\n  const char *v15; // r0\n  const char *v16; // r6\n  size_t v17; // r0\n  int (__fastcall *v18)(int, int); // r10\n  int v19; // r0\n  int v20; // r10\n  cocos2d::CCSprite *v21; // r6\n  int v22; // r0\n  int v23; // r0\n  float v24; // r0\n  void (__fastcall *v25)(int, cocos2d::CCSprite *, int); // r10\n  int v26; // r0\n  void (__fastcall *v27)(cocos2d::CCSprite *, _BYTE *); // [sp+4h] [bp-40h]\n  int v28; // [sp+8h] [bp-3Ch]\n  _BYTE v29[8]; // [sp+10h] [bp-34h] BYREF\n  _BYTE v30[8]; // [sp+18h] [bp-2Ch] BYREF\n  _BYTE v31[8]; // [sp+20h] [bp-24h] BYREF\n  _BYTE v32[8]; // [sp+28h] [bp-1Ch] BYREF\n  int v33[3]; // [sp+30h] [bp-14h] BYREF\n\n  v6 = result;\n  v7 = a4;\n  if ( result && a2 )\n  {\n    if ( a4 <= 0.0 )\n    {\n      v8 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)result + 164))(result);\n      v9 = v8[1];\n      v7 = v9 * COERCE_FLOAT(EmoteSprite::heightFactor((EmoteSprite *)v8));\n    }\n    v10 = 0;\n    v11 = *(float *)(*(int (__fastcall **)(int))(*(_DWORD *)v6 + 152))(v6);\n    v12 = *(float *)(*(int (__fastcall **)(int))(*(_DWORD *)v6 + 164))(v6);\n    v13 = *(float *)((*(int (__fastcall **)(int))(*(_DWORD *)v6 + 152))(v6) + 4);\n    v14 = (*(int (__fastcall **)(int))(*(_DWORD *)v6 + 164))(v6);\n    cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29, v11 * v12, v13 * *(float *)(v14 + 4));\n    v15 = (const char *)(*(int (__fastcall **)(int))(*(_DWORD *)v6 + 472))(v6);\n    memset(v33, 0, sizeof(v33));\n    v16 = v15;\n    v17 = strlen(v15);\n    std::string::__init(v33, v16, v17);\n    while ( v10 < -1431655765 * ((a3[1] - *a3) >> 2) )\n    {\n      v18 = *(int (__fastcall **)(int, int))(*(_DWORD *)v6 + 240);\n      v19 = EmoteSprite::charIndexForByte((unsigned __int8 *)v33, *(_DWORD *)(*a3 + 12 * v10));\n      v20 = v18(v6, v19);\n      if ( v20 )\n      {\n        v21 = EmoteSprite::createWithDef(*(_DWORD *)(12 * v10 + *a3 + 8));\n        if ( v21 )\n        {\n          v22 = (*(int (__fastcall **)(int))(*(_DWORD *)v20 + 96))(v20);\n          cocos2d::CCPoint::operator-(v30, v22, v29);\n          v27 = *(void (__fastcall **)(cocos2d::CCSprite *, _BYTE *))(*(_DWORD *)v21 + 92);\n          v28 = (*(int (__fastcall **)(int))(*(_DWORD *)v6 + 96))(v6);\n          v23 = (*(int (__fastcall **)(int))(*(_DWORD *)v6 + 84))(v6);\n          cocos2d::CCPoint::operator*(v31, v30, v23);\n          cocos2d::CCPoint::operator+(v32, v28, v31);\n          v27(v21, v32);\n          v24 = (*(float (__fastcall **)(int))(*(_DWORD *)v6 + 84))(v6);\n          EmoteSprite::fitToHeight(v21, v7 * v24, 0.0);\n          v25 = *(void (__fastcall **)(int, cocos2d::CCSprite *, int))(*(_DWORD *)a2 + 232);\n          v26 = (*(int (__fastcall **)(int))(*(_DWORD *)v6 + 52))(v6);\n          v25(a2, v21, v26 + 1);\n        }\n      }\n      ++v10;\n    }\n    return std::string::~string((int)v33);\n  }\n  return result;\n}", "assembly": "; \n; EmoteSprite::attachToLabel from 0x3f4478 to 0x3f4634 (444 bytes)\n; \n; 6 xrefs:\n; > CCTextInputNode::updateLabel @ 0x3e3162\n; > CommentCell::loadFromComment @ 0x433362\n; > NewsPopup::rebuildPage @ 0x6c1ea8\n; > InvitesPopup::buildRows @ 0x759736\n; > EditorSoundConfigUploadPopup::init @ 0x7897b8\n; > ReportPopup::init @ 0x7a0b06\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:47:16 +0000\n; \nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x3f4478\nMOV             R8, R2                                                 ; +0x4, 0x3f447c\nVPUSH           {D8-D9}                                                ; +0x6, 0x3f447e\nMOV             R9, R1                                                 ; +0xa, 0x3f4482\nMOV             R4, R0                                                 ; +0xc, 0x3f4484\nVMOV            S16, R3                                                ; +0xe, 0x3f4486\nLDR             R3, =(__stack_chk_guard_ptr - 0x3F4492)                ; +0x12, 0x3f448a\nSUB             SP, SP, #0x44                                          ; +0x14, 0x3f448c\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x16, 0x3f448e\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x18, 0x3f4490\nSTR             R3, [SP,#0x44+var_38]                                  ; +0x1a, 0x3f4492\nLDR             R2, [R3]                                               ; +0x1c, 0x3f4494\nSTR             R2, [SP,#0x44+var_8]                                   ; +0x1e, 0x3f4496\nCMP             R0, #0                                                 ; +0x20, 0x3f4498\nBEQ.W           loc_3F461C                                             ; +0x22, 0x3f449a\nCMP             R1, #0                                                 ; +0x26, 0x3f449e\nBEQ.W           loc_3F461C                                             ; +0x28, 0x3f44a0\nVCMPE.F32       S16, #0.0                                              ; +0x2c, 0x3f44a4\nVMRS            APSR_nzcv, FPSCR                                       ; +0x30, 0x3f44a8\nBHI             loc_3F44C6                                             ; +0x34, 0x3f44ac\nLDR             R3, [R0]                                               ; +0x36, 0x3f44ae\nLDR.W           R3, [R3,#0xA4]                                         ; +0x38, 0x3f44b0\nBLX             R3                                                     ; +0x3c, 0x3f44b4\nVLDR            S16, [R0,#4]                                           ; +0x3e, 0x3f44b6\nBL              _ZN11EmoteSprite12heightFactorEv; EmoteSprite::heightFactor(void) ; +0x42, 0x3f44ba\nVMOV            S15, R0                                                ; +0x46, 0x3f44be\nVMUL.F32        S16, S16, S15                                          ; +0x4a, 0x3f44c2\nLDR             R3, [R4]                                               ; +0x4e, 0x3f44c6\nMOV             R0, R4                                                 ; +0x50, 0x3f44c8\nMOVS            R5, #0                                                 ; +0x52, 0x3f44ca\nADD             R7, SP, #0x44+var_14                                   ; +0x54, 0x3f44cc\nLDR.W           R3, [R3,#0x98]                                         ; +0x56, 0x3f44ce\nBLX             R3                                                     ; +0x5a, 0x3f44d2\nLDR             R3, [R4]                                               ; +0x5c, 0x3f44d4\nLDR.W           R3, [R3,#0xA4]                                         ; +0x5e, 0x3f44d6\nVLDR            S17, [R0]                                              ; +0x62, 0x3f44da\nMOV             R0, R4                                                 ; +0x66, 0x3f44de\nBLX             R3                                                     ; +0x68, 0x3f44e0\nLDR             R3, [R4]                                               ; +0x6a, 0x3f44e2\nLDR.W           R3, [R3,#0x98]                                         ; +0x6c, 0x3f44e4\nVLDR            S15, [R0]                                              ; +0x70, 0x3f44e8\nMOV             R0, R4                                                 ; +0x74, 0x3f44ec\nVMUL.F32        S17, S17, S15                                          ; +0x76, 0x3f44ee\nBLX             R3                                                     ; +0x7a, 0x3f44f2\nLDR             R3, [R4]                                               ; +0x7c, 0x3f44f4\nLDR.W           R3, [R3,#0xA4]                                         ; +0x7e, 0x3f44f6\nVLDR            S18, [R0,#4]                                           ; +0x82, 0x3f44fa\nMOV             R0, R4                                                 ; +0x86, 0x3f44fe\nBLX             R3                                                     ; +0x88, 0x3f4500\nADD             R3, SP, #0x44+var_34                                   ; +0x8a, 0x3f4502\nSTR             R3, [SP,#0x44+var_44]                                  ; +0x8c, 0x3f4504\nVMOV            R1, S17; float                                         ; +0x8e, 0x3f4506\nVLDR            S15, [R0,#4]                                           ; +0x92, 0x3f450a\nMOV             R0, R3; this                                           ; +0x96, 0x3f450e\nVMUL.F32        S15, S18, S15                                          ; +0x98, 0x3f4510\nVMOV            R2, S15; float                                         ; +0x9c, 0x3f4514\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0xa0, 0x3f4518\nLDR             R3, [R4]                                               ; +0xa4, 0x3f451c\nMOV             R0, R4                                                 ; +0xa6, 0x3f451e\nLDR.W           R3, [R3,#0x1D8]                                        ; +0xa8, 0x3f4520\nBLX             R3                                                     ; +0xac, 0x3f4524\nSTR             R5, [SP,#0x44+var_14]                                  ; +0xae, 0x3f4526\nSTR             R5, [SP,#0x44+var_10]                                  ; +0xb0, 0x3f4528\nSTR             R5, [SP,#0x44+var_C]                                   ; +0xb2, 0x3f452a\nMOV             R6, R0                                                 ; +0xb4, 0x3f452c\nBLX             strlen                                                 ; +0xb6, 0x3f452e\nMOV             R1, R6                                                 ; +0xba, 0x3f4532\nMOV             R2, R0                                                 ; +0xbc, 0x3f4534\nMOV             R0, R7                                                 ; +0xbe, 0x3f4536\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0xc0, 0x3f4538\nLDM.W           R8, {R2,R3}                                            ; +0xc4, 0x3f453c\nLDR             R1, =0xAAAAAAAB                                        ; +0xc8, 0x3f4540\nSUBS            R3, R3, R2                                             ; +0xca, 0x3f4542\nASRS            R3, R3, #2                                             ; +0xcc, 0x3f4544\nMULS            R3, R1                                                 ; +0xce, 0x3f4546\nCMP             R5, R3                                                 ; +0xd0, 0x3f4548\nBCS             loc_3F460A                                             ; +0xd2, 0x3f454a\nLDR             R3, [R4]                                               ; +0xd4, 0x3f454c\nMOV             R0, R7                                                 ; +0xd6, 0x3f454e\nLDR.W           R10, [R3,#0xF0]                                        ; +0xd8, 0x3f4550\nMOVS            R3, #0xC                                               ; +0xdc, 0x3f4554\nMUL             R6, R3, R5                                             ; +0xde, 0x3f4556\nLDR             R1, [R2,R6]                                            ; +0xe2, 0x3f455a\nBL              _ZN11EmoteSprite16charIndexForByteERKNSt6__ndk112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEi; EmoteSprite::charIndexForByte(std::string const&,int) ; +0xe4, 0x3f455c\nMOV             R1, R0                                                 ; +0xe8, 0x3f4560\nMOV             R0, R4                                                 ; +0xea, 0x3f4562\nBLX             R10                                                    ; +0xec, 0x3f4564\nMOV             R10, R0                                                ; +0xee, 0x3f4566\nCMP             R0, #0                                                 ; +0xf0, 0x3f4568\nBEQ             loc_3F4606                                             ; +0xf2, 0x3f456a\nLDR.W           R3, [R8]                                               ; +0xf4, 0x3f456c\nADD             R6, R3                                                 ; +0xf8, 0x3f4570\nLDR             R0, [R6,#8]                                            ; +0xfa, 0x3f4572\nBL              _ZN11EmoteSprite13createWithDefEPK8EmoteDef; EmoteSprite::createWithDef(EmoteDef const*) ; +0xfc, 0x3f4574\nMOV             R6, R0                                                 ; +0x100, 0x3f4578\nCMP             R0, #0                                                 ; +0x102, 0x3f457a\nBEQ             loc_3F4606                                             ; +0x104, 0x3f457c\nLDR.W           R3, [R10]                                              ; +0x106, 0x3f457e\nMOV             R0, R10                                                ; +0x10a, 0x3f4582\nLDR             R3, [R3,#0x60]                                         ; +0x10c, 0x3f4584\nBLX             R3                                                     ; +0x10e, 0x3f4586\nADD.W           R10, SP, #0x44+var_2C                                  ; +0x110, 0x3f4588\nMOV             R1, R0                                                 ; +0x114, 0x3f458c\nLDR             R2, [SP,#0x44+var_44]                                  ; +0x116, 0x3f458e\nMOV             R0, R10                                                ; +0x118, 0x3f4590\nBL              _ZNK7cocos2d7CCPointmiERKS0_; cocos2d::CCPoint::operator-(cocos2d::CCPoint const&) ; +0x11a, 0x3f4592\nLDR             R3, [R6]                                               ; +0x11e, 0x3f4596\nMOV             R0, R4                                                 ; +0x120, 0x3f4598\nLDR             R3, [R3,#0x5C]                                         ; +0x122, 0x3f459a\nSTR             R3, [SP,#0x44+var_40]                                  ; +0x124, 0x3f459c\nLDR             R3, [R4]                                               ; +0x126, 0x3f459e\nLDR             R3, [R3,#0x60]                                         ; +0x128, 0x3f45a0\nBLX             R3                                                     ; +0x12a, 0x3f45a2\nLDR             R3, [R4]                                               ; +0x12c, 0x3f45a4\nSTR             R0, [SP,#0x44+var_3C]                                  ; +0x12e, 0x3f45a6\nMOV             R0, R4                                                 ; +0x130, 0x3f45a8\nLDR             R3, [R3,#0x54]                                         ; +0x132, 0x3f45aa\nBLX             R3                                                     ; +0x134, 0x3f45ac\nADD.W           R11, SP, #0x44+var_24                                  ; +0x136, 0x3f45ae\nMOV             R2, R0                                                 ; +0x13a, 0x3f45b2\nMOV             R1, R10                                                ; +0x13c, 0x3f45b4\nMOV             R0, R11                                                ; +0x13e, 0x3f45b6\nBL              _ZNK7cocos2d7CCPointmlEf; cocos2d::CCPoint::operator*(float) ; +0x140, 0x3f45b8\nADD.W           R10, SP, #0x44+var_1C                                  ; +0x144, 0x3f45bc\nLDR             R1, [SP,#0x44+var_3C]                                  ; +0x148, 0x3f45c0\nMOV             R2, R11                                                ; +0x14a, 0x3f45c2\nMOV             R0, R10                                                ; +0x14c, 0x3f45c4\nBL              _ZNK7cocos2d7CCPointplERKS0_; cocos2d::CCPoint::operator+(cocos2d::CCPoint const&) ; +0x14e, 0x3f45c6\nMOV             R0, R6                                                 ; +0x152, 0x3f45ca\nMOV             R1, R10                                                ; +0x154, 0x3f45cc\nLDR             R3, [SP,#0x44+var_40]                                  ; +0x156, 0x3f45ce\nBLX             R3                                                     ; +0x158, 0x3f45d0\nLDR             R3, [R4]                                               ; +0x15a, 0x3f45d2\nMOV             R0, R4                                                 ; +0x15c, 0x3f45d4\nLDR             R3, [R3,#0x54]                                         ; +0x15e, 0x3f45d6\nBLX             R3                                                     ; +0x160, 0x3f45d8\nVMOV            S15, R0                                                ; +0x162, 0x3f45da\nMOVS            R2, #0; float                                          ; +0x166, 0x3f45de\nMOV             R0, R6; this                                           ; +0x168, 0x3f45e0\nVMUL.F32        S15, S16, S15                                          ; +0x16a, 0x3f45e2\nVMOV            R1, S15; float                                         ; +0x16e, 0x3f45e6\nBL              _ZN11EmoteSprite11fitToHeightEff; EmoteSprite::fitToHeight(float,float) ; +0x172, 0x3f45ea\nLDR.W           R3, [R9]                                               ; +0x176, 0x3f45ee\nMOV             R0, R4                                                 ; +0x17a, 0x3f45f2\nLDR.W           R10, [R3,#0xE8]                                        ; +0x17c, 0x3f45f4\nLDR             R3, [R4]                                               ; +0x180, 0x3f45f8\nLDR             R3, [R3,#0x34]                                         ; +0x182, 0x3f45fa\nBLX             R3                                                     ; +0x184, 0x3f45fc\nADDS            R2, R0, #1                                             ; +0x186, 0x3f45fe\nMOV             R1, R6                                                 ; +0x188, 0x3f4600\nMOV             R0, R9                                                 ; +0x18a, 0x3f4602\nBLX             R10                                                    ; +0x18c, 0x3f4604\nADDS            R5, #1                                                 ; +0x18e, 0x3f4606\nB               loc_3F453C                                             ; +0x190, 0x3f4608\nMOV             R0, R7                                                 ; +0x192, 0x3f460a\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x194, 0x3f460c\nB               loc_3F461C                                             ; +0x198, 0x3f4610\nMOV             R0, R7                                                 ; +0x19a, 0x3f4612\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x19c, 0x3f4614\nBL              __cxa_end_cleanup                                      ; +0x1a0, 0x3f4618\nLDR             R3, [SP,#0x44+var_38]                                  ; +0x1a4, 0x3f461c\nLDR             R2, [SP,#0x44+var_8]                                   ; +0x1a6, 0x3f461e\nLDR             R3, [R3]                                               ; +0x1a8, 0x3f4620\nCMP             R2, R3                                                 ; +0x1aa, 0x3f4622\nBEQ             loc_3F462A                                             ; +0x1ac, 0x3f4624\nBLX             __stack_chk_fail                                       ; +0x1ae, 0x3f4626\nADD             SP, SP, #0x44 ; 'D'                                    ; +0x1b2, 0x3f462a\nVPOP            {D8-D9}                                                ; +0x1b4, 0x3f462c\nPOP.W           {R4-R11,PC}                                            ; +0x1b8, 0x3f4630", "xrefs": ["CCTextInputNode::updateLabel @ 0x3e3162", "CommentCell::loadFromComment @ 0x433362", "NewsPopup::rebuildPage @ 0x6c1ea8", "InvitesPopup::buildRows @ 0x759736", "EditorSoundConfigUploadPopup::init @ 0x7897b8", "ReportPopup::init @ 0x7a0b06"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "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"}