{"type": "func", "start": 6442566192, "end": 6442566511, "name": "sub_18001C230", "pseudocode": "// \n// sub_18001C230 from 0x18001c230 to 0x18001c36f (319 bytes)\n// \n// 3 xrefs:\n// > sub_180016A40 @ 0x180016b22\n// > sub_180016B60 @ 0x180016c42\n// > <???> @ 0x1801aead0\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=1\n__int64 __fastcall sub_18001C230(__int64 a1, const char *a2, int a3, int a4)\n{\n  FILE *v5; // rdi\n  __int64 v6; // rax\n  struct std::_Facet_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_1801A8360;\n  *(_QWORD *)(a1 + 104) = 0;\n  v6 = std::streambuf::getloc(a1, &Base);\n  v7 = sub_180016880(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_18001C230 from 0x18001c230 to 0x18001c36f (319 bytes)\n; \n; 3 xrefs:\n; > sub_180016A40 @ 0x180016b22\n; > sub_180016B60 @ 0x180016c42\n; > <???> @ 0x1801aead0\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, 0x18001c230\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x18001c235\npush    rdi                                                            ; +0xa, 0x18001c23a\nsub     rsp, 60h                                                       ; +0xb, 0x18001c23b\nmov     eax, r8d                                                       ; +0xf, 0x18001c23f\nmov     r10, rdx                                                       ; +0x12, 0x18001c242\nmov     rbx, rcx                                                       ; +0x15, 0x18001c245\ncmp     qword ptr [rcx+80h], 0                                         ; +0x18, 0x18001c248\njnz     loc_18001C35A                                                  ; +0x20, 0x18001c250\nmov     r8d, r9d; int                                                  ; +0x26, 0x18001c256\nmov     edx, eax; int                                                  ; +0x29, 0x18001c259\nmov     rcx, r10; char *                                               ; +0x2b, 0x18001c25b\ncall    ?_Fiopen@std@@YAPEAU_iobuf@@PEBDHH@Z; std::_Fiopen(char const *,int,int) ; +0x2e, 0x18001c25e\nmov     rdi, rax                                                       ; +0x33, 0x18001c263\ntest    rax, rax                                                       ; +0x36, 0x18001c266\njz      loc_18001C35A                                                  ; +0x39, 0x18001c269\nmov     byte ptr [rbx+7Ch], 1                                          ; +0x3f, 0x18001c26f\nmov     byte ptr [rbx+71h], 0                                          ; +0x43, 0x18001c273\nmov     rcx, rbx                                                       ; +0x47, 0x18001c277\ncall    cs:?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ; std::streambuf::_Init(void) ; +0x4a, 0x18001c27a\nxor     esi, esi                                                       ; +0x50, 0x18001c280\nmov     [rsp+68h+Base], rsi                                            ; +0x52, 0x18001c282\nmov     [rsp+68h+Pointer], rsi                                         ; +0x57, 0x18001c287\nmov     [rsp+68h+Count], rsi                                           ; +0x5c, 0x18001c28c\nlea     r9, [rsp+68h+Count]; Count                                     ; +0x61, 0x18001c291\nlea     r8, [rsp+68h+Pointer]; Pointer                                 ; +0x66, 0x18001c296\nlea     rdx, [rsp+68h+Base]; Base                                      ; +0x6b, 0x18001c29b\nmov     rcx, rdi; Stream                                               ; +0x70, 0x18001c2a0\ncall    cs:_get_stream_buffer_pointers                                 ; +0x73, 0x18001c2a3\nmov     r9, [rsp+68h+Count]                                            ; +0x79, 0x18001c2a9\nmov     [rsp+68h+var_38], r9                                           ; +0x7e, 0x18001c2ae\nmov     r8, [rsp+68h+Pointer]                                          ; +0x83, 0x18001c2b3\nmov     [rsp+68h+var_40], r8                                           ; +0x88, 0x18001c2b8\nmov     rdx, [rsp+68h+Base]                                            ; +0x8d, 0x18001c2bd\nmov     [rsp+68h+var_48], rdx                                          ; +0x92, 0x18001c2c2\nmov     rcx, rbx                                                       ; +0x97, 0x18001c2c7\ncall    cs:?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z; std::streambuf::_Init(char * *,char * *,int *,char * *,char * *,int *) ; +0x9a, 0x18001c2ca\nmov     [rbx+80h], rdi                                                 ; +0xa0, 0x18001c2d0\nmov     rax, cs:qword_1801A8360                                        ; +0xa7, 0x18001c2d7\nmov     [rbx+74h], rax                                                 ; +0xae, 0x18001c2de\nmov     [rbx+68h], rsi                                                 ; +0xb2, 0x18001c2e2\nlea     rdx, [rsp+68h+Base]                                            ; +0xb6, 0x18001c2e6\nmov     rcx, rbx                                                       ; +0xbb, 0x18001c2eb\ncall    cs:?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEBA?AVlocale@2@XZ; std::streambuf::getloc(void) ; +0xbe, 0x18001c2ee\nnop                                                                    ; +0xc4, 0x18001c2f4\nmov     rcx, rax                                                       ; +0xc5, 0x18001c2f5\ncall    sub_180016880                                                  ; +0xc8, 0x18001c2f8\nmov     rdi, rax                                                       ; +0xcd, 0x18001c2fd\nmov     rcx, rax                                                       ; +0xd0, 0x18001c300\ncall    cs:?always_noconv@codecvt_base@std@@QEBA_NXZ; std::codecvt_base::always_noconv(void) ; +0xd3, 0x18001c303\ntest    al, al                                                         ; +0xd9, 0x18001c309\njz      short loc_18001C313                                            ; +0xdb, 0x18001c30b\nmov     [rbx+68h], rsi                                                 ; +0xdd, 0x18001c30d\njmp     short loc_18001C321                                            ; +0xe1, 0x18001c311\nmov     [rbx+68h], rdi                                                 ; +0xe3, 0x18001c313\nmov     rcx, rbx                                                       ; +0xe7, 0x18001c317\ncall    cs:?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ; std::streambuf::_Init(void) ; +0xea, 0x18001c31a\nnop                                                                    ; +0xf0, 0x18001c320\nmov     rcx, [rsp+68h+var_18]                                          ; +0xf1, 0x18001c321\ntest    rcx, rcx                                                       ; +0xf6, 0x18001c326\njz      short loc_18001C344                                            ; +0xf9, 0x18001c329\nmov     rax, [rcx]                                                     ; +0xfb, 0x18001c32b\ncall    qword ptr [rax+10h]                                            ; +0xfe, 0x18001c32e\ntest    rax, rax                                                       ; +0x101, 0x18001c331\njz      short loc_18001C344                                            ; +0x104, 0x18001c334\nmov     r8, [rax]                                                      ; +0x106, 0x18001c336\nmov     edx, 1                                                         ; +0x109, 0x18001c339\nmov     rcx, rax                                                       ; +0x10e, 0x18001c33e\ncall    qword ptr [r8]                                                 ; +0x111, 0x18001c341\nmov     rax, rbx                                                       ; +0x114, 0x18001c344\nmov     rbx, [rsp+68h+arg_8]                                           ; +0x117, 0x18001c347\nmov     rsi, [rsp+68h+arg_10]                                          ; +0x11c, 0x18001c34c\nadd     rsp, 60h                                                       ; +0x124, 0x18001c354\npop     rdi                                                            ; +0x128, 0x18001c358\nretn                                                                   ; +0x129, 0x18001c359\nxor     eax, eax                                                       ; +0x12a, 0x18001c35a\nmov     rbx, [rsp+68h+arg_8]                                           ; +0x12c, 0x18001c35c\nmov     rsi, [rsp+68h+arg_10]                                          ; +0x131, 0x18001c361\nadd     rsp, 60h                                                       ; +0x139, 0x18001c369\npop     rdi                                                            ; +0x13d, 0x18001c36d\nretn                                                                   ; +0x13e, 0x18001c36e", "xrefs": ["sub_180016A40 @ 0x180016b22", "sub_180016B60 @ 0x180016c42", "<???> @ 0x1801aead0"], "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"}