{"type": "func", "start": 6443669320, "end": 6443669585, "name": "is_usable_drive_or_unc_root", "pseudocode": "// \n// is_usable_drive_or_unc_root from 0x180129748 to 0x180129851 (265 bytes)\n// \n// 2 xrefs:\n// > common_stat<_stat64i32> @ 0x180129190\n// > <???> @ 0x180202ab0\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\nbool __fastcall is_usable_drive_or_unc_root(const wchar_t *Path)\n{\n  wchar_t *v2; // rax\n  wchar_t *v3; // rbx\n  int v4; // ebp\n  wchar_t *v5; // rdi\n  __int64 v6; // rax\n  char v7; // di\n  wchar_t Buffer[264]; // [rsp+20h] [rbp-238h] BYREF\n\n  v2 = wcspbrk(Path, L\"./\\\\\");\n  if ( v2 )\n  {\n    v3 = nullptr;\n    v4 = *errno();\n    *errno() = 0;\n    v5 = wfullpath(Buffer, Path, 0x104u);\n    if ( v5 )\n    {\n      *errno() = v4;\n    }\n    else\n    {\n      if ( *errno() != 34 )\n      {\nLABEL_12:\n        v7 = 0;\nLABEL_13:\n        free(v3);\n        LOBYTE(v2) = v7;\n        return (char)v2;\n      }\n      *errno() = v4;\n      v3 = wfullpath(nullptr, Path, 0);\n      v5 = v3;\n    }\n    if ( v5 )\n    {\n      v6 = -1;\n      do\n        ++v6;\n      while ( v5[v6] );\n      if ( v6 == 3 || is_root_unc_name(v5) )\n      {\n        v7 = 1;\n        if ( GetDriveTypeW(Path) > 1 )\n          goto LABEL_13;\n      }\n    }\n    goto LABEL_12;\n  }\n  return (char)v2;\n}", "assembly": "; \n; is_usable_drive_or_unc_root from 0x180129748 to 0x180129851 (265 bytes)\n; \n; 2 xrefs:\n; > common_stat<_stat64i32> @ 0x180129190\n; > <???> @ 0x180202ab0\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, 0x180129748\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x18012974d\npush    rsi                                                            ; +0xa, 0x180129752\npush    rdi                                                            ; +0xb, 0x180129753\npush    r14                                                            ; +0xc, 0x180129754\nsub     rsp, 240h                                                      ; +0xe, 0x180129756\nmov     rax, cs:__security_cookie                                      ; +0x15, 0x18012975d\nxor     rax, rsp                                                       ; +0x1c, 0x180129764\nmov     [rsp+258h+var_28], rax                                         ; +0x1f, 0x180129767\nlea     rdx, Control                                                   ; +0x27, 0x18012976f\nmov     rsi, rcx                                                       ; +0x2e, 0x180129776\ncall    wcspbrk                                                        ; +0x31, 0x180129779\nxor     r14d, r14d                                                     ; +0x36, 0x18012977e\ntest    rax, rax                                                       ; +0x39, 0x180129781\njz      loc_180129829                                                  ; +0x3c, 0x180129784\nmov     rbx, r14                                                       ; +0x42, 0x18012978a\ncall    _errno                                                         ; +0x45, 0x18012978d\nmov     ebp, [rax]                                                     ; +0x4a, 0x180129792\ncall    _errno                                                         ; +0x4c, 0x180129794\nmov     r8d, 104h; BufferCount                                         ; +0x51, 0x180129799\nlea     rcx, [rsp+258h+Buffer]; Buffer                                 ; +0x57, 0x18012979f\nmov     rdx, rsi; Path                                                 ; +0x5c, 0x1801297a4\nmov     [rax], r14d                                                    ; +0x5f, 0x1801297a7\ncall    _wfullpath                                                     ; +0x62, 0x1801297aa\nmov     rdi, rax                                                       ; +0x67, 0x1801297af\ntest    rax, rax                                                       ; +0x6a, 0x1801297b2\njz      short loc_1801297C0                                            ; +0x6d, 0x1801297b5\ncall    _errno                                                         ; +0x6f, 0x1801297b7\nmov     [rax], ebp                                                     ; +0x74, 0x1801297bc\njmp     short loc_1801297E4                                            ; +0x76, 0x1801297be\ncall    _errno                                                         ; +0x78, 0x1801297c0\ncmp     dword ptr [rax], 22h ; '\"'                                     ; +0x7d, 0x1801297c5\njnz     short loc_18012981B                                            ; +0x80, 0x1801297c8\ncall    _errno                                                         ; +0x82, 0x1801297ca\nxor     r8d, r8d; BufferCount                                          ; +0x87, 0x1801297cf\nmov     rdx, rsi; Path                                                 ; +0x8a, 0x1801297d2\nxor     ecx, ecx; Buffer                                               ; +0x8d, 0x1801297d5\nmov     [rax], ebp                                                     ; +0x8f, 0x1801297d7\ncall    _wfullpath                                                     ; +0x91, 0x1801297d9\nmov     rbx, rax                                                       ; +0x96, 0x1801297de\nmov     rdi, rax                                                       ; +0x99, 0x1801297e1\ntest    rdi, rdi                                                       ; +0x9c, 0x1801297e4\njz      short loc_18012981B                                            ; +0x9f, 0x1801297e7\nor      rax, 0FFFFFFFFFFFFFFFFh                                        ; +0xa1, 0x1801297e9\ninc     rax                                                            ; +0xa5, 0x1801297ed\ncmp     [rdi+rax*2], r14w                                              ; +0xa8, 0x1801297f0\njnz     short loc_1801297ED                                            ; +0xad, 0x1801297f5\ncmp     rax, 3                                                         ; +0xaf, 0x1801297f7\njz      short loc_180129809                                            ; +0xb3, 0x1801297fb\nmov     rcx, rdi; wchar_t *                                            ; +0xb5, 0x1801297fd\ncall    ?is_root_unc_name@@YA_NQEB_W@Z                                 ; +0xb8, 0x180129800\ntest    al, al                                                         ; +0xbd, 0x180129805\njz      short loc_18012981B                                            ; +0xbf, 0x180129807\nmov     rcx, rsi; lpRootPathName                                       ; +0xc1, 0x180129809\ncall    cs:GetDriveTypeW                                               ; +0xc4, 0x18012980c\nmov     edi, 1                                                         ; +0xca, 0x180129812\ncmp     eax, edi                                                       ; +0xcf, 0x180129817\nja      short loc_18012981E                                            ; +0xd1, 0x180129819\nmov     dil, r14b                                                      ; +0xd3, 0x18012981b\nmov     rcx, rbx; Block                                                ; +0xd6, 0x18012981e\ncall    free                                                           ; +0xd9, 0x180129821\nmov     al, dil                                                        ; +0xde, 0x180129826\nmov     rcx, [rsp+258h+var_28]                                         ; +0xe1, 0x180129829\nxor     rcx, rsp; StackCookie                                          ; +0xe9, 0x180129831\ncall    __security_check_cookie                                        ; +0xec, 0x180129834\nlea     r11, [rsp+258h+var_18]                                         ; +0xf1, 0x180129839\nmov     rbx, [r11+28h]                                                 ; +0xf9, 0x180129841\nmov     rbp, [r11+30h]                                                 ; +0xfd, 0x180129845\nmov     rsp, r11                                                       ; +0x101, 0x180129849\npop     r14                                                            ; +0x104, 0x18012984c\npop     rdi                                                            ; +0x106, 0x18012984e\npop     rsi                                                            ; +0x107, 0x18012984f\nretn                                                                   ; +0x108, 0x180129850", "xrefs": ["common_stat<_stat64i32> @ 0x180129190", "<???> @ 0x180202ab0"], "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"}