// // sub_1002D0568 from 0x1002d0568 to 0x1002d1130 (3016 bytes) // // 1 xrefs: // > sub_1002D041C @ 0x1002d04d8 // // This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True! // // 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 11:02:38 +0000 // __int64 __fastcall sub_1002D0568( __int64 a1, __int64 a2, std::string *a3, float *a4, int a5, char a6, char a7, int a8, float a9, float a10, float a11) { __int64 v20; // x21 __int64 v21; // x0 float v22; // s10 __int64 v23; // x0 __int64 v24; // x0 __int64 v25; // x0 __int64 v26; // x0 __int64 v27; // x0 __int64 v28; // x0 __int64 v29; // x0 __int64 v30; // x0 __int64 v31; // x0 int v32; // w8 std::string::size_type size; // x9 std::string::size_type v34; // x9 std::string *v35; // x10 int v36; // w21 int v37; // w20 float v38; // s9 unsigned __int64 v39; // x2 __int64 v40; // x0 __int64 v41; // x26 __n128 v42; // q0 float v43; // s10 float v44; // s14 float v45; // s10 float v46; // s0 __n128 v47; // q0 __int64 v48; // x0 float v49; // s10 float v50; // s14 __int64 v51; // x0 float *v52; // x0 float v53; // s10 float v54; // s14 __int64 v55; // x0 int v56; // w25 int v57; // w24 int v58; // w23 __n128 v59; // q0 __int64 v60; // x0 __int64 v61; // x27 int v62; // w8 __int64 v63; // x20 int v65; // w22 __int64 v67; // x0 __int64 v68; // x28 __int64 v69; // x0 __int64 v70; // x27 float v71; // s10 float v72; // s14 float v73; // s15 __int64 v74; // x0 float32x2_t *v75; // x20 float32x2_t *v76; // x0 double v77; // d0 float v78; // s0 double v79; // d0 float v80; // s14 float v81; // s10 float v82; // s0 __n128 v83; // q0 __int64 v84; // x28 int v85; // w20 __int64 v86; // x28 int v87; // w20 __int64 v88; // x0 int v89; // w8 int v90; // w8 float v91; // s0 __int16 v92; // w8 __int64 v93; // x0 __int64 i; // x27 __int64 v95; // x20 __int64 v96; // x0 __int64 v97; // x0 __int64 v98; // x23 __n128 v99; // q0 __n128 v100; // q0 __int64 v101; // x0 float v102; // s8 float v103; // s8 __int64 v104; // x0 float *v105; // x0 float v106; // s8 float v107; // s10 __int64 v108; // x0 __int64 v109; // x1 int v110; // w8 float v111; // s0 int v112; // w9 int v113; // w9 __int64 v115; // [xsp+0h] [xbp-160h] __int64 v116; // [xsp+8h] [xbp-158h] std::string *v117; // [xsp+10h] [xbp-150h] int v120; // [xsp+28h] [xbp-138h] float32x2_t v121; // [xsp+30h] [xbp-130h] BYREF float32x2_t v122; // [xsp+38h] [xbp-128h] BYREF float32x2_t v123; // [xsp+40h] [xbp-120h] BYREF float32x2_t v124; // [xsp+48h] [xbp-118h] BYREF void *v125[2]; // [xsp+50h] [xbp-110h] BYREF std::string::size_type v126; // [xsp+60h] [xbp-100h] void *__dst[2]; // [xsp+70h] [xbp-F0h] BYREF std::string::size_type v128; // [xsp+80h] [xbp-E0h] std::string __p; // [xsp+90h] [xbp-D0h] BYREF void *v130[2]; // [xsp+B0h] [xbp-B0h] BYREF __int64 v131; // [xsp+C0h] [xbp-A0h] v20 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 80LL))(a1); if ( !(_DWORD)v20 ) return v20; *(_BYTE *)(a1 + 608) = a7; *(_DWORD *)(a1 + 612) = a8; *(float *)(a1 + 616) = a11; *(_BYTE *)(a1 + 692) = a6; v21 = cocos2d::CCDirector::sharedDirector(); v22 = sub_100207B64(v21); v24 = sub_1002E736C(v23); *(_QWORD *)(a1 + 632) = v24; v25 = cocos2d::CCObject::retain(v24); v26 = sub_1002E736C(v25); *(_QWORD *)(a1 + 640) = v26; v27 = cocos2d::CCObject::retain(v26); v28 = sub_1002E736C(v27); *(_QWORD *)(a1 + 648) = v28; v29 = cocos2d::CCObject::retain(v28); v30 = sub_10038FC08(v29); v31 = sub_10038FCF4(v30, a2, a9); *(_QWORD *)(a1 + 600) = v31; if ( v31 ) cocos2d::CCObject::retain(v31); if ( *(int *)(a1 + 612) >= 1 ) { if ( SHIBYTE(a3->__r_.__value_.__r.__words[2]) < 0 ) sub_1000097D0(&__p, a3->__r_.__value_.__l.__data_, a3->__r_.__value_.__l.__size_); else __p = *a3; sub_1002D11E0((__int64 *)v130, a1, &__p); if ( SHIBYTE(a3->__r_.__value_.__r.__words[2]) < 0 ) operator delete(a3->__r_.__value_.__l.__data_); *(_OWORD *)&a3->__r_.__value_.__l.__data_ = *(_OWORD *)v130; a3->__r_.__value_.__r.__words[2] = v131; if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); } if ( (*(_BYTE *)(a1 + 692) & 1) == 0 ) { if ( SHIBYTE(a3->__r_.__value_.__r.__words[2]) < 0 ) { sub_1000097D0(__dst, a3->__r_.__value_.__l.__data_, a3->__r_.__value_.__l.__size_); } else { *(_OWORD *)__dst = *(_OWORD *)&a3->__r_.__value_.__l.__data_; v128 = a3->__r_.__value_.__r.__words[2]; } sub_1002D132C((__int64 *)v130, a1, __dst); if ( SHIBYTE(a3->__r_.__value_.__r.__words[2]) < 0 ) operator delete(a3->__r_.__value_.__l.__data_); *(_OWORD *)&a3->__r_.__value_.__l.__data_ = *(_OWORD *)v130; a3->__r_.__value_.__r.__words[2] = v131; if ( SHIBYTE(v128) < 0 ) operator delete(__dst[0]); } v32 = HIBYTE(a3->__r_.__value_.__r.__words[2]); LODWORD(v115) = v20; if ( SHIBYTE(a3->__r_.__value_.__r.__words[2]) < 0 ) { size = a3->__r_.__value_.__l.__size_; if ( size ) goto LABEL_24; } else if ( *((_BYTE *)&a3->__r_.__value_.__s + 23) ) { size = HIBYTE(a3->__r_.__value_.__r.__words[2]); LABEL_24: v34 = size - 1; v35 = a3; if ( (v32 & 0x80) != 0 ) v35 = (std::string *)a3->__r_.__value_.__r.__words[0]; HIDWORD(v115) = v35->__r_.__value_.__s.__data_[v34] == 10; goto LABEL_28; } HIDWORD(v115) = 0; LABEL_28: v36 = 0; v37 = 0; v38 = v22 * a10; v116 = a2; v117 = a3; if ( (v32 & 0x80) != 0 ) goto LABEL_31; while ( v32 ) { *(_OWORD *)v125 = *(_OWORD *)&a3->__r_.__value_.__l.__data_; v126 = a3->__r_.__value_.__r.__words[2]; while ( 1 ) { sub_1002D1DD8(v130, a1, v125, v38, a9); if ( SHIBYTE(v126) < 0 ) operator delete(v125[0]); if ( v131 >= 0 ) v40 = cocos2d::CCLabelBMFont::create_1((const char *)v130, a2, v115); else v40 = cocos2d::CCLabelBMFont::create_1((const char *)v130[0], a2, v115); v41 = v40; sub_1000262BC((float *)&v124, 0.0, (float)-(v37 * a5)); (*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v41 + 184LL))(v41, &v124); (*(void (__fastcall **)(__int64, float))(*(_QWORD *)v41 + 160LL))(v41, a9); v42 = sub_1002E74E0(*(_QWORD *)(a1 + 648), v41); v43 = *(float *)(a1 + 688); v44 = *(float *)(*(__int64 (__fastcall **)(__int64, __n128))(*(_QWORD *)v41 + 328LL))(v41, v42); if ( v43 >= (float)(v44 * (*(float (__fastcall **)(__int64))(*(_QWORD *)v41 + 168LL))(v41)) ) { v46 = *(float *)(a1 + 688); } else { v45 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 328LL))(v41); v46 = v45 * (*(float (__fastcall **)(__int64))(*(_QWORD *)v41 + 168LL))(v41); } *(float *)(a1 + 688) = v46; (*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v41 + 296LL))(v41, a4); v47.n128_u32[0] = *(_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 304LL))(v41); if ( v47.n128_f32[0] == 0.5 ) { v48 = (*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v41 + 304LL))(v41, v47.n128_f32[0]); sub_1000262BC((float *)&v124, 0.0, *(float *)(v48 + 4)); (*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v41 + 296LL))(v41, &v124); v49 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 192LL))(v41); v50 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 328LL))(v41); v51 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 192LL))(v41); sub_1000262BC((float *)&v124, roundf(v49 + (float)(v50 * -0.5)), *(float *)(v51 + 4)); (*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v41 + 184LL))(v41, &v124); } if ( *(float *)((*(__int64 (__fastcall **)(__int64, __n128))(*(_QWORD *)v41 + 304LL))(v41, v47) + 4) == 0.5 ) { v52 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 304LL))(v41); sub_1000262BC((float *)&v124, *v52, 0.0); (*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v41 + 296LL))(v41, &v124); v53 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 192LL))(v41); v54 = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 192LL))(v41) + 4); v55 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 328LL))(v41); sub_1000262BC((float *)&v124, v53, roundf(v54 + (float)(*(float *)(v55 + 4) * -0.5))); (*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v41 + 184LL))(v41, &v124); } v120 = v37; v56 = v131 >= 0 ? HIBYTE(v131) : LODWORD(v130[1]); qsort( *(void **)(*(_QWORD *)(*(_QWORD *)(a1 + 632) + 56LL) + 16LL), **(unsigned int **)(*(_QWORD *)(a1 + 632) + 56LL), 8u, (int (__cdecl *)(const void *, const void *))sub_1002D0404); v57 = 0; v58 = v36 + v56; while ( (unsigned int)sub_1002E757C(*(_QWORD *)(a1 + 632)) ) { v60 = sub_1002E75A0(*(_QWORD *)(a1 + 632), 0); v61 = v60; v62 = *(_DWORD *)(v60 + 60); v63 = (unsigned int)(v62 - v36); if ( v62 < v36 || v62 > v58 ) break; v65 = *(_DWORD *)(v60 + 64); if ( v65 == -1 || v65 <= v58 ) { sub_1002E7664(*(_QWORD *)(a1 + 632), 0, 1); } else { *(_DWORD *)(v60 + 60) = v36 + v56 + 1; v65 = v36 + v56; } ++v57; if ( *(_DWORD *)(v61 + 56) == 5 ) { if ( (int)v63 >= v56 ) { v59 = sub_1002E74E0(*(_QWORD *)(a1 + 632), v61); break; } v67 = EmoteSprite::charIndexForByte(v130, v63); v68 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v41 + 480LL))(v41, v67); if ( v68 ) { v69 = EmoteSprite::createWithDef(*(_QWORD *)(v61 + 88)); v70 = v69; if ( v69 ) { if ( !*(_QWORD *)(a1 + 624) ) *(_QWORD *)(a1 + 624) = cocos2d::CCNode::create(v69); v71 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 304LL))(v41); v72 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 328LL))(v41); v73 = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 304LL))(v41) + 4); v74 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 328LL))(v41); sub_1000262BC((float *)&v124, v71 * v72, v73 * *(float *)(v74 + 4)); v75 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 192LL))(v41); v76 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v68 + 192LL))(v68); *(float32x2_t *)&v77 = sub_10002632C(v76, &v124, &v121); v78 = (*(float (__fastcall **)(__int64, double))(*(_QWORD *)v41 + 168LL))(v41, v77); sub_100026350(&v121, &v122, v78); *(float32x2_t *)&v79 = sub_100026318(v75, &v122, &v123); (*(void (__fastcall **)(__int64, float32x2_t *, double))(*(_QWORD *)v70 + 184LL))(v70, &v123, v79); v80 = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 328LL))(v41) + 4); v81 = sub_1004DC170(); v82 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v41 + 168LL))(v41); v83 = EmoteSprite::fitToHeight(v70, (float)(v80 * v81) * v82, *(float *)(a1 + 616)); (*(void (__fastcall **)(_QWORD, __int64, __n128))(**(_QWORD **)(a1 + 624) + 456LL))( *(_QWORD *)(a1 + 624), v70, v83); sub_1002E74E0(*(_QWORD *)(a1 + 640), v70); } } } else { LODWORD(v84) = EmoteSprite::charIndexForByte(v130, v63); v85 = EmoteSprite::charIndexForByte(v130, (unsigned int)(v65 - v36)); if ( (_DWORD)v84 == 1 ) v84 = 0; else v84 = (unsigned int)v84; v86 = (unsigned int)v84 - ((*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v41 + 480LL))(v41, v84) == 0); if ( *(_DWORD *)(v61 + 64) == -1 ) { v93 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v41 + 480LL))(v41, v86); if ( v93 && *(_DWORD *)(v61 + 56) == 4 ) *(_DWORD *)(v93 + 612) = *(_DWORD *)(v61 + 76); } else if ( (int)v86 <= v85 ) { v87 = v85 + 1; do { v88 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v41 + 480LL))(v41, v86); if ( v88 ) { v89 = *(_DWORD *)(v61 + 56); switch ( v89 ) { case 1: v92 = *(_WORD *)(v61 + 68); v124.i8[2] = *(_BYTE *)(v61 + 70); v124.i16[0] = v92; (*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v88 + 960LL))(v88, &v124); break; case 2: *(_BYTE *)(v88 + 604) = 1; *(_DWORD *)(v88 + 608) = *(_DWORD *)(v61 + 72); break; case 3: *(float *)(v88 + 620) = (float)*(int *)(v61 + 80); v90 = *(_DWORD *)(v61 + 84); if ( v90 < 1 ) v91 = 0.0; else v91 = 1.0 / (float)(unsigned int)v90; *(float *)(v88 + 616) = v91; *(_DWORD *)(v88 + 628) = v57; break; } } v86 = (unsigned int)(v86 + 1); } while ( v87 != (_DWORD)v86 ); } } } (*(void (__fastcall **)(__int64, __int64, __n128))(*(_QWORD *)a1 + 456LL))(a1, v41, v59); a3 = v117; for ( i = 0; (unsigned int)i < (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v41 + 496LL))(v41); i = (unsigned int)(i + 1) ) { v95 = *(_QWORD *)(a1 + 640); v96 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v41 + 488LL))(v41); v97 = sub_1002E75A0(v96, i); sub_1002E74E0(v95, v97); } std::string::erase(v117, 0, v56); if ( SHIBYTE(v131) < 0 ) operator delete(v130[0]); v37 = v120 + 1; v32 = HIBYTE(v117->__r_.__value_.__r.__words[2]); v36 += v56; a2 = v116; if ( (v32 & 0x80) == 0 ) break; LABEL_31: v39 = a3->__r_.__value_.__l.__size_; if ( !v39 ) goto LABEL_97; sub_1000097D0(v125, a3->__r_.__value_.__l.__data_, v39); } } LABEL_97: if ( HIDWORD(v115) ) { v98 = cocos2d::CCLabelBMFont::create_1(" ", a2); sub_1000262BC((float *)v130, 0.0, (float)-(v37 * a5)); (*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v98 + 184LL))(v98, v130); (*(void (__fastcall **)(__int64, float))(*(_QWORD *)v98 + 160LL))(v98, a9); v99 = sub_1002E74E0(*(_QWORD *)(a1 + 648), v98); (*(void (__fastcall **)(__int64, float *, __n128))(*(_QWORD *)v98 + 296LL))(v98, a4, v99); v100.n128_u32[0] = *(_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v98 + 304LL))(v98); v20 = (unsigned int)v115; if ( v100.n128_f32[0] == 0.5 ) { v101 = (*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v98 + 304LL))(v98, v100.n128_f32[0]); sub_1000262BC((float *)v130, 0.0, *(float *)(v101 + 4)); (*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v98 + 296LL))(v98, v130); v102 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v98 + 192LL))(v98); v103 = roundf(v102 + (float)(*(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v98 + 328LL))(v98) * -0.5)); v104 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v98 + 192LL))(v98); sub_1000262BC((float *)v130, v103, *(float *)(v104 + 4)); (*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v98 + 184LL))(v98, v130); } if ( *(float *)((*(__int64 (__fastcall **)(__int64, __n128))(*(_QWORD *)v98 + 304LL))(v98, v100) + 4) == 0.5 ) { v105 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v98 + 304LL))(v98); sub_1000262BC((float *)v130, *v105, 0.0); (*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v98 + 296LL))(v98, v130); v106 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v98 + 192LL))(v98); v107 = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v98 + 192LL))(v98) + 4); v108 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v98 + 328LL))(v98); sub_1000262BC((float *)v130, v106, roundf(v107 + (float)(*(float *)(v108 + 4) * -0.5))); (*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v98 + 184LL))(v98, v130); } (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v98); ++v37; } else { v20 = (unsigned int)v115; } v109 = *(_QWORD *)(a1 + 624); if ( v109 ) (*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v109, 10); cocos2d::CCObject::release(*(_DWORD **)(a1 + 632)); *(_QWORD *)(a1 + 632) = 0; v110 = (v37 - 1) * a5; *(_DWORD *)(a1 + 672) = v110; v111 = 0.0; v112 = (int)(float)(v38 + 0.0); *(_DWORD *)(a1 + 676) = v112; if ( *a4 != 0.0 ) { if ( *a4 == 1.0 ) v113 = -v112; else v113 = v112 / -2; v111 = (float)v113; } sub_1000262BC((float *)v130, -v111, (float)v110); sub_10002630C((_QWORD *)(a1 + 680), (double *)v130); return v20; }
GD Web Decomp Icon

GD Web Decomp

Raw Source