{"type": "func", "start": 6442543968, "end": 6442544250, "name": "sub_180016B60", "pseudocode": "// \n// sub_180016B60 from 0x180016b60 to 0x180016c7a (282 bytes)\n// \n// 4 xrefs:\n// > DS_Dictionary::copyFile @ 0x180019716\n// > DS_Dictionary::saveRootSubDictToCompressedFile @ 0x18001d7a4\n// > DS_Dictionary::saveRootSubDictToFile @ 0x18001dec2\n// > <???> @ 0x1801ae5b4\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\n// Hidden C++ exception states: #wind=3\n__int64 __fastcall sub_180016B60(__int64 a1, __int64 a2, int a3, unsigned int a4, int a5)\n{\n  if ( a5 )\n  {\n    *(_QWORD *)a1 = &unk_1800E70B0;\n    std::ios::ios(a1 + 168);\n  }\n  std::ostream::ostream(a1, a1 + 8, 0, 0);\n  *(_QWORD *)(*(int *)(*(_QWORD *)a1 + 4LL) + a1) = &std::ofstream::`vftable';\n  *(_DWORD *)(*(int *)(*(_QWORD *)a1 + 4LL) + a1 - 4) = *(_DWORD *)(*(_QWORD *)a1 + 4LL) - 168;\n  std::streambuf::streambuf(a1 + 8);\n  *(_QWORD *)(a1 + 8) = &std::filebuf::`vftable';\n  *(_BYTE *)(a1 + 132) = 0;\n  *(_BYTE *)(a1 + 121) = 0;\n  std::streambuf::_Init(a1 + 8);\n  *(_QWORD *)(a1 + 136) = 0;\n  *(_QWORD *)(a1 + 124) = qword_1801A8360;\n  *(_QWORD *)(a1 + 112) = 0;\n  if ( !sub_18001C230(a1 + 8, a2, a3 | 2u, a4) )\n    std::ios::setstate(a1 + *(int *)(*(_QWORD *)a1 + 4LL), 2, 0);\n  return a1;\n}", "assembly": "; \n; sub_180016B60 from 0x180016b60 to 0x180016c7a (282 bytes)\n; \n; 4 xrefs:\n; > DS_Dictionary::copyFile @ 0x180019716\n; > DS_Dictionary::saveRootSubDictToCompressedFile @ 0x18001d7a4\n; > DS_Dictionary::saveRootSubDictToFile @ 0x18001dec2\n; > <???> @ 0x1801ae5b4\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x180016b60\nmov     [rsp+arg_18], rbp                                              ; +0x5, 0x180016b65\nmov     [rsp+arg_0], rcx                                               ; +0xa, 0x180016b6a\npush    rsi                                                            ; +0xf, 0x180016b6f\npush    rdi                                                            ; +0x10, 0x180016b70\npush    r14                                                            ; +0x11, 0x180016b71\nsub     rsp, 30h                                                       ; +0x13, 0x180016b73\nmov     ebp, r9d                                                       ; +0x17, 0x180016b77\nmov     esi, r8d                                                       ; +0x1a, 0x180016b7a\nmov     r14, rdx                                                       ; +0x1d, 0x180016b7d\nmov     rdi, rcx                                                       ; +0x20, 0x180016b80\nmov     [rsp+48h+arg_10], 0                                            ; +0x23, 0x180016b83\ncmp     [rsp+48h+arg_20], 0                                            ; +0x2b, 0x180016b8b\njz      short loc_180016BB2                                            ; +0x30, 0x180016b90\nlea     rax, unk_1800E70B0                                             ; +0x32, 0x180016b92\nmov     [rcx], rax                                                     ; +0x39, 0x180016b99\nadd     rcx, 0A8h                                                      ; +0x3c, 0x180016b9c\ncall    cs:??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ; std::ios::ios(void) ; +0x43, 0x180016ba3\nnop                                                                    ; +0x49, 0x180016ba9\nmov     [rsp+48h+arg_10], 1                                            ; +0x4a, 0x180016baa\nlea     rbx, [rdi+8]                                                   ; +0x52, 0x180016bb2\nxor     r9d, r9d                                                       ; +0x56, 0x180016bb6\nxor     r8d, r8d                                                       ; +0x59, 0x180016bb9\nmov     rdx, rbx                                                       ; +0x5c, 0x180016bbc\nmov     rcx, rdi                                                       ; +0x5f, 0x180016bbf\ncall    cs:??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z; std::ostream::ostream(std::streambuf *,bool) ; +0x62, 0x180016bc2\nnop                                                                    ; +0x68, 0x180016bc8\nmov     rax, [rdi]                                                     ; +0x69, 0x180016bc9\nmovsxd  rcx, dword ptr [rax+4]                                         ; +0x6c, 0x180016bcc\nlea     rax, ??_7?$basic_ofstream@DU?$char_traits@D@std@@@std@@6B@; const std::ofstream::`vftable' ; +0x70, 0x180016bd0\nmov     [rcx+rdi], rax                                                 ; +0x77, 0x180016bd7\nmov     rax, [rdi]                                                     ; +0x7b, 0x180016bdb\nmovsxd  rcx, dword ptr [rax+4]                                         ; +0x7e, 0x180016bde\nlea     edx, [rcx-0A8h]                                                ; +0x82, 0x180016be2\nmov     [rcx+rdi-4], edx                                               ; +0x88, 0x180016be8\nmov     [rsp+48h+var_28], rbx                                          ; +0x8c, 0x180016bec\nmov     rcx, rbx                                                       ; +0x91, 0x180016bf1\ncall    cs:??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ; std::streambuf::streambuf(void) ; +0x94, 0x180016bf4\nlea     rax, ??_7?$basic_filebuf@DU?$char_traits@D@std@@@std@@6B@; const std::filebuf::`vftable' ; +0x9a, 0x180016bfa\nmov     [rbx], rax                                                     ; +0xa1, 0x180016c01\nmov     byte ptr [rbx+7Ch], 0                                          ; +0xa4, 0x180016c04\nmov     byte ptr [rbx+71h], 0                                          ; +0xa8, 0x180016c08\nmov     rcx, rbx                                                       ; +0xac, 0x180016c0c\ncall    cs:?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ; std::streambuf::_Init(void) ; +0xaf, 0x180016c0f\nmov     qword ptr [rbx+80h], 0                                         ; +0xb5, 0x180016c15\nmov     rax, cs:qword_1801A8360                                        ; +0xc0, 0x180016c20\nmov     [rbx+74h], rax                                                 ; +0xc7, 0x180016c27\nmov     qword ptr [rbx+68h], 0                                         ; +0xcb, 0x180016c2b\nor      esi, 2                                                         ; +0xd3, 0x180016c33\nmov     r9d, ebp                                                       ; +0xd6, 0x180016c36\nmov     r8d, esi                                                       ; +0xd9, 0x180016c39\nmov     rdx, r14                                                       ; +0xdc, 0x180016c3c\nmov     rcx, rbx                                                       ; +0xdf, 0x180016c3f\ncall    sub_18001C230                                                  ; +0xe2, 0x180016c42\ntest    rax, rax                                                       ; +0xe7, 0x180016c47\njnz     short loc_180016C64                                            ; +0xea, 0x180016c4a\nmov     rax, [rdi]                                                     ; +0xec, 0x180016c4c\nmovsxd  rcx, dword ptr [rax+4]                                         ; +0xef, 0x180016c4f\nadd     rcx, rdi                                                       ; +0xf3, 0x180016c53\nxor     r8d, r8d                                                       ; +0xf6, 0x180016c56\nlea     edx, [r8+2]                                                    ; +0xf9, 0x180016c59\ncall    cs:?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z; std::ios::setstate(int,bool) ; +0xfd, 0x180016c5d\nnop                                                                    ; +0x103, 0x180016c63\nmov     rax, rdi                                                       ; +0x104, 0x180016c64\nmov     rbx, [rsp+48h+arg_8]                                           ; +0x107, 0x180016c67\nmov     rbp, [rsp+48h+arg_18]                                          ; +0x10c, 0x180016c6c\nadd     rsp, 30h                                                       ; +0x111, 0x180016c71\npop     r14                                                            ; +0x115, 0x180016c75\npop     rdi                                                            ; +0x117, 0x180016c77\npop     rsi                                                            ; +0x118, 0x180016c78\nretn                                                                   ; +0x119, 0x180016c79", "xrefs": ["DS_Dictionary::copyFile @ 0x180019716", "DS_Dictionary::saveRootSubDictToCompressedFile @ 0x18001d7a4", "DS_Dictionary::saveRootSubDictToFile @ 0x18001dec2", "<???> @ 0x1801ae5b4"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}