// // ConvertUTF8toUTF16 from 0x7f4d24 to 0x7f4e44 (288 bytes) // // 1 xrefs: // > llvm::ConvertUTF8toWide @ 0x7f4ffe // // 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:01:07 +0000 // int __fastcall ConvertUTF8toUTF16(unsigned __int8 **a1, unsigned int a2, _WORD **a3, unsigned int a4, int a5) { _WORD *v7; // r7 void *v8; // r12 unsigned __int8 *v10; // r5 int v12; // r2 int v13; // r3 int v14; // r4 signed int v15; // r6 int v16; // r4 int v17; // r0 int v18; // r4 int v19; // r0 int v20; // r1 int v21; // r0 int v22; // r1 int v23; // r0 int v24; // r1 int v25; // r0 int v26; // r1 unsigned int v27; // r1 int result; // r0 unsigned int v29; // r1 void *v30; // [sp+4h] [bp-10h] unsigned int v31; // [sp+8h] [bp-Ch] int v32; // [sp+Ch] [bp-8h] v7 = *a3; v8 = &unk_BF3C8C; v10 = *a1; v12 = 1114111; v13 = 65533; while ( 1 ) { while ( 1 ) { if ( (unsigned int)v10 >= a2 ) { result = 0; goto LABEL_33; } v32 = v13; v14 = *v10; v31 = v12; v30 = v8; v15 = *((unsigned __int8 *)&unk_BF3C8C + v14 + 8); if ( v15 >= (int)(a2 - (_DWORD)v10) ) { result = 1; goto LABEL_33; } if ( !sub_7F492C(v10, v15 + 1) ) goto LABEL_32; v8 = v30; v12 = v31; v13 = v32; switch ( v15 ) { case 0: v24 = 0; goto LABEL_16; case 1: v22 = 0; goto LABEL_14; case 2: v20 = 0; goto LABEL_12; case 3: v18 = 0; goto LABEL_10; case 4: v16 = 0; goto LABEL_8; case 5: ++v10; v16 = v14 << 6; LABEL_8: v17 = *v10++; v18 = (v16 + v17) << 6; LABEL_10: v19 = *v10++; v20 = (v18 + v19) << 6; LABEL_12: v21 = *v10++; v22 = (v20 + v21) << 6; LABEL_14: v23 = *v10++; v24 = (v22 + v23) << 6; LABEL_16: v25 = *v10++; v26 = v24 + v25; break; default: v26 = 0; break; } v27 = v26 - *((_DWORD *)v30 + v15 + 66); if ( (unsigned int)v7 >= a4 ) { LABEL_28: result = 2; v10 += ~v15; goto LABEL_33; } if ( v27 < 0x10000 ) break; if ( v27 > v31 ) goto LABEL_23; if ( a4 <= (unsigned int)(v7 + 1) ) goto LABEL_28; v29 = v27 - 0x10000; *v7 = (v29 >> 10) - 10240; v7[1] = (v29 & 0x3FF) - 9216; v7 += 2; } if ( v27 - 55296 >= 0x800 ) { *v7 = v27; goto LABEL_26; } LABEL_23: if ( !a5 ) break; *v7 = v32; LABEL_26: ++v7; } v10 += ~v15; LABEL_32: result = 3; LABEL_33: *a1 = v10; *a3 = v7; return result; }