{"type": "func", "start": 6443759344, "end": 6443759527, "name": "unknown_libname_72", "pseudocode": "// \n// unknown_libname_72 from 0x18013f6f0 to 0x18013f7a7 (183 bytes)\n// \n// 2 xrefs:\n// > unknown_libname_68 @ 0x1801384c4\n// > <???> @ 0x180203b9c\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_72(unsigned __int8 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 0xFFFFFFFFLL;\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<char>(a1, a2) )\n    goto LABEL_3;\n  return a1;\n}", "assembly": "; \n; unknown_libname_72 from 0x18013f6f0 to 0x18013f7a7 (183 bytes)\n; \n; 2 xrefs:\n; > unknown_libname_68 @ 0x1801384c4\n; > <???> @ 0x180203b9c\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, 0x18013f6f0\npush    rdi                                                            ; +0x5, 0x18013f6f5\nsub     rsp, 20h                                                       ; +0x6, 0x18013f6f6\nmov     edi, ecx                                                       ; +0xa, 0x18013f6fa\nmov     rbx, rdx                                                       ; +0xc, 0x18013f6fc\nmov     rcx, rdx; Stream                                               ; +0xf, 0x18013f6ff\ncall    _fileno                                                        ; +0x12, 0x18013f702\nmov     eax, [rbx+14h]                                                 ; +0x17, 0x18013f707\ntest    al, 6                                                          ; +0x1a, 0x18013f70a\njnz     short loc_18013F723                                            ; +0x1c, 0x18013f70c\ncall    _errno                                                         ; +0x1e, 0x18013f70e\nmov     dword ptr [rax], 9                                             ; +0x23, 0x18013f713\nlock or dword ptr [rbx+14h], 10h                                       ; +0x29, 0x18013f719\nor      eax, 0FFFFFFFFh                                                ; +0x2e, 0x18013f71e\njmp     short loc_18013F79C                                            ; +0x31, 0x18013f721\nmov     eax, [rbx+14h]                                                 ; +0x33, 0x18013f723\nshr     eax, 0Ch                                                       ; +0x36, 0x18013f726\ntest    al, 1                                                          ; +0x39, 0x18013f729\njz      short loc_18013F73A                                            ; +0x3b, 0x18013f72b\ncall    _errno                                                         ; +0x3d, 0x18013f72d\nmov     dword ptr [rax], 22h ; '\"'                                     ; +0x42, 0x18013f732\njmp     short loc_18013F719                                            ; +0x48, 0x18013f738\nmov     eax, [rbx+14h]                                                 ; +0x4a, 0x18013f73a\ntest    al, 1                                                          ; +0x4d, 0x18013f73d\njz      short loc_18013F75D                                            ; +0x4f, 0x18013f73f\nmov     rcx, rbx                                                       ; +0x51, 0x18013f741\ncall    ?stream_is_at_end_of_file_nolock@@YA_NV__crt_stdio_stream@@@Z  ; +0x54, 0x18013f744\nand     dword ptr [rbx+10h], 0                                         ; +0x59, 0x18013f749\ntest    al, al                                                         ; +0x5d, 0x18013f74d\njz      short loc_18013F719                                            ; +0x5f, 0x18013f74f\nmov     rax, [rbx+8]                                                   ; +0x61, 0x18013f751\nmov     [rbx], rax                                                     ; +0x65, 0x18013f755\nlock and dword ptr [rbx+14h], 0FFFFFFFEh                               ; +0x68, 0x18013f758\nlock or dword ptr [rbx+14h], 2                                         ; +0x6d, 0x18013f75d\nlock and dword ptr [rbx+14h], 0FFFFFFF7h                               ; +0x72, 0x18013f762\nand     dword ptr [rbx+10h], 0                                         ; +0x77, 0x18013f767\nmov     eax, [rbx+14h]                                                 ; +0x7b, 0x18013f76b\ntest    eax, 4C0h                                                      ; +0x7e, 0x18013f76e\njnz     short loc_18013F789                                            ; +0x83, 0x18013f773\nmov     rcx, rbx; Stream                                               ; +0x85, 0x18013f775\ncall    __acrt_should_use_temporary_buffer                             ; +0x88, 0x18013f778\ntest    al, al                                                         ; +0x8d, 0x18013f77d\njnz     short loc_18013F789                                            ; +0x8f, 0x18013f77f\nmov     rcx, rbx                                                       ; +0x91, 0x18013f781\ncall    __acrt_stdio_allocate_buffer_nolock                            ; +0x94, 0x18013f784\nmov     rdx, rbx                                                       ; +0x99, 0x18013f789\nmov     cl, dil                                                        ; +0x9c, 0x18013f78c\ncall    ??$write_buffer_nolock@D@@YA_NDV__crt_stdio_stream@@@Z         ; +0x9f, 0x18013f78f\ntest    al, al                                                         ; +0xa4, 0x18013f794\njz      short loc_18013F719                                            ; +0xa6, 0x18013f796\nmovzx   eax, dil                                                       ; +0xa8, 0x18013f798\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xac, 0x18013f79c\nadd     rsp, 20h                                                       ; +0xb1, 0x18013f7a1\npop     rdi                                                            ; +0xb5, 0x18013f7a5\nretn                                                                   ; +0xb6, 0x18013f7a6", "xrefs": ["unknown_libname_68 @ 0x1801384c4", "<???> @ 0x180203b9c"], "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"}