// // cocos2d::CCLabelBMFont::updateLabel from 0x7d3e9c to 0x7d4374 (1240 bytes) // // 0 xrefs: // // This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False! // // Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings // Generated at Fri, 27 Nov 2026 12:00:37 +0000 // char **__fastcall cocos2d::CCLabelBMFont::updateLabel(cocos2d::CCLabelBMFont *this) { char **result; // r0 const unsigned __int16 *v3; // r1 unsigned int v4; // r5 float LetterPosXLeft; // s16 unsigned int v6; // r7 int v7; // r10 int v8; // r8 unsigned int v9; // r6 float v10; // s17 int v11; // r9 int v12; // r12 int v13; // r0 cocos2d::CCSprite *v14; // r11 unsigned __int16 v15; // r1 int v16; // r2 int v17; // r6 int v18; // r8 unsigned int v19; // r0 char *v20; // r0 int v21; // r3 char *v22; // r5 int v23; // r5 int v24; // r0 int v25; // r8 int v26; // r7 _WORD *v27; // r1 int v28; // r2 int v29; // r6 int v30; // r0 int v31; // r9 float v32; // s16 float *v33; // r0 int v34; // r3 float v35; // s16 float v36; // s16 char *v37; // r3 int v38; // r9 int v39; // r0 int v40; // [sp+0h] [bp-4Ch] int v41; // [sp+0h] [bp-4Ch] cocos2d::CCArray *v42; // [sp+4h] [bp-48h] cocos2d::CCArray *v43; // [sp+4h] [bp-48h] int v44; // [sp+Ch] [bp-40h] int v45; // [sp+Ch] [bp-40h] float *v46; // [sp+10h] [bp-3Ch] int v47; // [sp+14h] [bp-38h] unsigned __int16 v48; // [sp+1Ch] [bp-30h] BYREF __int16 v49; // [sp+1Eh] [bp-2Eh] BYREF char *v50[3]; // [sp+20h] [bp-2Ch] BYREF char *v51; // [sp+2Ch] [bp-20h] BYREF void *v52; // [sp+30h] [bp-1Ch] unsigned int v53; // [sp+34h] [bp-18h] void *v54; // [sp+38h] [bp-14h] BYREF char *v55; // [sp+3Ch] [bp-10h] char *v56; // [sp+40h] [bp-Ch] result = (char **)(*(int (__fastcall **)(cocos2d::CCLabelBMFont *, _DWORD, _DWORD))(*(_DWORD *)this + 552))( this, *((_DWORD *)this + 78), 0); if ( *((float *)this + 83) > 0.0 ) { cocos2d::cc_utf16_vec_from_utf16_str((cocos2d *)v50, *((cocos2d **)this + 74)); v4 = 0; v51 = nullptr; v52 = nullptr; v53 = 0; LetterPosXLeft = -1.0; v6 = (v50[1] - v50[0]) >> 1; v7 = 0; v8 = 0; v9 = 0; std::vector::reserve(&v51, v6); v54 = nullptr; v55 = nullptr; v56 = nullptr; std::vector::reserve(&v54, v6); v10 = -1.0; v40 = 0; v42 = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)this + 244))(this); while ( v4 < cocos2d::CCArray::count(v42) ) { v11 = 0; v12 = v40 + v4; while ( 1 ) { v44 = v12; v13 = (*(int (__fastcall **)(cocos2d::CCLabelBMFont *, int))(*(_DWORD *)this + 240))(this, v12 + v11); v12 = v44; v14 = (cocos2d::CCSprite *)v13; if ( v13 ) break; ++v11; } v40 += v11; if ( (*(int (__fastcall **)(int))(*(_DWORD *)v13 + 176))(v13) ) { if ( v9 >= v6 ) break; v48 = *(_WORD *)&v50[0][2 * v9]; if ( !v7 ) LetterPosXLeft = cocos2d::CCLabelBMFont::getLetterPosXLeft(this, v14); if ( !v8 ) v10 = LetterPosXLeft; if ( v48 == 10 ) { cocos2d::cc_utf8_trim_ws(&v54); v49 = 10; if ( v55 >= v56 ) { std::vector::__push_back_slow_path((int *)&v54, &v49); } else { if ( v55 ) *(_WORD *)v55 = 10; v55 += 2; } v9 += v11; std::vector::insert>( &v51, (char *)v52, (__int16 *)v54, v55); v55 -= 2 * ((unsigned int)(v55 - (_BYTE *)v54) >> 1); if ( v9 >= v6 ) break; LetterPosXLeft = -1.0; v8 = 0; v48 = *(_WORD *)&v50[0][2 * v9]; v10 = -1.0; } else { v8 = 1; } if ( cocos2d::isspace_unicode((cocos2d *)v48, v15) ) { if ( v55 == v56 ) { std::vector::__push_back_slow_path((int *)&v54, &v48); } else { if ( v55 ) *(_WORD *)v55 = v48; v55 += 2; } ++v9; LetterPosXLeft = -1.0; std::vector::insert>( &v51, (char *)v52, (__int16 *)v54, v55); v7 = 0; v55 -= 2 * ((unsigned int)(v55 - (_BYTE *)v54) >> 1); } else if ( (float)(cocos2d::CCLabelBMFont::getLetterPosXRight(this, v14, 0.0) - v10) <= *((float *)this + 83) ) { if ( v55 == v56 ) { std::vector::__push_back_slow_path((int *)&v54, &v48); } else { if ( v55 ) *(_WORD *)v55 = v48; v55 += 2; } ++v9; v7 = v8; } else { if ( *((_BYTE *)this + 340) ) { cocos2d::cc_utf8_trim_ws(&v54); v49 = 10; if ( v55 >= v56 ) { std::vector::__push_back_slow_path((int *)&v54, &v49); } else { if ( v55 ) *(_WORD *)v55 = 10; v55 += 2; } std::vector::insert>( &v51, (char *)v52, (__int16 *)v54, v55); v55 -= 2 * ((unsigned int)(v55 - (_BYTE *)v54) >> 1); if ( v9 >= v6 ) break; LetterPosXLeft = -1.0; --v4; v7 = 0; v10 = -1.0; } else { if ( v55 == v56 ) { std::vector::__push_back_slow_path((int *)&v54, &v48); } else { v16 = v48; if ( v55 ) *(_WORD *)v55 = v48; v55 += 2; } if ( cocos2d::cc_utf8_find_last_not_char(&v51, 32, v16) == -1 ) v52 = (char *)v52 - 2 * ((unsigned int)((_BYTE *)v52 - v51) >> 1); else cocos2d::cc_utf8_trim_ws(&v51); if ( (unsigned int)((_BYTE *)v52 - v51) >> 1 ) { v49 = 10; if ( (unsigned int)v52 >= v53 ) { std::vector::__push_back_slow_path((int *)&v51, &v49); } else { if ( v52 ) *(_WORD *)v52 = 10; v52 = (char *)v52 + 2; } } v10 = -1.0; ++v9; v7 = v8; } v8 = 0; } } ++v4; } std::vector::insert>(&v51, (char *)v52, (__int16 *)v54, v55); v17 = (_BYTE *)v52 - v51; v18 = ((_BYTE *)v52 - v51) >> 1; if ( (unsigned int)(v18 + 1) > 0x3F800000 ) v19 = -1; else v19 = 2 * (v18 + 1); v20 = (char *)operator new[](v19); v21 = 0; v22 = v20; while ( v21 < v18 ) { *(_WORD *)&v20[2 * v21] = *(_WORD *)&v51[2 * v21]; ++v21; } *(_WORD *)&v20[v17] = 0; (*(void (__fastcall **)(cocos2d::CCLabelBMFont *, char *))(*(_DWORD *)this + 552))(this, v20); operator delete[](v22); std::__vector_base::~__vector_base((char **)&v54); std::__vector_base::~__vector_base(&v51); result = std::__vector_base::~__vector_base(v50); } if ( !*((_DWORD *)this + 82) ) return result; v23 = 0; v24 = cocos2d::cc_wcslen(*((cocos2d **)this + 74), v3); v25 = 0; v26 = 0; v54 = nullptr; v55 = nullptr; v56 = nullptr; v41 = v24; while ( v23 <= v41 ) { v27 = (_WORD *)(*((_DWORD *)this + 74) + 2 * v23); v28 = (unsigned __int16)*v27; if ( v28 != 10 && *v27 ) { if ( v55 != v56 ) { if ( v55 ) *(_WORD *)v55 = v28; v37 = v55 + 2; goto LABEL_93; } std::vector::__push_back_slow_path((int *)&v54, v27); } else { v29 = (v55 - (_BYTE *)v54) >> 1; if ( !v29 ) { ++v25; goto LABEL_95; } if ( v25 - 1 + v26 + v29 >= 0 ) { v30 = (*(int (__fastcall **)(cocos2d::CCLabelBMFont *, int))(*(_DWORD *)this + 240))(this, v25 - 1 + v26 + v29); v31 = v30; if ( v30 ) { v32 = *(float *)(*(int (__fastcall **)(int))(*(_DWORD *)v30 + 96))(v30); v33 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v31 + 164))(v31); v34 = *((_DWORD *)this + 82); v35 = v32 + (float)(*v33 * 0.5); if ( v34 == 1 ) { v36 = (float)(*(float *)(*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)this + 164))(this) * 0.5) - (float)(v35 * 0.5); goto LABEL_81; } if ( v34 == 2 ) { v36 = *(float *)(*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)this + 164))(this) - v35; LABEL_81: if ( v36 != 0.0 ) { v38 = 0; v45 = v25 + v26; do { if ( v45 + v38 >= 0 ) { v39 = (*(int (__fastcall **)(cocos2d::CCLabelBMFont *, int))(*(_DWORD *)this + 240))(this, v45 + v38); if ( v39 ) { v47 = v39; v43 = *(cocos2d::CCArray **)(*(_DWORD *)v39 + 92); v46 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v39 + 96))(v39); cocos2d::CCPoint::CCPoint((float *)v50, v36, 0.0); cocos2d::CCPoint::operator+((float *)&v51, v46, (float *)v50); ((void (__fastcall *)(int, char **))v43)(v47, &v51); } } ++v38; } while ( v38 != v29 ); } } v26 += v29; ++v25; v37 = &v55[-2 * ((unsigned int)(v55 - (_BYTE *)v54) >> 1)]; LABEL_93: v55 = v37; } } } LABEL_95: ++v23; } return std::__vector_base::~__vector_base((char **)&v54); }
GD Web Decomp Icon

GD Web Decomp

Raw Source