{"type": "func", "start": 6442565856, "end": 6442566178, "name": "sub_18001C0E0", "pseudocode": "// \n// sub_18001C0E0 from 0x18001c0e0 to 0x18001c222 (322 bytes)\n// \n// 3 xrefs:\n// > sub_180016630 @ 0x180016717\n// > sub_180016750 @ 0x180016831\n// > <???> @ 0x1801b8b3c\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:21:26 +0000\n// \n\n// Hidden C++ exception states: #wind=1\n__int64 __fastcall sub_18001C0E0(__int64 a1, const char *a2, int a3, int a4)\n{\n  FILE *v5; // rdi\n  __int64 v6; // rax\n  std::codecvt_base *v7; // rdi\n  void (__fastcall ***v8)(_QWORD, __int64); // rax\n  char **Pointer; // [rsp+40h] [rbp-28h] BYREF\n  char **Base; // [rsp+48h] [rbp-20h] BYREF\n  __int64 v12; // [rsp+50h] [rbp-18h]\n  int *Count; // [rsp+70h] [rbp+8h] BYREF\n\n  if ( *(_QWORD *)(a1 + 128) )\n    return 0;\n  v5 = std::_Fiopen(a2, a3, a4);\n  if ( !v5 )\n    return 0;\n  *(_BYTE *)(a1 + 124) = 1;\n  *(_BYTE *)(a1 + 113) = 0;\n  std::streambuf::_Init(a1);\n  Base = nullptr;\n  Pointer = nullptr;\n  Count = nullptr;\n  get_stream_buffer_pointers(v5, &Base, &Pointer, &Count);\n  std::streambuf::_Init(a1);\n  *(_QWORD *)(a1 + 128) = v5;\n  *(_QWORD *)(a1 + 116) = qword_1801B2388;\n  *(_QWORD *)(a1 + 104) = 0;\n  v6 = std::streambuf::getloc(a1, &Base);\n  v7 = (std::codecvt_base *)sub_180016430(v6);\n  if ( std::codecvt_base::always_noconv(v7) )\n  {\n    *(_QWORD *)(a1 + 104) = 0;\n  }\n  else\n  {\n    *(_QWORD *)(a1 + 104) = v7;\n    std::streambuf::_Init(a1);\n  }\n  if ( v12 )\n  {\n    v8 = (void (__fastcall ***)(_QWORD, __int64))(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v12 + 16LL))(v12);\n    if ( v8 )\n      (**v8)(v8, 1);\n  }\n  return a1;\n}", "assembly": "; \n; sub_18001C0E0 from 0x18001c0e0 to 0x18001c222 (322 bytes)\n; \n; 3 xrefs:\n; > sub_180016630 @ 0x180016717\n; > sub_180016750 @ 0x180016831\n; > <???> @ 0x1801b8b3c\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:21:26 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x18001c0e0\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x18001c0e5\npush    rdi                                                            ; +0xa, 0x18001c0ea\nsub     rsp, 60h                                                       ; +0xb, 0x18001c0eb\nmov     eax, r8d                                                       ; +0xf, 0x18001c0ef\nmov     r10, rdx                                                       ; +0x12, 0x18001c0f2\nmov     rbx, rcx                                                       ; +0x15, 0x18001c0f5\ncmp     qword ptr [rcx+80h], 0                                         ; +0x18, 0x18001c0f8\njnz     loc_18001C20D                                                  ; +0x20, 0x18001c100\nmov     r8d, r9d; int                                                  ; +0x26, 0x18001c106\nmov     edx, eax; int                                                  ; +0x29, 0x18001c109\nmov     rcx, r10; char *                                               ; +0x2b, 0x18001c10b\ncall    ?_Fiopen@std@@YAPEAU_iobuf@@PEBDHH@Z; std::_Fiopen(char const *,int,int) ; +0x2e, 0x18001c10e\nmov     rdi, rax                                                       ; +0x33, 0x18001c113\ntest    rax, rax                                                       ; +0x36, 0x18001c116\njz      loc_18001C20D                                                  ; +0x39, 0x18001c119\nmov     byte ptr [rbx+7Ch], 1                                          ; +0x3f, 0x18001c11f\nmov     byte ptr [rbx+71h], 0                                          ; +0x43, 0x18001c123\nmov     rcx, rbx                                                       ; +0x47, 0x18001c127\ncall    cs:?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ; std::streambuf::_Init(void) ; +0x4a, 0x18001c12a\nxor     esi, esi                                                       ; +0x50, 0x18001c130\nmov     [rsp+68h+Base], rsi                                            ; +0x52, 0x18001c132\nmov     [rsp+68h+Pointer], rsi                                         ; +0x57, 0x18001c137\nmov     [rsp+68h+Count], rsi                                           ; +0x5c, 0x18001c13c\nlea     r9, [rsp+68h+Count]; Count                                     ; +0x61, 0x18001c141\nlea     r8, [rsp+68h+Pointer]; Pointer                                 ; +0x66, 0x18001c146\nlea     rdx, [rsp+68h+Base]; Base                                      ; +0x6b, 0x18001c14b\nmov     rcx, rdi; Stream                                               ; +0x70, 0x18001c150\ncall    cs:_get_stream_buffer_pointers                                 ; +0x73, 0x18001c153\nmov     r9, [rsp+68h+Count]                                            ; +0x79, 0x18001c159\nmov     [rsp+68h+var_38], r9                                           ; +0x7e, 0x18001c15e\nmov     r8, [rsp+68h+Pointer]                                          ; +0x83, 0x18001c163\nmov     [rsp+68h+var_40], r8                                           ; +0x88, 0x18001c168\nmov     rdx, [rsp+68h+Base]                                            ; +0x8d, 0x18001c16d\nmov     [rsp+68h+var_48], rdx                                          ; +0x92, 0x18001c172\nmov     rcx, rbx                                                       ; +0x97, 0x18001c177\ncall    cs:?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z; std::streambuf::_Init(char * *,char * *,int *,char * *,char * *,int *) ; +0x9a, 0x18001c17a\nmov     [rbx+80h], rdi                                                 ; +0xa0, 0x18001c180\nmov     rax, cs:qword_1801B2388                                        ; +0xa7, 0x18001c187\nmov     [rbx+74h], rax                                                 ; +0xae, 0x18001c18e\nmov     [rbx+68h], rsi                                                 ; +0xb2, 0x18001c192\nlea     rdx, [rsp+68h+Base]                                            ; +0xb6, 0x18001c196\nmov     rcx, rbx                                                       ; +0xbb, 0x18001c19b\ncall    cs:?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEBA?AVlocale@2@XZ; std::streambuf::getloc(void) ; +0xbe, 0x18001c19e\nnop                                                                    ; +0xc4, 0x18001c1a4\nmov     rcx, rax                                                       ; +0xc5, 0x18001c1a5\ncall    sub_180016430                                                  ; +0xc8, 0x18001c1a8\nmov     rdi, rax                                                       ; +0xcd, 0x18001c1ad\nmov     rcx, rax                                                       ; +0xd0, 0x18001c1b0\ncall    cs:?always_noconv@codecvt_base@std@@QEBA_NXZ; std::codecvt_base::always_noconv(void) ; +0xd3, 0x18001c1b3\ntest    al, al                                                         ; +0xd9, 0x18001c1b9\njz      short loc_18001C1C3                                            ; +0xdb, 0x18001c1bb\nmov     [rbx+68h], rsi                                                 ; +0xdd, 0x18001c1bd\njmp     short loc_18001C1D1                                            ; +0xe1, 0x18001c1c1\nmov     [rbx+68h], rdi                                                 ; +0xe3, 0x18001c1c3\nmov     rcx, rbx                                                       ; +0xe7, 0x18001c1c7\ncall    cs:?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ; std::streambuf::_Init(void) ; +0xea, 0x18001c1ca\nnop                                                                    ; +0xf0, 0x18001c1d0\nmov     rcx, [rsp+68h+var_18]                                          ; +0xf1, 0x18001c1d1\ntest    rcx, rcx                                                       ; +0xf6, 0x18001c1d6\njz      short loc_18001C1F7                                            ; +0xf9, 0x18001c1d9\nmov     rax, [rcx]                                                     ; +0xfb, 0x18001c1db\ncall    qword ptr [rax+10h]                                            ; +0xfe, 0x18001c1de\ntest    rax, rax                                                       ; +0x101, 0x18001c1e1\njz      short loc_18001C1F7                                            ; +0x104, 0x18001c1e4\nmov     rcx, [rax]                                                     ; +0x106, 0x18001c1e6\nmov     r8, [rcx]                                                      ; +0x109, 0x18001c1e9\nmov     edx, 1                                                         ; +0x10c, 0x18001c1ec\nmov     rcx, rax                                                       ; +0x111, 0x18001c1f1\ncall    r8                                                             ; +0x114, 0x18001c1f4\nmov     rax, rbx                                                       ; +0x117, 0x18001c1f7\nmov     rbx, [rsp+68h+arg_8]                                           ; +0x11a, 0x18001c1fa\nmov     rsi, [rsp+68h+arg_10]                                          ; +0x11f, 0x18001c1ff\nadd     rsp, 60h                                                       ; +0x127, 0x18001c207\npop     rdi                                                            ; +0x12b, 0x18001c20b\nretn                                                                   ; +0x12c, 0x18001c20c\nxor     eax, eax                                                       ; +0x12d, 0x18001c20d\nmov     rbx, [rsp+68h+arg_8]                                           ; +0x12f, 0x18001c20f\nmov     rsi, [rsp+68h+arg_10]                                          ; +0x134, 0x18001c214\nadd     rsp, 60h                                                       ; +0x13c, 0x18001c21c\npop     rdi                                                            ; +0x140, 0x18001c220\nretn                                                                   ; +0x141, 0x18001c221", "xrefs": ["sub_180016630 @ 0x180016717", "sub_180016750 @ 0x180016831", "<???> @ 0x1801b8b3c"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}