// // sub_76E078 from 0x76e078 to 0x76e33c (708 bytes) // // 0 xrefs: // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // int __fastcall sub_76E078(int a1) { unsigned __int8 *v2; // r3 unsigned int v3; // r2 int result; // r0 unsigned int v5; // r6 int v6; // r0 size_t v7; // r6 int v8; // r0 signed int v9; // r7 int v10; // r8 const void *v11; // r1 signed int v12; // r5 signed int v13; // r8 _BOOL4 v14; // r3 char *v15; // r3 int v16; // r2 int v17; // r9 char *v18; // r1 signed int v19; // r5 _BYTE *v20; // r5 int v21; // r0 unsigned __int8 *v22; // r1 int v23; // r0 int v24; // r2 int v25; // r0 const void *v26; // r1 void *v27; // r0 unsigned int v28; // r8 unsigned __int8 *v29; // r1 unsigned __int8 *v30; // r0 unsigned int v31; // r0 int v32; // r6 int v33; // r1 int v34; // r3 char *v35; // r0 char *v36; // r10 void *v37; // r0 _BYTE *v38; // [sp+14h] [bp-4h] if ( (*(_DWORD *)(a1 + 44) & 8) == 0 ) return -1; if ( *(_BYTE *)(a1 + 70) ) { result = (*(int (__fastcall **)(int, int))(*(_DWORD *)a1 + 52))(a1, -1); if ( result == -1 ) return result; v22 = *(unsigned __int8 **)(a1 + 60); *(_DWORD *)(a1 + 20) = 0; *(_DWORD *)(a1 + 16) = 0; v2 = v22; *(_DWORD *)(a1 + 4) = v22; *(_DWORD *)(a1 + 8) = v22; *(_DWORD *)(a1 + 12) = v22; *(_DWORD *)(a1 + 24) = 0; *(_BYTE *)(a1 + 70) = 0; } else { v2 = *(unsigned __int8 **)(a1 + 8); } if ( *(_BYTE *)(a1 + 80) ) { v31 = *(_DWORD *)(a1 + 76); v32 = *(_DWORD *)(a1 + 60); if ( *(unsigned __int8 **)(a1 + 4) == v2 ) v33 = *(_DWORD *)(a1 + 72); else v33 = *(_DWORD *)(a1 + 72) + 1; *(_BYTE *)(a1 + 80) = 0; *(_DWORD *)(a1 + 72) = v33; v2 = (unsigned __int8 *)v33; v3 = v31; *(_DWORD *)(a1 + 8) = v33; *(_DWORD *)(a1 + 12) = v31; *(_DWORD *)(a1 + 4) = v32; } else { v3 = *(_DWORD *)(a1 + 12); } if ( v3 > (unsigned int)v2 ) return *v2; v5 = *(_DWORD *)(a1 + 64); v6 = *(_DWORD *)(a1 + 84); if ( v5 <= 1 ) v7 = 1; else v7 = v5 - 1; if ( !v6 ) sub_772FE4(0); if ( (*(int (__fastcall **)(int))(*(_DWORD *)v6 + 24))(v6) ) { v23 = sub_77A0DC(a1 + 36, *(void **)(a1 + 4), v7); v19 = v23; if ( v23 ) { if ( v23 <= 0 ) goto LABEL_61; LABEL_52: if ( (*(_DWORD *)(a1 + 44) & 8) != 0 ) { v29 = *(unsigned __int8 **)(a1 + 60); *(_DWORD *)(a1 + 12) = &v29[v19]; v30 = v29; *(_DWORD *)(a1 + 4) = v29; *(_DWORD *)(a1 + 8) = v29; } else { v30 = *(unsigned __int8 **)(a1 + 60); *(_DWORD *)(a1 + 4) = v30; *(_DWORD *)(a1 + 8) = v30; *(_DWORD *)(a1 + 12) = v30; } *(_DWORD *)(a1 + 20) = 0; *(_DWORD *)(a1 + 16) = 0; *(_DWORD *)(a1 + 24) = 0; *(_BYTE *)(a1 + 69) = 1; return *v30; } else { v17 = *(_DWORD *)(a1 + 44) & 0x10; if ( !v17 ) goto LABEL_45; v34 = *(_DWORD *)(a1 + 60); *(_DWORD *)(a1 + 20) = 0; *(_DWORD *)(a1 + 16) = 0; *(_DWORD *)(a1 + 24) = 0; *(_BYTE *)(a1 + 69) = 0; *(_DWORD *)(a1 + 4) = v34; *(_DWORD *)(a1 + 8) = v34; *(_DWORD *)(a1 + 12) = v34; return -1; } } v8 = (*(int (__fastcall **)(_DWORD))(**(_DWORD **)(a1 + 84) + 20))(*(_DWORD *)(a1 + 84)); if ( v8 <= 0 ) { v10 = v7; v9 = v7 - 1 + (*(int (__fastcall **)(_DWORD))(**(_DWORD **)(a1 + 84) + 32))(*(_DWORD *)(a1 + 84)); } else { v9 = v7 * v8; v10 = v7 * v8; } v11 = *(const void **)(a1 + 96); v12 = *(_DWORD *)(a1 + 100) - (_DWORD)v11; if ( v10 <= v12 ) v13 = 0; else v13 = v10 - v12; if ( *(_BYTE *)(a1 + 69) ) { v14 = *(_DWORD *)(a1 + 12) == *(_DWORD *)(a1 + 4); if ( !v12 ) v14 = 0; if ( v14 ) v13 = 0; } if ( v9 > *(_DWORD *)(a1 + 92) ) { v35 = (char *)operator new[](v9); v36 = v35; if ( v12 ) memcpy(v35, *(const void **)(a1 + 96), v12); v37 = *(void **)(a1 + 88); if ( v37 ) operator delete[](v37); *(_DWORD *)(a1 + 88) = v36; v15 = v36; *(_DWORD *)(a1 + 92) = v9; } else { if ( v12 ) memmove(*(void **)(a1 + 88), v11, *(_DWORD *)(a1 + 100) - (_DWORD)v11); v15 = *(char **)(a1 + 88); } v16 = *(_DWORD *)(a1 + 52); v17 = 0; v18 = &v15[v12]; *(_DWORD *)(a1 + 96) = v15; v19 = 0; *(_DWORD *)(a1 + 100) = v18; *(_DWORD *)(a1 + 56) = v16; if ( v13 > 0 ) goto LABEL_38; v28 = 0; while ( 1 ) { v20 = *(_BYTE **)(a1 + 4); v38 = v20; if ( (unsigned int)v18 > *(_DWORD *)(a1 + 96) ) { v25 = (*(int (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 84) + 16))(*(_DWORD *)(a1 + 84), a1 + 52); v20 = *(_BYTE **)(a1 + 4); v17 = v25; if ( v25 == 3 ) { LABEL_48: v26 = *(const void **)(a1 + 88); v27 = v20; v19 = *(_DWORD *)(a1 + 100) - (_DWORD)v26; if ( v19 >= v7 ) v19 = v7; memcpy(v27, v26, v19); *(_DWORD *)(a1 + 96) = *(_DWORD *)(a1 + 88) + v19; goto LABEL_36; } } else if ( v17 == 3 ) { goto LABEL_48; } v19 = v38 - v20; if ( v17 == 2 ) break; LABEL_36: if ( (v19 == 0) <= v28 ) break; v18 = *(char **)(a1 + 100); v13 = 1; LABEL_38: if ( (int)&v18[v13 - *(_DWORD *)(a1 + 88)] > *(_DWORD *)(a1 + 92) ) sub_77356C("basic_filebuf::underflow codecvt::max_length() is not valid"); v21 = sub_77A0DC(a1 + 36, v18, v13); if ( v21 ) { v28 = 0; if ( v21 == -1 ) break; } else { v28 = 1; } v18 = (char *)(*(_DWORD *)(a1 + 100) + v21); *(_DWORD *)(a1 + 100) = v18; } if ( v19 > 0 ) goto LABEL_52; if ( !v28 ) { if ( v17 == 2 ) sub_77356C("basic_filebuf::underflow invalid byte sequence in file"); LABEL_61: sub_77356C("basic_filebuf::underflow error reading the file"); } LABEL_45: v24 = *(_DWORD *)(a1 + 60); *(_DWORD *)(a1 + 20) = 0; *(_DWORD *)(a1 + 16) = 0; *(_DWORD *)(a1 + 4) = v24; *(_DWORD *)(a1 + 8) = v24; *(_DWORD *)(a1 + 12) = v24; *(_DWORD *)(a1 + 24) = 0; *(_BYTE *)(a1 + 69) = 0; if ( v17 == 1 ) sub_77356C("basic_filebuf::underflow incomplete character in file"); return -1; }
GD Web Decomp Icon

GD Web Decomp

Raw Source