// // sub_100981DA0 from 0x100981da0 to 0x100982162 (962 bytes) // // 3 xrefs: // > sub_1000E7DF0 @ 0x1000e7f5b // > sub_100982BC0 @ 0x100982c48 // > AutoBackupOptionsPopup::FLAlert_Clicked @ 0x10098350b // // This function is hookable on this platform (idp: pc, 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 12:39:00 +0000 // __int64 __fastcall sub_100981DA0(std::string *a1, int a2, unsigned __int8 *a3, char a4) { std::string *v5; // r14 _BYTE *v6; // r12 _BYTE *v7; // rax unsigned __int64 v8; // rbx __int64 v9; // r14 int v10; // ecx unsigned int v11; // ecx __int64 *v12; // rax char *v14; // r15 char *v15; // rbx void *v16; // rdi __int64 v17; // r13 unsigned __int64 v18; // rcx unsigned int v19; // eax unsigned __int8 *v20; // rsi __int64 *v21; // rax int v22; // ecx unsigned int v23; // edi size_t size; // rcx unsigned int v25; // edx size_t v26; // rax unsigned __int64 v27; // r15 char v28; // r15 char *v29; // rbx size_t v30; // r14 size_t v31; // r14 char *v32; // rbx char v33; // r15 void *v34; // rbx const std::__fs::filesystem::path *v35; // rdi int v36; // eax int v37; // r14d size_t __len; // [rsp+8h] [rbp-B8h] size_t v39; // [rsp+10h] [rbp-B0h] unsigned __int8 *data; // [rsp+18h] [rbp-A8h] unsigned __int64 v41; // [rsp+20h] [rbp-A0h] __int128 *v43; // [rsp+30h] [rbp-90h] BYREF __int128 v44; // [rsp+38h] [rbp-88h] BYREF unsigned int v45; // [rsp+48h] [rbp-78h] unsigned int v46; // [rsp+4Ch] [rbp-74h] __int128 __dst; // [rsp+50h] [rbp-70h] BYREF void *v48; // [rsp+60h] [rbp-60h] void *__p[2]; // [rsp+70h] [rbp-50h] BYREF __int64 v50; // [rsp+80h] [rbp-40h] int v51; // [rsp+8Ch] [rbp-34h] unsigned int v52; // [rsp+90h] [rbp-30h] v51 = a2; if ( a2 <= 0 ) return 0; v5 = a1; *(_OWORD *)__p = 0; v50 = 0; sub_10097F2B0(a1, __p, a3); v44 = 0; v43 = &v44; v6 = __p[0]; v7 = __p[1]; if ( __p[1] != __p[0] ) { if ( a4 ) { v8 = 0; v9 = 24; v52 = 0; while ( 1 ) { v11 = (unsigned __int8)v6[v9]; if ( (v11 & 1) == 0 ) break; if ( *(_QWORD *)&v6[v9 + 8] ) goto LABEL_10; LABEL_5: ++v8; v9 += 128; if ( v8 >= (v7 - v6) >> 7 ) goto LABEL_13; } if ( !(v11 >> 1) ) goto LABEL_5; LABEL_10: *(_QWORD *)&__dst = &v6[v9]; v12 = sub_10066C1A0((__int64 **)&v43, &v6[v9], (__int64)&unk_100A14A57, (_BYTE **)&__dst); v10 = *((_DWORD *)v12 + 14); *((_DWORD *)v12 + 14) = v10 + 1; v52 += v10 >= v51; v6 = __p[0]; v7 = __p[1]; goto LABEL_5; } data = (unsigned __int8 *)a1->__r_.__value_.__s.__data_; v17 = 0; v18 = 0; v52 = 0; while ( 1 ) { v19 = (unsigned __int8)v6[v17 + 24]; if ( (v19 & 1) != 0 ) { if ( !*(_QWORD *)&v6[v17 + 32] ) goto LABEL_22; } else if ( !(v19 >> 1) ) { goto LABEL_22; } v41 = v18; v20 = &v6[v17 + 24]; *(_QWORD *)&__dst = v20; v21 = sub_10066C1A0((__int64 **)&v43, v20, (__int64)&unk_100A14A57, (_BYTE **)&__dst); v22 = *((_DWORD *)v21 + 14); *((_DWORD *)v21 + 14) = v22 + 1; v6 = __p[0]; if ( v22 >= v51 ) break; LABEL_21: v18 = v41; LABEL_22: ++v18; v17 += 128; if ( v18 >= ((char *)__p[1] - (char *)v6) >> 7 ) goto LABEL_13; } v23 = (unsigned int)v5->__r_.__value_.__l.0; if ( (v23 & 1) != 0 ) { size = v5->__r_.__value_.__l.__size_; v25 = *((unsigned __int8 *)__p[0] + v17); if ( (v25 & 1) == 0 ) { LABEL_30: v26 = v25 >> 1; LABEL_33: __len = v26; v27 = v26 + size; if ( v26 + size >= 0xFFFFFFFFFFFFFFF8LL ) sub_100003630(); v45 = v25; if ( v27 > 0x16 ) { v46 = v23; v39 = size; v30 = (v27 | 7) + 1; if ( (v27 | 7) == 0x17 ) v30 = 26; v29 = (char *)operator new(v30); *(_QWORD *)&__dst = v30 | 1; v48 = v29; *((_QWORD *)&__dst + 1) = v27; v28 = v30 | 1; v5 = a1; size = v39; LOBYTE(v23) = v46; } else { __dst = 0; v48 = nullptr; v28 = 2 * v27; LOBYTE(__dst) = v28; v29 = nullptr; } if ( (v28 & 1) == 0 ) v29 = (char *)&__dst + 1; if ( size ) { v20 = data; if ( (v23 & 1) != 0 ) v20 = (unsigned __int8 *)v5->__r_.__value_.__l.__data_; v31 = size; memmove(v29, v20, size); size = v31; } v32 = &v29[size]; if ( __len ) { if ( (v45 & 1) != 0 ) v20 = *(unsigned __int8 **)&v6[v17 + 16]; else v20 = &v6[v17 + 1]; memmove(v32, v20, __len); } v32[__len] = 0; v33 = __dst; v34 = v48; v35 = (const std::__fs::filesystem::path *)v48; if ( (__dst & 1) == 0 ) v35 = (const std::__fs::filesystem::path *)((char *)&__dst + 1); LOBYTE(v36) = remove(v35, (std::error_code *)v20); v37 = v36; if ( (v33 & 1) != 0 ) operator delete(v34); v52 += v37 == 0; v6 = __p[0]; v5 = a1; goto LABEL_21; } } else { size = v23 >> 1; v25 = *((unsigned __int8 *)__p[0] + v17); if ( (v25 & 1) == 0 ) goto LABEL_30; } v26 = *(_QWORD *)((char *)__p[0] + v17 + 8); goto LABEL_33; } v52 = 0; LABEL_13: sub_1001EAE60((__int64)&v43, (_QWORD *)v44); v14 = (char *)__p[0]; if ( __p[0] ) { v15 = (char *)__p[1]; v16 = __p[0]; if ( __p[1] != __p[0] ) { do { v15 -= 128; sub_1009865F0(__p, v15); } while ( v15 != v14 ); v16 = __p[0]; } __p[1] = v14; operator delete(v16); } return v52; }
GD Web Decomp Icon

GD Web Decomp

Raw Source