{"type": "func", "start": 6443759528, "end": 6443759716, "name": "unknown_libname_73", "pseudocode": "// \n// unknown_libname_73 from 0x18013f7a8 to 0x18013f864 (188 bytes)\n// \n// 2 xrefs:\n// > _fputwc_nolock @ 0x180138463\n// > <???> @ 0x180203ba8\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// Microsoft VisualC 64bit universal runtime\n__int64 __fastcall unknown_libname_73(unsigned __int16 a1, __int64 a2)\n{\n  bool v5; // al\n\n  fileno((FILE *)a2);\n  if ( (*(_DWORD *)(a2 + 20) & 6) == 0 )\n  {\n    *errno() = 9;\nLABEL_3:\n    _InterlockedOr((volatile signed __int32 *)(a2 + 20), 0x10u);\n    return 0xFFFF;\n  }\n  if ( (*(_DWORD *)(a2 + 20) & 0x1000) != 0 )\n  {\n    *errno() = 34;\n    goto LABEL_3;\n  }\n  if ( (*(_DWORD *)(a2 + 20) & 1) != 0 )\n  {\n    v5 = stream_is_at_end_of_file_nolock(a2);\n    *(_DWORD *)(a2 + 16) = 0;\n    if ( !v5 )\n      goto LABEL_3;\n    *(_QWORD *)a2 = *(_QWORD *)(a2 + 8);\n    _InterlockedAnd((volatile signed __int32 *)(a2 + 20), 0xFFFFFFFE);\n  }\n  _InterlockedOr((volatile signed __int32 *)(a2 + 20), 2u);\n  _InterlockedAnd((volatile signed __int32 *)(a2 + 20), 0xFFFFFFF7);\n  *(_DWORD *)(a2 + 16) = 0;\n  if ( (*(_DWORD *)(a2 + 20) & 0x4C0) == 0 && !_acrt_should_use_temporary_buffer((FILE *)a2) )\n    _acrt_stdio_allocate_buffer_nolock(a2);\n  if ( !write_buffer_nolock<wchar_t>(a1, a2) )\n    goto LABEL_3;\n  return a1;\n}", "assembly": "; \n; unknown_libname_73 from 0x18013f7a8 to 0x18013f864 (188 bytes)\n; \n; 2 xrefs:\n; > _fputwc_nolock @ 0x180138463\n; > <???> @ 0x180203ba8\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_0], rbx                                               ; +0x0, 0x18013f7a8\npush    rdi                                                            ; +0x5, 0x18013f7ad\nsub     rsp, 20h                                                       ; +0x6, 0x18013f7ae\nmov     edi, ecx                                                       ; +0xa, 0x18013f7b2\nmov     rbx, rdx                                                       ; +0xc, 0x18013f7b4\nmov     rcx, rdx; Stream                                               ; +0xf, 0x18013f7b7\ncall    _fileno                                                        ; +0x12, 0x18013f7ba\nmov     eax, [rbx+14h]                                                 ; +0x17, 0x18013f7bf\ntest    al, 6                                                          ; +0x1a, 0x18013f7c2\njnz     short loc_18013F7DD                                            ; +0x1c, 0x18013f7c4\ncall    _errno                                                         ; +0x1e, 0x18013f7c6\nmov     dword ptr [rax], 9                                             ; +0x23, 0x18013f7cb\nlock or dword ptr [rbx+14h], 10h                                       ; +0x29, 0x18013f7d1\nmov     eax, 0FFFFh                                                    ; +0x2e, 0x18013f7d6\njmp     short loc_18013F859                                            ; +0x33, 0x18013f7db\nmov     eax, [rbx+14h]                                                 ; +0x35, 0x18013f7dd\nshr     eax, 0Ch                                                       ; +0x38, 0x18013f7e0\ntest    al, 1                                                          ; +0x3b, 0x18013f7e3\njz      short loc_18013F7F4                                            ; +0x3d, 0x18013f7e5\ncall    _errno                                                         ; +0x3f, 0x18013f7e7\nmov     dword ptr [rax], 22h ; '\"'                                     ; +0x44, 0x18013f7ec\njmp     short loc_18013F7D1                                            ; +0x4a, 0x18013f7f2\nmov     eax, [rbx+14h]                                                 ; +0x4c, 0x18013f7f4\ntest    al, 1                                                          ; +0x4f, 0x18013f7f7\njz      short loc_18013F817                                            ; +0x51, 0x18013f7f9\nmov     rcx, rbx                                                       ; +0x53, 0x18013f7fb\ncall    ?stream_is_at_end_of_file_nolock@@YA_NV__crt_stdio_stream@@@Z  ; +0x56, 0x18013f7fe\nand     dword ptr [rbx+10h], 0                                         ; +0x5b, 0x18013f803\ntest    al, al                                                         ; +0x5f, 0x18013f807\njz      short loc_18013F7D1                                            ; +0x61, 0x18013f809\nmov     rax, [rbx+8]                                                   ; +0x63, 0x18013f80b\nmov     [rbx], rax                                                     ; +0x67, 0x18013f80f\nlock and dword ptr [rbx+14h], 0FFFFFFFEh                               ; +0x6a, 0x18013f812\nlock or dword ptr [rbx+14h], 2                                         ; +0x6f, 0x18013f817\nlock and dword ptr [rbx+14h], 0FFFFFFF7h                               ; +0x74, 0x18013f81c\nand     dword ptr [rbx+10h], 0                                         ; +0x79, 0x18013f821\nmov     eax, [rbx+14h]                                                 ; +0x7d, 0x18013f825\ntest    eax, 4C0h                                                      ; +0x80, 0x18013f828\njnz     short loc_18013F843                                            ; +0x85, 0x18013f82d\nmov     rcx, rbx; Stream                                               ; +0x87, 0x18013f82f\ncall    __acrt_should_use_temporary_buffer                             ; +0x8a, 0x18013f832\ntest    al, al                                                         ; +0x8f, 0x18013f837\njnz     short loc_18013F843                                            ; +0x91, 0x18013f839\nmov     rcx, rbx                                                       ; +0x93, 0x18013f83b\ncall    __acrt_stdio_allocate_buffer_nolock                            ; +0x96, 0x18013f83e\nmov     rdx, rbx                                                       ; +0x9b, 0x18013f843\nmovzx   ecx, di                                                        ; +0x9e, 0x18013f846\ncall    ??$write_buffer_nolock@_W@@YA_N_WV__crt_stdio_stream@@@Z       ; +0xa1, 0x18013f849\ntest    al, al                                                         ; +0xa6, 0x18013f84e\njz      loc_18013F7D1                                                  ; +0xa8, 0x18013f850\nmovzx   eax, di                                                        ; +0xae, 0x18013f856\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xb1, 0x18013f859\nadd     rsp, 20h                                                       ; +0xb6, 0x18013f85e\npop     rdi                                                            ; +0xba, 0x18013f862\nretn                                                                   ; +0xbb, 0x18013f863", "xrefs": ["_fputwc_nolock @ 0x180138463", "<???> @ 0x180203ba8"], "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"}