{"type": "func", "start": 6443694588, "end": 6443694719, "name": "_fclose_nolock", "pseudocode": "// \n// _fclose_nolock from 0x18012f9fc to 0x18012fa7f (131 bytes)\n// \n// 2 xrefs:\n// > fclose @ 0x18012facf\n// > <???> @ 0x180202dc8\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\nint __cdecl fclose_nolock(FILE *Stream)\n{\n  int v3; // edi\n  unsigned int v4; // eax\n  char *tmpfname; // rcx\n\n  if ( Stream )\n  {\n    v3 = -1;\n    if ( (HIDWORD(Stream->_base) & 0x2000) != 0 )\n    {\n      v3 = _acrt_stdio_flush_nolock(Stream);\n      _acrt_stdio_free_buffer_nolock(Stream);\n      v4 = fileno(Stream);\n      if ( (int)sub_180138B78(v4) >= 0 )\n      {\n        tmpfname = Stream->_tmpfname;\n        if ( tmpfname )\n        {\n          free_base(tmpfname);\n          Stream->_tmpfname = nullptr;\n        }\n      }\n      else\n      {\n        v3 = -1;\n      }\n    }\n    __acrt_stdio_free_stream(Stream);\n    return v3;\n  }\n  else\n  {\n    *errno() = 22;\n    invalid_parameter_noinfo();\n    return -1;\n  }\n}", "assembly": "; \n; _fclose_nolock from 0x18012f9fc to 0x18012fa7f (131 bytes)\n; \n; 2 xrefs:\n; > fclose @ 0x18012facf\n; > <???> @ 0x180202dc8\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, 0x18012f9fc\npush    rdi                                                            ; +0x5, 0x18012fa01\nsub     rsp, 20h                                                       ; +0x6, 0x18012fa02\nmov     rbx, rcx                                                       ; +0xa, 0x18012fa06\ntest    rcx, rcx                                                       ; +0xd, 0x18012fa09\njnz     short loc_18012FA23                                            ; +0x10, 0x18012fa0c\ncall    _errno                                                         ; +0x12, 0x18012fa0e\nmov     dword ptr [rax], 16h                                           ; +0x17, 0x18012fa13\ncall    _invalid_parameter_noinfo                                      ; +0x1d, 0x18012fa19\nor      eax, 0FFFFFFFFh                                                ; +0x22, 0x18012fa1e\njmp     short loc_18012FA74                                            ; +0x25, 0x18012fa21\nmov     eax, [rcx+14h]                                                 ; +0x27, 0x18012fa23\nor      edi, 0FFFFFFFFh                                                ; +0x2a, 0x18012fa26\nshr     eax, 0Dh                                                       ; +0x2d, 0x18012fa29\ntest    al, 1                                                          ; +0x30, 0x18012fa2c\njz      short loc_18012FA6A                                            ; +0x32, 0x18012fa2e\ncall    __acrt_stdio_flush_nolock                                      ; +0x34, 0x18012fa30\nmov     rcx, rbx                                                       ; +0x39, 0x18012fa35\nmov     edi, eax                                                       ; +0x3c, 0x18012fa38\ncall    __acrt_stdio_free_buffer_nolock                                ; +0x3e, 0x18012fa3a\nmov     rcx, rbx; Stream                                               ; +0x43, 0x18012fa3f\ncall    _fileno                                                        ; +0x46, 0x18012fa42\nmov     ecx, eax                                                       ; +0x4b, 0x18012fa47\ncall    sub_180138B78                                                  ; +0x4d, 0x18012fa49\ntest    eax, eax                                                       ; +0x52, 0x18012fa4e\njns     short loc_18012FA57                                            ; +0x54, 0x18012fa50\nor      edi, 0FFFFFFFFh                                                ; +0x56, 0x18012fa52\njmp     short loc_18012FA6A                                            ; +0x59, 0x18012fa55\nmov     rcx, [rbx+28h]; Block                                          ; +0x5b, 0x18012fa57\ntest    rcx, rcx                                                       ; +0x5f, 0x18012fa5b\njz      short loc_18012FA6A                                            ; +0x62, 0x18012fa5e\ncall    _free_base                                                     ; +0x64, 0x18012fa60\nand     qword ptr [rbx+28h], 0                                         ; +0x69, 0x18012fa65\nmov     rcx, rbx                                                       ; +0x6e, 0x18012fa6a\ncall    ?__acrt_stdio_free_stream@@YAXV__crt_stdio_stream@@@Z          ; +0x71, 0x18012fa6d\nmov     eax, edi                                                       ; +0x76, 0x18012fa72\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x78, 0x18012fa74\nadd     rsp, 20h                                                       ; +0x7d, 0x18012fa79\npop     rdi                                                            ; +0x81, 0x18012fa7d\nretn                                                                   ; +0x82, 0x18012fa7e", "xrefs": ["fclose @ 0x18012facf", "<???> @ 0x180202dc8"], "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"}