{"type": "func", "start": 6443667656, "end": 6443667986, "name": "common_stat<_stat64i32>", "pseudocode": "// \n// common_stat<_stat64i32> from 0x1801290c8 to 0x180129212 (330 bytes)\n// \n// 3 xrefs:\n// > _stat64i32 @ 0x180129871\n// > _stat64i32 @ 0x180129928\n// > <???> @ 0x180202a68\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 common_stat<_stat64i32>(wchar_t *a1, __int64 a2)\n{\n  unsigned int v2; // esi\n  HANDLE FileW; // rbx\n  int v7; // eax\n  __int64 v8; // rax\n  int v9; // [rsp+68h] [rbp+10h] BYREF\n\n  v2 = 0;\n  if ( !a2 || (*(_OWORD *)a2 = 0, *(_OWORD *)(a2 + 16) = 0, *(_OWORD *)(a2 + 32) = 0, !a1) )\n  {\n    *_doserrno() = 0;\n    *errno() = 22;\n    invalid_parameter_noinfo();\n    return 0xFFFFFFFFLL;\n  }\n  FileW = CreateFileW(a1, 0x80u, 7u, nullptr, 3u, 0x2000000u, nullptr);\n  if ( FileW == (HANDLE)-1LL )\n  {\n    if ( is_usable_drive_or_unc_root(a1) )\n    {\n      *(_WORD *)(a2 + 6) = convert_to_stat_mode(16, a1);\n      *(_WORD *)(a2 + 8) = 1;\n      v9 = 0;\n      if ( get_drive_number_from_path(a1, &v9) )\n      {\n        v7 = v9 - 1;\n        *(_DWORD *)(a2 + 16) = v9 - 1;\n        *(_DWORD *)a2 = v7;\n        v8 = common_loctotime_t<__int64>(1980, 1, 1, 0, 0, 0, -1);\n        *(_QWORD *)(a2 + 32) = v8;\n        *(_QWORD *)(a2 + 24) = v8;\n        *(_QWORD *)(a2 + 40) = v8;\n        goto LABEL_7;\n      }\n    }\n    else\n    {\n      _acrt_errno_map_os_error(2);\n    }\n    goto LABEL_6;\n  }\n  if ( !(unsigned __int8)common_stat_handle_file_opened<_stat64i32>(a1) )\n  {\nLABEL_6:\n    v2 = -1;\n    *(_OWORD *)a2 = 0;\n    *(_OWORD *)(a2 + 16) = 0;\n    *(_OWORD *)(a2 + 32) = 0;\n  }\nLABEL_7:\n  if ( FileW != (HANDLE)-1LL )\n    CloseHandle(FileW);\n  return v2;\n}", "assembly": "; \n; common_stat<_stat64i32> from 0x1801290c8 to 0x180129212 (330 bytes)\n; \n; 3 xrefs:\n; > _stat64i32 @ 0x180129871\n; > _stat64i32 @ 0x180129928\n; > <???> @ 0x180202a68\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, 0x1801290c8\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x1801290cd\npush    rsi                                                            ; +0xa, 0x1801290d2\npush    rdi                                                            ; +0xb, 0x1801290d3\npush    r14                                                            ; +0xc, 0x1801290d4\nsub     rsp, 40h                                                       ; +0xe, 0x1801290d6\nxor     esi, esi                                                       ; +0x12, 0x1801290da\nmov     rdi, rdx                                                       ; +0x14, 0x1801290dc\nmov     rbp, rcx                                                       ; +0x17, 0x1801290df\ntest    rdx, rdx                                                       ; +0x1a, 0x1801290e2\njnz     short loc_180129103                                            ; +0x1d, 0x1801290e5\ncall    __doserrno                                                     ; +0x1f, 0x1801290e7\nmov     [rax], esi                                                     ; +0x24, 0x1801290ec\ncall    _errno                                                         ; +0x26, 0x1801290ee\nmov     dword ptr [rax], 16h                                           ; +0x2b, 0x1801290f3\ncall    _invalid_parameter_noinfo                                      ; +0x31, 0x1801290f9\nor      eax, 0FFFFFFFFh                                                ; +0x36, 0x1801290fe\njmp     short loc_18012917D                                            ; +0x39, 0x180129101\nxorps   xmm0, xmm0                                                     ; +0x3b, 0x180129103\nmovups  xmmword ptr [rdx], xmm0                                        ; +0x3e, 0x180129106\nmovups  xmmword ptr [rdx+10h], xmm0                                    ; +0x41, 0x180129109\nmovups  xmmword ptr [rdx+20h], xmm0                                    ; +0x45, 0x18012910d\ntest    rbp, rbp                                                       ; +0x49, 0x180129111\njz      short loc_1801290E7                                            ; +0x4c, 0x180129114\nxor     r9d, r9d; lpSecurityAttributes                                 ; +0x4e, 0x180129116\nmov     [rsp+58h+hTemplateFile], rsi; hTemplateFile                    ; +0x51, 0x180129119\nmov     [rsp+58h+dwFlagsAndAttributes], 2000000h; dwFlagsAndAttributes ; +0x56, 0x18012911e\nmov     edx, 80h; dwDesiredAccess                                      ; +0x5e, 0x180129126\nmov     [rsp+58h+dwCreationDisposition], 3; dwCreationDisposition      ; +0x63, 0x18012912b\nlea     r8d, [r9+7]; dwShareMode                                       ; +0x6b, 0x180129133\ncall    cs:CreateFileW                                                 ; +0x6f, 0x180129137\nmov     rbx, rax                                                       ; +0x75, 0x18012913d\nmov     rcx, rbp; Path                                                 ; +0x78, 0x180129140\ncmp     rax, 0FFFFFFFFFFFFFFFFh                                        ; +0x7b, 0x180129143\njz      short loc_180129190                                            ; +0x7f, 0x180129147\nmov     r9, rdi                                                        ; +0x81, 0x180129149\nmov     r8, rax                                                        ; +0x84, 0x18012914c\nor      edx, 0FFFFFFFFh                                                ; +0x87, 0x18012914f\ncall    ??$common_stat_handle_file_opened@U_stat64i32@@@@YA_NQEB_WHQEAXAEAU_stat64i32@@@Z ; +0x8a, 0x180129152\ntest    al, al                                                         ; +0x8f, 0x180129157\njnz     short loc_18012916C                                            ; +0x91, 0x180129159\nxorps   xmm0, xmm0                                                     ; +0x93, 0x18012915b\nor      esi, 0FFFFFFFFh                                                ; +0x96, 0x18012915e\nmovups  xmmword ptr [rdi], xmm0                                        ; +0x99, 0x180129161\nmovups  xmmword ptr [rdi+10h], xmm0                                    ; +0x9c, 0x180129164\nmovups  xmmword ptr [rdi+20h], xmm0                                    ; +0xa0, 0x180129168\ncmp     rbx, 0FFFFFFFFFFFFFFFFh                                        ; +0xa4, 0x18012916c\njz      short loc_18012917B                                            ; +0xa8, 0x180129170\nmov     rcx, rbx; hObject                                              ; +0xaa, 0x180129172\ncall    cs:CloseHandle                                                 ; +0xad, 0x180129175\nmov     eax, esi                                                       ; +0xb3, 0x18012917b\nmov     rbx, [rsp+58h+arg_0]                                           ; +0xb5, 0x18012917d\nmov     rbp, [rsp+58h+arg_10]                                          ; +0xba, 0x180129182\nadd     rsp, 40h                                                       ; +0xbf, 0x180129187\npop     r14                                                            ; +0xc3, 0x18012918b\npop     rdi                                                            ; +0xc5, 0x18012918d\npop     rsi                                                            ; +0xc6, 0x18012918e\nretn                                                                   ; +0xc7, 0x18012918f\ncall    ?is_usable_drive_or_unc_root@@YA_NQEB_W@Z                      ; +0xc8, 0x180129190\ntest    al, al                                                         ; +0xcd, 0x180129195\njnz     short loc_1801291A5                                            ; +0xcf, 0x180129197\nmov     ecx, 2                                                         ; +0xd1, 0x180129199\ncall    __acrt_errno_map_os_error                                      ; +0xd6, 0x18012919e\njmp     short loc_18012915B                                            ; +0xdb, 0x1801291a3\nmov     rdx, rbp; wchar_t *                                            ; +0xdd, 0x1801291a5\nmov     ecx, 10h; int                                                  ; +0xe0, 0x1801291a8\ncall    ?convert_to_stat_mode@@YAGHQEB_W@Z                             ; +0xe5, 0x1801291ad\nmov     r14d, 1                                                        ; +0xea, 0x1801291b2\nmov     [rdi+6], ax                                                    ; +0xf0, 0x1801291b8\nlea     rdx, [rsp+58h+arg_8]; int *                                    ; +0xf4, 0x1801291bc\nmov     [rdi+8], r14w                                                  ; +0xf9, 0x1801291c1\nmov     rcx, rbp; wchar_t *                                            ; +0xfe, 0x1801291c6\nmov     [rsp+58h+arg_8], esi                                           ; +0x101, 0x1801291c9\ncall    ?get_drive_number_from_path@@YA_NQEB_WAEAH@Z                   ; +0x105, 0x1801291cd\ntest    al, al                                                         ; +0x10a, 0x1801291d2\njz      short loc_18012915B                                            ; +0x10c, 0x1801291d4\nor      dword ptr [rsp+58h+hTemplateFile], 0FFFFFFFFh                  ; +0x10e, 0x1801291d6\nxor     r9d, r9d                                                       ; +0x113, 0x1801291db\nmov     eax, [rsp+58h+arg_8]                                           ; +0x116, 0x1801291de\nmov     r8d, r14d                                                      ; +0x11a, 0x1801291e2\ndec     eax                                                            ; +0x11d, 0x1801291e5\nmov     [rsp+58h+dwFlagsAndAttributes], esi                            ; +0x11f, 0x1801291e7\nmov     edx, r14d                                                      ; +0x123, 0x1801291eb\nmov     [rdi+10h], eax                                                 ; +0x126, 0x1801291ee\nmov     ecx, 7BCh                                                      ; +0x129, 0x1801291f1\nmov     [rdi], eax                                                     ; +0x12e, 0x1801291f6\nmov     [rsp+58h+dwCreationDisposition], esi                           ; +0x130, 0x1801291f8\ncall    j_??$common_loctotime_t@_J@@YA_JHHHHHHH@Z                      ; +0x134, 0x1801291fc\nmov     [rdi+20h], rax                                                 ; +0x139, 0x180129201\nmov     [rdi+18h], rax                                                 ; +0x13d, 0x180129205\nmov     [rdi+28h], rax                                                 ; +0x141, 0x180129209\njmp     loc_18012916C                                                  ; +0x145, 0x18012920d", "xrefs": ["_stat64i32 @ 0x180129871", "_stat64i32 @ 0x180129928", "<???> @ 0x180202a68"], "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"}