{"type": "func", "start": 6443715084, "end": 6443715357, "name": "__acrt_wcs_to_mbs_cp<__crt_win32_buffer_no_resizing>", "pseudocode": "// \n// __acrt_wcs_to_mbs_cp<__crt_win32_buffer_no_resizing> from 0x180134a0c to 0x180134b1d (273 bytes)\n// \n// 2 xrefs:\n// > __acrt_GetModuleFileNameA @ 0x180139309\n// > <???> @ 0x1802032b4\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__int64 __fastcall __acrt_wcs_to_mbs_cp<__crt_win32_buffer_no_resizing>(_WORD *a1, __int64 a2, int a3)\n{\n  unsigned int v3; // ebx\n  int v6; // esi\n  int v7; // eax\n  DWORD LastError; // eax\n  unsigned __int64 v9; // rcx\n  int v10; // eax\n\n  v3 = 0;\n  v6 = (int)a1;\n  if ( !a1 )\n  {\n    if ( *(_BYTE *)(a2 + 40) )\n      *(_BYTE *)(a2 + 40) = 0;\n    *(_QWORD *)(a2 + 16) = 0;\n    *(_QWORD *)(a2 + 24) = 0;\n    goto LABEL_5;\n  }\n  if ( *a1 )\n  {\n    v7 = _acrt_WideCharToMultiByte(a3, 0, (_DWORD)a1, -1, 0, 0, 0, 0);\n    if ( v7 )\n    {\n      v9 = *(_QWORD *)(a2 + 24);\n      if ( v7 > v9 )\n      {\n        if ( *(_BYTE *)(a2 + 40) )\n          *(_BYTE *)(a2 + 40) = 0;\n        goto LABEL_10;\n      }\n      v10 = _acrt_WideCharToMultiByte(a3, 0, v6, -1, *(_QWORD *)(a2 + 16), v9, 0, 0);\n      if ( v10 )\n      {\n        *(_QWORD *)(a2 + 32) = v10 - 1LL;\n        return v3;\n      }\n    }\n    LastError = GetLastError();\n    _acrt_errno_map_os_error(LastError);\n    return (unsigned int)*errno();\n  }\n  if ( !*(_QWORD *)(a2 + 24) )\n  {\n    if ( *(_BYTE *)(a2 + 40) )\n      *(_BYTE *)(a2 + 40) = 0;\nLABEL_10:\n    *errno() = 34;\n    *(_BYTE *)(a2 + 40) = 0;\n    *(_QWORD *)(a2 + 24) = 0;\n    return 34;\n  }\n  **(_BYTE **)(a2 + 16) = 0;\nLABEL_5:\n  *(_QWORD *)(a2 + 32) = 0;\n  return v3;\n}", "assembly": "; \n; __acrt_wcs_to_mbs_cp<__crt_win32_buffer_no_resizing> from 0x180134a0c to 0x180134b1d (273 bytes)\n; \n; 2 xrefs:\n; > __acrt_GetModuleFileNameA @ 0x180139309\n; > <???> @ 0x1802032b4\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, 0x180134a0c\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x180134a11\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x180134a16\npush    rdi                                                            ; +0xf, 0x180134a1b\nsub     rsp, 40h                                                       ; +0x10, 0x180134a1c\nxor     ebx, ebx                                                       ; +0x14, 0x180134a20\nmov     ebp, r8d                                                       ; +0x16, 0x180134a22\nmov     rdi, rdx                                                       ; +0x19, 0x180134a25\nmov     rsi, rcx                                                       ; +0x1c, 0x180134a28\ntest    rcx, rcx                                                       ; +0x1f, 0x180134a2b\njnz     short loc_180134A49                                            ; +0x22, 0x180134a2e\ncmp     [rdx+28h], bl                                                  ; +0x24, 0x180134a30\njz      short loc_180134A38                                            ; +0x27, 0x180134a33\nmov     [rdx+28h], bl                                                  ; +0x29, 0x180134a35\nmov     [rdx+10h], rbx                                                 ; +0x2c, 0x180134a38\nmov     [rdx+18h], rbx                                                 ; +0x30, 0x180134a3c\nmov     [rdx+20h], rbx                                                 ; +0x34, 0x180134a40\njmp     loc_180134B06                                                  ; +0x38, 0x180134a44\ncmp     [rcx], bx                                                      ; +0x3d, 0x180134a49\njnz     short loc_180134A7E                                            ; +0x40, 0x180134a4c\ncmp     [rdx+18h], rbx                                                 ; +0x42, 0x180134a4e\njnz     short loc_180134A76                                            ; +0x46, 0x180134a52\ncmp     [rdx+28h], bl                                                  ; +0x48, 0x180134a54\njz      short loc_180134A5C                                            ; +0x4b, 0x180134a57\nmov     [rdx+28h], bl                                                  ; +0x4d, 0x180134a59\ncall    _errno                                                         ; +0x50, 0x180134a5c\nmov     ecx, 22h ; '\"'                                                 ; +0x55, 0x180134a61\nmov     [rax], ecx                                                     ; +0x5a, 0x180134a66\nmov     [rdi+28h], bl                                                  ; +0x5c, 0x180134a68\nmov     [rdi+18h], rbx                                                 ; +0x5f, 0x180134a6b\nmov     ebx, ecx                                                       ; +0x63, 0x180134a6f\njmp     loc_180134B06                                                  ; +0x65, 0x180134a71\nmov     rax, [rdx+10h]                                                 ; +0x6a, 0x180134a76\nmov     [rax], bl                                                      ; +0x6e, 0x180134a7a\njmp     short loc_180134A40                                            ; +0x70, 0x180134a7c\nmov     [rsp+48h+var_10], rbx                                          ; +0x72, 0x180134a7e\nor      r9d, 0FFFFFFFFh                                                ; +0x77, 0x180134a83\nmov     [rsp+48h+var_18], rbx                                          ; +0x7b, 0x180134a87\nmov     r8, rsi                                                        ; +0x80, 0x180134a8c\nmov     [rsp+48h+var_20], ebx                                          ; +0x83, 0x180134a8f\nxor     edx, edx                                                       ; +0x87, 0x180134a93\nmov     ecx, ebp                                                       ; +0x89, 0x180134a95\nmov     [rsp+48h+var_28], rbx                                          ; +0x8b, 0x180134a97\ncall    __acrt_WideCharToMultiByte                                     ; +0x90, 0x180134a9c\nmovsxd  rdx, eax                                                       ; +0x95, 0x180134aa1\ntest    eax, eax                                                       ; +0x98, 0x180134aa4\njnz     short loc_180134ABE                                            ; +0x9a, 0x180134aa6\ncall    cs:GetLastError                                                ; +0x9c, 0x180134aa8\nmov     ecx, eax                                                       ; +0xa2, 0x180134aae\ncall    __acrt_errno_map_os_error                                      ; +0xa4, 0x180134ab0\ncall    _errno                                                         ; +0xa9, 0x180134ab5\nmov     ebx, [rax]                                                     ; +0xae, 0x180134aba\njmp     short loc_180134B06                                            ; +0xb0, 0x180134abc\nmov     rcx, [rdi+18h]                                                 ; +0xb2, 0x180134abe\ncmp     rdx, rcx                                                       ; +0xb6, 0x180134ac2\njbe     short loc_180134AD1                                            ; +0xb9, 0x180134ac5\ncmp     [rdi+28h], bl                                                  ; +0xbb, 0x180134ac7\njz      short loc_180134A5C                                            ; +0xbe, 0x180134aca\nmov     [rdi+28h], bl                                                  ; +0xc0, 0x180134acc\njmp     short loc_180134A5C                                            ; +0xc3, 0x180134acf\nmov     rax, [rdi+10h]                                                 ; +0xc5, 0x180134ad1\nor      r9d, 0FFFFFFFFh                                                ; +0xc9, 0x180134ad5\nmov     [rsp+48h+var_10], rbx                                          ; +0xcd, 0x180134ad9\nmov     r8, rsi                                                        ; +0xd2, 0x180134ade\nmov     [rsp+48h+var_18], rbx                                          ; +0xd5, 0x180134ae1\nxor     edx, edx                                                       ; +0xda, 0x180134ae6\nmov     [rsp+48h+var_20], ecx                                          ; +0xdc, 0x180134ae8\nmov     ecx, ebp                                                       ; +0xe0, 0x180134aec\nmov     [rsp+48h+var_28], rax                                          ; +0xe2, 0x180134aee\ncall    __acrt_WideCharToMultiByte                                     ; +0xe7, 0x180134af3\nmovsxd  rcx, eax                                                       ; +0xec, 0x180134af8\ntest    eax, eax                                                       ; +0xef, 0x180134afb\njz      short loc_180134AA8                                            ; +0xf1, 0x180134afd\ndec     rcx                                                            ; +0xf3, 0x180134aff\nmov     [rdi+20h], rcx                                                 ; +0xf6, 0x180134b02\nmov     rbp, [rsp+48h+arg_8]                                           ; +0xfa, 0x180134b06\nmov     eax, ebx                                                       ; +0xff, 0x180134b0b\nmov     rbx, [rsp+48h+arg_0]                                           ; +0x101, 0x180134b0d\nmov     rsi, [rsp+48h+arg_10]                                          ; +0x106, 0x180134b12\nadd     rsp, 40h                                                       ; +0x10b, 0x180134b17\npop     rdi                                                            ; +0x10f, 0x180134b1b\nretn                                                                   ; +0x110, 0x180134b1c", "xrefs": ["__acrt_GetModuleFileNameA @ 0x180139309", "<???> @ 0x1802032b4"], "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"}