{"type": "func", "start": 6443729692, "end": 6443730071, "name": "_fputwc_nolock", "pseudocode": "// \n// _fputwc_nolock from 0x18013831c to 0x180138497 (379 bytes)\n// \n// 7 xrefs:\n// > __crt_stdio_output::write_multiple_characters<__crt_stdio_output::stream_output_adapter<wchar_t>,char> @ 0x18012c184\n// > __crt_stdio_output::output_processor<wchar_t,__crt_stdio_output::stream_output_adapter<wchar_t>,__crt_stdio_output::standard_base<wchar_t,__crt_stdio_output::stream_output_adapter<wchar_t>>>::process @ 0x18012caf7\n// > unknown_libname_57 @ 0x18012eec7\n// > __crt_stdio_output::output_adapter_common<wchar_t,__crt_stdio_output::stream_output_adapter<wchar_t>>::write_string_impl @ 0x18012f1e6\n// > __crt_stdio_output::output_adapter_common<wchar_t,__crt_stdio_output::stream_output_adapter<wchar_t>>::write_string_impl @ 0x18012f22a\n// > <???> @ 0x180203638\n// > <???> @ 0x180203644\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\nwint_t __cdecl fputwc_nolock(wchar_t Character, FILE *Stream)\n{\n  FILE *v2; // rdi\n  unsigned int v3; // esi\n  bool v4; // sf\n  char *v5; // rbp\n  __int64 v6; // rbx\n  _BYTE *v7; // rdx\n  __int64 v8; // rbx\n  int v9; // ebx\n  char *i; // rbp\n  int SizeConverted; // [rsp+20h] [rbp-38h] BYREF\n  char MbCh[12]; // [rsp+24h] [rbp-34h] BYREF\n\n  v2 = Stream;\n  v3 = Character;\n  if ( (HIDWORD(Stream->_base) & 0x1000) == 0 )\n  {\n    v5 = (char *)&unk_1801B19F0;\n    if ( fileno(Stream) == -1 || fileno(v2) == -2 )\n    {\n      v7 = &unk_1801B19F0;\n    }\n    else\n    {\n      v6 = (__int64)fileno(v2) >> 6;\n      v7 = (_BYTE *)(qword_1801F5160[v6] + 72LL * (fileno(v2) & 0x3F));\n    }\n    if ( (unsigned __int8)(v7[57] - 1) > 1u )\n    {\n      if ( fileno(v2) != -1 && fileno(v2) != -2 )\n      {\n        v8 = (__int64)fileno(v2) >> 6;\n        v5 = (char *)(qword_1801F5160[v8] + 72LL * (fileno(v2) & 0x3F));\n      }\n      v9 = 0;\n      if ( v5[56] < 0 )\n      {\n        if ( !wctomb_s(&SizeConverted, MbCh, 5u, v3) )\n        {\n          if ( SizeConverted <= 0 )\n            return v3;\n          for ( i = MbCh; (unsigned int)unknown_libname_68((unsigned int)*i, v2) != -1; ++i )\n          {\n            if ( ++v9 >= SizeConverted )\n              return v3;\n          }\n        }\n        return -1;\n      }\n    }\n    v4 = LODWORD(v2->_base) - 2 < 0;\n    LODWORD(v2->_base) -= 2;\n    if ( !v4 )\n    {\n      *(_WORD *)v2->_ptr = v3;\n      v2->_ptr += 2;\n      return v3;\n    }\n    Stream = v2;\n    return unknown_libname_73(v3, Stream);\n  }\n  v4 = LODWORD(Stream->_base) - 2 < 0;\n  LODWORD(Stream->_base) -= 2;\n  if ( v4 )\n    return unknown_libname_73(v3, Stream);\n  *(_WORD *)Stream->_ptr = Character;\n  Stream->_ptr += 2;\n  return v3;\n}", "assembly": "; \n; _fputwc_nolock from 0x18013831c to 0x180138497 (379 bytes)\n; \n; 7 xrefs:\n; > __crt_stdio_output::write_multiple_characters<__crt_stdio_output::stream_output_adapter<wchar_t>,char> @ 0x18012c184\n; > __crt_stdio_output::output_processor<wchar_t,__crt_stdio_output::stream_output_adapter<wchar_t>,__crt_stdio_output::standard_base<wchar_t,__crt_stdio_output::stream_output_adapter<wchar_t>>>::process @ 0x18012caf7\n; > unknown_libname_57 @ 0x18012eec7\n; > __crt_stdio_output::output_adapter_common<wchar_t,__crt_stdio_output::stream_output_adapter<wchar_t>>::write_string_impl @ 0x18012f1e6\n; > __crt_stdio_output::output_adapter_common<wchar_t,__crt_stdio_output::stream_output_adapter<wchar_t>>::write_string_impl @ 0x18012f22a\n; > <???> @ 0x180203638\n; > <???> @ 0x180203644\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, 0x18013831c\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x180138321\npush    rsi                                                            ; +0xa, 0x180138326\npush    rdi                                                            ; +0xb, 0x180138327\npush    r14                                                            ; +0xc, 0x180138328\nsub     rsp, 40h                                                       ; +0xe, 0x18013832a\nmov     rax, cs:__security_cookie                                      ; +0x12, 0x18013832e\nxor     rax, rsp                                                       ; +0x19, 0x180138335\nmov     [rsp+58h+var_28], rax                                          ; +0x1c, 0x180138338\nmov     eax, [rdx+14h]                                                 ; +0x21, 0x18013833d\nmov     rdi, rdx                                                       ; +0x24, 0x180138340\nmovzx   esi, cx                                                        ; +0x27, 0x180138343\nshr     eax, 0Ch                                                       ; +0x2a, 0x180138346\ntest    al, 1                                                          ; +0x2d, 0x180138349\njz      short loc_180138366                                            ; +0x2f, 0x18013834b\nadd     dword ptr [rdx+10h], 0FFFFFFFEh                                ; +0x31, 0x18013834d\njs      loc_180138461                                                  ; +0x35, 0x180138351\nmov     rax, [rdx]                                                     ; +0x3b, 0x180138357\nmov     [rax], si                                                      ; +0x3e, 0x18013835a\nadd     qword ptr [rdx], 2                                             ; +0x41, 0x18013835d\njmp     loc_180138474                                                  ; +0x45, 0x180138361\nmov     rcx, rdi; Stream                                               ; +0x4a, 0x180138366\ncall    _fileno                                                        ; +0x4d, 0x180138369\nlea     rbp, unk_1801B19F0                                             ; +0x52, 0x18013836e\nlea     r14, qword_1801F5160                                           ; +0x59, 0x180138375\ncmp     eax, 0FFFFFFFFh                                                ; +0x60, 0x18013837c\njz      short loc_1801383B6                                            ; +0x63, 0x18013837f\nmov     rcx, rdi; Stream                                               ; +0x65, 0x180138381\ncall    _fileno                                                        ; +0x68, 0x180138384\ncmp     eax, 0FFFFFFFEh                                                ; +0x6d, 0x180138389\njz      short loc_1801383B6                                            ; +0x70, 0x18013838c\nmov     rcx, rdi; Stream                                               ; +0x72, 0x18013838e\ncall    _fileno                                                        ; +0x75, 0x180138391\nmovsxd  rbx, eax                                                       ; +0x7a, 0x180138396\nmov     rcx, rdi; Stream                                               ; +0x7d, 0x180138399\nsar     rbx, 6                                                         ; +0x80, 0x18013839c\ncall    _fileno                                                        ; +0x84, 0x1801383a0\nand     eax, 3Fh                                                       ; +0x89, 0x1801383a5\nlea     rcx, [rax+rax*8]                                               ; +0x8c, 0x1801383a8\nmov     rax, [r14+rbx*8]                                               ; +0x90, 0x1801383ac\nlea     rdx, [rax+rcx*8]                                               ; +0x94, 0x1801383b0\njmp     short loc_1801383B9                                            ; +0x98, 0x1801383b4\nmov     rdx, rbp                                                       ; +0x9a, 0x1801383b6\nmov     al, [rdx+39h]                                                  ; +0x9d, 0x1801383b9\ndec     al                                                             ; +0xa0, 0x1801383bc\ncmp     al, 1                                                          ; +0xa2, 0x1801383be\njbe     loc_180138458                                                  ; +0xa4, 0x1801383c0\nmov     rcx, rdi; Stream                                               ; +0xaa, 0x1801383c6\ncall    _fileno                                                        ; +0xad, 0x1801383c9\ncmp     eax, 0FFFFFFFFh                                                ; +0xb2, 0x1801383ce\njz      short loc_180138406                                            ; +0xb5, 0x1801383d1\nmov     rcx, rdi; Stream                                               ; +0xb7, 0x1801383d3\ncall    _fileno                                                        ; +0xba, 0x1801383d6\ncmp     eax, 0FFFFFFFEh                                                ; +0xbf, 0x1801383db\njz      short loc_180138406                                            ; +0xc2, 0x1801383de\nmov     rcx, rdi; Stream                                               ; +0xc4, 0x1801383e0\ncall    _fileno                                                        ; +0xc7, 0x1801383e3\nmovsxd  rbx, eax                                                       ; +0xcc, 0x1801383e8\nmov     rcx, rdi; Stream                                               ; +0xcf, 0x1801383eb\nsar     rbx, 6                                                         ; +0xd2, 0x1801383ee\ncall    _fileno                                                        ; +0xd6, 0x1801383f2\nand     eax, 3Fh                                                       ; +0xdb, 0x1801383f7\nlea     rcx, [rax+rax*8]                                               ; +0xde, 0x1801383fa\nmov     rax, [r14+rbx*8]                                               ; +0xe2, 0x1801383fe\nlea     rbp, [rax+rcx*8]                                               ; +0xe6, 0x180138402\nxor     ebx, ebx                                                       ; +0xea, 0x180138406\ncmp     [rbp+38h], bl                                                  ; +0xec, 0x180138408\njge     short loc_180138458                                            ; +0xef, 0x18013840b\nmovzx   r9d, si; WCh                                                   ; +0xf1, 0x18013840d\nlea     r8d, [rbx+5]; SizeInBytes                                      ; +0xf5, 0x180138411\nlea     rdx, [rsp+58h+MbCh]; MbCh                                      ; +0xf9, 0x180138415\nlea     rcx, [rsp+58h+SizeConverted]; SizeConverted                    ; +0xfe, 0x18013841a\ncall    wctomb_s                                                       ; +0x103, 0x18013841f\ntest    eax, eax                                                       ; +0x108, 0x180138424\njnz     short loc_180138451                                            ; +0x10a, 0x180138426\ncmp     [rsp+58h+SizeConverted], ebx                                   ; +0x10c, 0x180138428\njle     short loc_180138474                                            ; +0x110, 0x18013842c\nlea     rbp, [rsp+58h+MbCh]                                            ; +0x112, 0x18013842e\nmovsx   ecx, byte ptr [rbp+0]                                          ; +0x117, 0x180138433\nmov     rdx, rdi                                                       ; +0x11b, 0x180138437\ncall    unknown_libname_68; Microsoft VisualC 64bit universal runtime  ; +0x11e, 0x18013843a\ncmp     eax, 0FFFFFFFFh                                                ; +0x123, 0x18013843f\njz      short loc_180138451                                            ; +0x126, 0x180138442\ninc     ebx                                                            ; +0x128, 0x180138444\ninc     rbp                                                            ; +0x12a, 0x180138446\ncmp     ebx, [rsp+58h+SizeConverted]                                   ; +0x12d, 0x180138449\njl      short loc_180138433                                            ; +0x131, 0x18013844d\njmp     short loc_180138474                                            ; +0x133, 0x18013844f\nmov     eax, 0FFFFh                                                    ; +0x135, 0x180138451\njmp     short loc_180138477                                            ; +0x13a, 0x180138456\nadd     dword ptr [rdi+10h], 0FFFFFFFEh                                ; +0x13c, 0x180138458\njns     short loc_18013846A                                            ; +0x140, 0x18013845c\nmov     rdx, rdi                                                       ; +0x142, 0x18013845e\nmov     ecx, esi                                                       ; +0x145, 0x180138461\ncall    unknown_libname_73; Microsoft VisualC 64bit universal runtime  ; +0x147, 0x180138463\njmp     short loc_180138477                                            ; +0x14c, 0x180138468\nmov     rax, [rdi]                                                     ; +0x14e, 0x18013846a\nmov     [rax], si                                                      ; +0x151, 0x18013846d\nadd     qword ptr [rdi], 2                                             ; +0x154, 0x180138470\nmovzx   eax, si                                                        ; +0x158, 0x180138474\nmov     rcx, [rsp+58h+var_28]                                          ; +0x15b, 0x180138477\nxor     rcx, rsp; StackCookie                                          ; +0x160, 0x18013847c\ncall    __security_check_cookie                                        ; +0x163, 0x18013847f\nmov     rbx, [rsp+58h+arg_8]                                           ; +0x168, 0x180138484\nmov     rbp, [rsp+58h+arg_10]                                          ; +0x16d, 0x180138489\nadd     rsp, 40h                                                       ; +0x172, 0x18013848e\npop     r14                                                            ; +0x176, 0x180138492\npop     rdi                                                            ; +0x178, 0x180138494\npop     rsi                                                            ; +0x179, 0x180138495\nretn                                                                   ; +0x17a, 0x180138496", "xrefs": ["__crt_stdio_output::write_multiple_characters<__crt_stdio_output::stream_output_adapter<wchar_t>,char> @ 0x18012c184", "__crt_stdio_output::output_processor<wchar_t,__crt_stdio_output::stream_output_adapter<wchar_t>,__crt_stdio_output::standard_base<wchar_t,__crt_stdio_output::stream_output_adapter<wchar_t>>>::process @ 0x18012caf7", "unknown_libname_57 @ 0x18012eec7", "__crt_stdio_output::output_adapter_common<wchar_t,__crt_stdio_output::stream_output_adapter<wchar_t>>::write_string_impl @ 0x18012f1e6", "__crt_stdio_output::output_adapter_common<wchar_t,__crt_stdio_output::stream_output_adapter<wchar_t>>::write_string_impl @ 0x18012f22a", "<???> @ 0x180203638", "<???> @ 0x180203644"], "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"}