// // DS_Dictionary::saveRootSubDictToFile from 0x10017b420 to 0x10017ba00 (1504 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 // bool __fastcall DS_Dictionary::saveRootSubDictToFile(DS_Dictionary *a1, const char *a2) { const std::string::value_type *data; // rsi const char *v4; // r14 char *v5; // rsi char *v6; // rsi const std::__fs::filesystem::path *v7; // r15 const std::__fs::filesystem::path *v8; // rdi std::error_code *v9; // rdx const char *v10; // r13 const std::__fs::filesystem::path *v11; // rdi std::error_code *v12; // rdx const std::__fs::filesystem::path *v13; // rdi std::error_code *v14; // rsi int v15; // eax std::error_code *v16; // rdx const std::__fs::filesystem::path *v17; // rsi char *v18; // rsi char v19; // bl FILE *v21; // rax FILE *v22; // rax std::string v23; // [rsp+10h] [rbp-510h] BYREF std::string v24; // [rsp+28h] [rbp-4F8h] BYREF std::string v25; // [rsp+40h] [rbp-4E0h] BYREF _WORD v26[8]; // [rsp+58h] [rbp-4C8h] BYREF char *v27; // [rsp+68h] [rbp-4B8h] char v28; // [rsp+77h] [rbp-4A9h] BYREF __int64 (__fastcall **v29)(); // [rsp+78h] [rbp-4A8h] BYREF _BYTE v30[120]; // [rsp+80h] [rbp-4A0h] BYREF FILE *v31; // [rsp+F8h] [rbp-428h] int v32; // [rsp+208h] [rbp-318h] int v33; // [rsp+20Ch] [rbp-314h] std::ios_base v34; // [rsp+218h] [rbp-308h] BYREF __int64 v35; // [rsp+2A0h] [rbp-280h] int v36; // [rsp+2A8h] [rbp-278h] _QWORD v37[2]; // [rsp+2B0h] [rbp-270h] BYREF _BYTE __sb[120]; // [rsp+2C0h] [rbp-260h] BYREF FILE *v39; // [rsp+338h] [rbp-1E8h] int v40; // [rsp+448h] [rbp-D8h] int v41; // [rsp+44Ch] [rbp-D4h] std::ios_base v42; // [rsp+458h] [rbp-C8h] BYREF __int64 v43; // [rsp+4E0h] [rbp-40h] int v44; // [rsp+4E8h] [rbp-38h] v26[0] = 0; FileOperation::getFilePath(&v23); std::string::append(&v23, a2); if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) != 0 ) data = v23.__r_.__value_.__l.__data_; else data = v23.__r_.__value_.__s.__data_; std::string::assign((std::string *)v26, data); v4 = (char *)v26 + 1; v5 = (char *)v26 + 1; if ( (v26[0] & 1) != 0 ) v5 = v27; sub_10017BB50(&v25, v5, "2.dat"); v6 = (char *)v26 + 1; if ( (v26[0] & 1) != 0 ) v6 = v27; sub_10017BB50(&v24, v6, "3.dat"); v7 = (const std::__fs::filesystem::path *)((char *)&v24.__r_.__value_.__l.0 + 1); v8 = (const std::__fs::filesystem::path *)((char *)&v24.__r_.__value_.__l.0 + 1); if ( (*(_BYTE *)&v24.__r_.__value_.__s.0 & 1) != 0 ) v8 = (const std::__fs::filesystem::path *)v24.__r_.__value_.__l.__data_; remove(v8, (std::error_code *)v6); v10 = v25.__r_.__value_.__s.__data_; v11 = (const std::__fs::filesystem::path *)((char *)&v25.__r_.__value_.__l.0 + 1); if ( (*(_BYTE *)&v25.__r_.__value_.__s.0 & 1) != 0 ) { v11 = (const std::__fs::filesystem::path *)v25.__r_.__value_.__l.__data_; if ( (*(_BYTE *)&v24.__r_.__value_.__s.0 & 1) == 0 ) { LABEL_12: rename(v11, (const std::__fs::filesystem::path *)((char *)&v24.__r_.__value_.__l.0 + 1), v9); v13 = (const std::__fs::filesystem::path *)((char *)v26 + 1); if ( (v26[0] & 1) == 0 ) goto LABEL_13; goto LABEL_37; } } else if ( (*(_BYTE *)&v24.__r_.__value_.__s.0 & 1) == 0 ) { goto LABEL_12; } rename(v11, (const std::__fs::filesystem::path *)v24.__r_.__value_.__l.__data_, v9); v13 = (const std::__fs::filesystem::path *)((char *)v26 + 1); if ( (v26[0] & 1) == 0 ) { LABEL_13: v14 = (std::error_code *)((char *)&v25.__r_.__value_.__l.0 + 1); if ( (*(_BYTE *)&v25.__r_.__value_.__s.0 & 1) == 0 ) goto LABEL_14; goto LABEL_38; } LABEL_37: v13 = (const std::__fs::filesystem::path *)v27; v14 = (std::error_code *)((char *)&v25.__r_.__value_.__l.0 + 1); if ( (*(_BYTE *)&v25.__r_.__value_.__s.0 & 1) == 0 ) { LABEL_14: rename(v13, (const std::__fs::filesystem::path *)((char *)&v25.__r_.__value_.__l.0 + 1), v12); if ( (*(_BYTE *)&v24.__r_.__value_.__s.0 & 1) == 0 ) goto LABEL_15; goto LABEL_39; } LABEL_38: v14 = (std::error_code *)v25.__r_.__value_.__l.__data_; rename(v13, (const std::__fs::filesystem::path *)v25.__r_.__value_.__l.__data_, v12); if ( (*(_BYTE *)&v24.__r_.__value_.__s.0 & 1) == 0 ) { LABEL_15: if ( v15 ) goto LABEL_16; goto LABEL_40; } LABEL_39: v7 = (const std::__fs::filesystem::path *)v24.__r_.__value_.__l.__data_; if ( v15 ) { LABEL_16: v17 = (const std::__fs::filesystem::path *)((char *)&v25.__r_.__value_.__l.0 + 1); if ( (*(_BYTE *)&v25.__r_.__value_.__s.0 & 1) != 0 ) v17 = (const std::__fs::filesystem::path *)v25.__r_.__value_.__l.__data_; rename(v7, v17, v16); v18 = (char *)v26 + 1; if ( (v26[0] & 1) != 0 ) goto LABEL_19; goto LABEL_20; } LABEL_40: remove(v7, v14); v18 = (char *)v26 + 1; if ( (v26[0] & 1) != 0 ) LABEL_19: v18 = v27; LABEL_20: v19 = sub_100642E60(a1, v18, "\t", 4, 0); if ( !v19 ) { if ( (*(_BYTE *)&v25.__r_.__value_.__s.0 & 1) != 0 ) v10 = v25.__r_.__value_.__l.__data_; v42.__loc_ = nullptr; v37[0] = &off_1008C3D00; v42.__vftable = (std::ios_base_vtbl *)&off_1008C3D28; v37[1] = 0; std::ios_base::init(&v42, __sb); v43 = 0; v44 = -1; v37[0] = &off_1008C3C90; v42.__vftable = (std::ios_base_vtbl *)off_1008C3CB8; sub_100183920(__sb); if ( v39 || (v21 = fopen(v10, "r"), (v39 = v21) == nullptr) ) { std::ios_base::clear( (std::ios_base *)((char *)v37 + *(_QWORD *)(v37[0] - 24LL)), *(_DWORD *)&__sb[*(_QWORD *)(v37[0] - 24LL) + 16] | 4); } else { v40 = 8; if ( v41 == 34 ) { setbuf(v21, nullptr); v41 = 0; } } if ( (v26[0] & 1) != 0 ) v4 = v27; v34.__loc_ = nullptr; v29 = (__int64 (__fastcall **)())&off_1008C3B90; v34.__vftable = (std::ios_base_vtbl *)&off_1008C3BB8; std::ios_base::init(&v34, v30); v35 = 0; v36 = -1; v29 = &off_1008C3B20; v34.__vftable = (std::ios_base_vtbl *)off_1008C3B48; sub_100183920(v30); if ( v31 || (v22 = fopen(v4, "w"), (v31 = v22) == nullptr) ) { std::ios_base::clear((std::ios_base *)&v30[(_QWORD)*(v29 - 3) - 8], *(_DWORD *)&v30[(_QWORD)*(v29 - 3) + 24] | 4); } else { v32 = 16; if ( v33 == 34 ) { setbuf(v22, nullptr); v33 = 0; } } sub_100183A60(&v28, *(_QWORD *)&__sb[*(_QWORD *)(v37[0] - 24LL) + 24], 0, *(_QWORD *)&v30[(_QWORD)*(v29 - 3) + 32]); v29 = &off_1008C3B20; v34.__vftable = (std::ios_base_vtbl *)off_1008C3B48; sub_100182030(v30); std::ostream::~ostream(&v29, off_1008C3B60); std::ios::~ios(&v34); v37[0] = &off_1008C3C90; v42.__vftable = (std::ios_base_vtbl *)off_1008C3CB8; sub_100182030(__sb); std::istream::~istream(v37, off_1008C3CD0); std::ios::~ios(&v42); } if ( (*(_BYTE *)&v24.__r_.__value_.__s.0 & 1) != 0 ) { operator delete(v24.__r_.__value_.__l.__data_); if ( (*(_BYTE *)&v25.__r_.__value_.__s.0 & 1) == 0 ) { LABEL_32: if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) == 0 ) goto LABEL_33; LABEL_44: operator delete(v23.__r_.__value_.__l.__data_); if ( (v26[0] & 1) == 0 ) return v19; LABEL_45: operator delete(v27); return v19; } } else if ( (*(_BYTE *)&v25.__r_.__value_.__s.0 & 1) == 0 ) { goto LABEL_32; } operator delete(v25.__r_.__value_.__l.__data_); if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) != 0 ) goto LABEL_44; LABEL_33: if ( (v26[0] & 1) != 0 ) goto LABEL_45; return v19; }