-
Notifications
You must be signed in to change notification settings - Fork 0
/
content.json
1 lines (1 loc) · 20.2 KB
/
content.json
1
{"meta":{"title":"xWTF Blog","subtitle":null,"description":null,"author":"xWTF","url":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf","root":"/"},"pages":[{"title":"","date":"2022-09-11T11:30:46.558Z","updated":"2021-08-17T11:02:00.542Z","comments":true,"path":"/404.html","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/404.html","excerpt":"","text":"404 很抱歉,您访问的页面不存在 可能是输入地址有误或该地址已被删除"},{"title":"关于","date":"2021-08-16T16:00:00.000Z","updated":"2021-08-17T12:32:06.431Z","comments":true,"path":"about/index.html","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/about/index.html","excerpt":"","text":"// TODO"},{"title":"所有分类","date":"2022-09-11T11:30:46.564Z","updated":"2021-08-17T12:29:56.663Z","comments":true,"path":"categories/index.html","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/categories/index.html","excerpt":"","text":""},{"title":"所有标签","date":"2022-09-11T11:30:46.565Z","updated":"2021-08-17T12:30:01.604Z","comments":true,"path":"tags/index.html","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/index.html","excerpt":"","text":""}],"posts":[{"title":"将 BW-16D1H-U 改装为 BW-16D1HT 并启用 LibreDrive","slug":"asus-bw16d1h-u-modding","date":"2023-05-13T04:00:00.000Z","updated":"2023-05-13T08:38:48.758Z","comments":true,"path":"2023/asus-bw16d1h-u-modding/","link":"","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/2023/asus-bw16d1h-u-modding/","excerpt":"","text":"华硕的 BW-16D1H-U USB 蓝光光驱是 ITX/mATX 用户播放、刻录蓝光光盘的优秀桌面解决方案之一,数年使用下来体验都不错。 不过,BW-16D1H-U 并不能读取 UHD 碟片,甚至无法读取 BDXL 格式的蓝光。为了解决这些读取需求,同时继续使用 BW-16D1H-U 这个不错的外壳,我决定使用 BW-16D1HT 对其进行升级。 这里记述的操作均为我的个人经验,不保证操作可以成功,我也不对这些操作可能造成的任何损失负责,你需要自行承担相关风险。 替换光驱硬件BW-16D1H-U 的拆解十分简单,首先卸掉图中脚垫下方的 2 个螺丝: 然后向上稍微抬起上层外壳,并向两侧用力,最后向上提起就能拆下外壳了。图中标出了三个卡扣的位置,供参考: 拆除屏蔽罩后可以看出,这是一个 USB 转 SATA 的胶水方案。需要注意的是红框处的排线由双面胶固定,拆解时要特别小心,避免损伤排线: 可以看到,内置的光驱实际上是 Pioneer BDR-209MBK: 拆除固定光驱的三颗螺丝(右侧两颗,左侧一颗)后,就可以将光驱取出了,小心的取下 SATA 连接线: 最后,将 BW-16D1HT 装进去,组装好外壳就大功告成了。 启用 LibreDrive自 2017 下旬起出厂的 BW-16D1HT 基本都是 3.03 或以上版本的固件,封堵了 LibreDrive 利用的漏洞。 为了重新启用 LibreDrive,我们需要刷入自定义固件或对固件进行降级。我更推荐刷入来自 MakeMKV 的自定义固件,这里使用的版本是 ASUS-BW-16D1HT-3.10-WM01601-211901041014.bin。 对 ASUS 光驱的烧录操作非常简单,使用来自 MakeMKV 论坛的 ASUS ODD FW Changer (Modified) 即可。 如果你无法访问上述链接,或者无法获取相关固件,也可以下载我当前使用的版本。该版本已经过 VirusTotal 扫描 和 dnSpy 审计: 点击下载 (2023-05-13) 固件更新过程非常简单,使用 管理员身份 运行 FW Changer 后选中固件文件,然后点击 START 即可: 光驱会在开始固件更新时弹出,并在更新结束后收回。中断固件更新过程通常会造成软件损伤,在固件更新过程中请不要移动光驱或断开连接线,最好使用 UPS 对光驱进行供电。 最后,我们就得到一个长得像 BW-16D1H-U,但是可以抓取 UHD 碟片和 BDXL 的设备了: 降低读取速度由于 BW-16D1HT 倍速读取时会产生大量热量,且 BW-16D1H-U 的塑料外壳散热效率不佳,在进行改装后可能会由于过热而出现 STATUS_DEVICE_DATA_ERROR 的错误。 当然,这个错误也会在碟片表面有划痕、不干净或是硬件故障时出现。如果你确定这就是由于碟片过热造成的,可以通过修改注册表让 MakeMKV 降低读取速度,具体请参考 MakeMKV drive speed control。 需要注意的是,固件更新后对应的设备标识符也会发生变化。你可以在 MakeMKV 中打开设置窗口并点击保存,使其自动生成新标识符对应的注册表项。","categories":[],"tags":[{"name":"Blu-ray","slug":"Blu-ray","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/Blu-ray/"},{"name":"UHD","slug":"UHD","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/UHD/"},{"name":"LibreDrive","slug":"LibreDrive","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/LibreDrive/"}]},{"title":"给 Windows Server 移植 Xbox 手柄驱动","slug":"xbox-gamepad-driver-for-windows-server","date":"2021-12-15T04:00:00.000Z","updated":"2021-12-15T05:58:43.491Z","comments":true,"path":"2021/xbox-gamepad-driver-for-windows-server/","link":"","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/2021/xbox-gamepad-driver-for-windows-server/","excerpt":"","text":"前段时间迁移到了 Windows Server 2022,使用体验还算不错。不过,最近又发现一个新问题:Xbox 手柄没有驱动。 究其原因,还是 Windows Server 缺少 Xbox 相关的一整套软件,包括 Xbox APP、在线游戏服务、驱动服务等。只要想办法将桌面 Windows 的驱动程序移植过来,就可以正常使用了。 在 Google 上找了一圈,未能找到可借鉴的资料。这里记述的操作完全基于我对 Windows 系统的理解,你需要自行承担这些操作可能带来的风险。 有线连接以 Xbox One 手柄为例,使用 有线连接 会直接报没有驱动的错误: 如果你能忍受有线连接,其实不必大费周折。只要 在 Microsoft Update Catalog 中 搜索 “xbox” 就能找到 能用的驱动包。 如果下载有困难,我也在此提供一个副本,你可以点击 这里 下载。该副本已经过 Microsoft 数字签名,请先验证签名再使用。 直接解压 cab 文件,然后使用设备管理器安装驱动即可。虽然是 Xbox Peripherals (legacy) 驱动,但它工作的很好。 无线连接?我不喜欢有线连接。目前,Xbox 手柄的无线连接方式有两种:蓝牙或专用的 Xbox Wireless 接收器。 在本文中我只解决了蓝牙驱动问题,至于 Xbox Wireless 接收器,我只能说 “不太可能”,因为其中涉及太多的驱动和软件包了,几乎得将整套 Xbox 软件栈移植过来。如果你能移植成功,欢迎联系我共同交流。 如果你不知道怎么通过蓝牙连接 Xbox 手柄,不妨 问问 YouTube 如果采用 蓝牙连接,则配对成功后会出现一个名为 Xbox Bluetooth Gamepad 的 其他设备,虽然 “运转正常”,手柄却并不能正常工作。此时手柄的指示灯会继续闪烁。 在桌面版中,负责蓝牙 Xbox 手柄驱动是 xinputhid.inf。而这个组件并不存在于 Server 中。让我们先看看桌面版系统中的驱动: 很不幸,这里只有 xinputhid.inf 和 xinputhid.sys 两个文件,不仅没有 CAT,连 SYS 文件也没有独立签名。如果你熟悉 Windows 系统,就会马上意识到这种驱动是绝对无法在开着 SecureBoot 的环境下加载的。 我也尝试过采用自己的证书和一些古旧的证书(2015年前)对驱动进行签名然后安装,但是这并不是一个优雅的方案。这里,我将提供一个手工移植驱动的 (相对优雅的) 方案。 提取 XInputHID 驱动这部分只是记录我的操作思路,如果你不想读,可以直接跳到后面的 “安装” 一节 首先,我们将桌面版的 %WINDIR%\\System32\\DriverStore\\FileRepository\\xinputhid.inf_amd64_b01c6ccf7f1e23b6 文件夹整个复制出来,这是驱动本体。 然后,我们要解决的最大的问题就是代码签名。这个驱动并没有单独的 Catalog 文件,而是和其他驱动共同打包在一个较大的 Catalog 中。 众所周知,Windows 的 Catalog 数据存在于两个地方:%WINDIR%\\System32\\CatRoot 和 %WINDIR%\\System32\\catroot2,前者存放原始 CAT 文件,后者存放的是包含所有 CAT 文件信息的 ESE 数据库。 要从 CatRoot 的上千个 CAT 文件中手动翻找 Hash 明显是不合理的,因此我们偷个懒采用 Velociraptor 的 authenticode() 函数直接查找 SYS 文件的签名: 现在我们知道 Microsoft-Windows-Client-Desktop-Required-Package~31bf3856ad364e35~amd64~~10.0.19041.1288.cat 是需要的文件之一了。但是事情还没有结束,INF 文件和 SYS 文件的签名并没有被打包在同一个 CAT 中,我们还需要找到 INF 文件对应的 CAT。 由于 authenticode() 函数对 INF 文件是不工作的,这里我们再计算 INF 文件的 SHA-1 和 SHA-256 哈希值,打开 catroot2 下的 catdb 数据库,在 HashCatNameTableSHA1 和 HashCatNameTableSHA256 表中查找: 然后将 HashCatNameTable_CatNameCol 的值转换为字符串,得到 Microsoft-Windows-Client-Desktop-Required-Package~31bf3856ad364e35~amd64~~10.0.19041.1052.cat|Microsoft-Windows-Client-Desktop-Required-Package~31bf3856ad364e35~amd64~~10.0.19041.1288.cat|,这样我们就拿到两个需要的 CAT 文件了。 接下来,由于我们要直接移植驱动,不走 PNP,还得导出这些注册表项: 驱动配置:HKLM\\SYSTEM\\DriverDatabase\\DriverPackages\\xinputhid.inf_amd64_b01c6ccf7f1e23b6 INF 注册:HKLM\\SYSTEM\\DriverDatabase\\DriverInfFiles\\xinputhid.inf 并且还要查看 INF 中注册的 VID、PID,从 HKLM\\SYSTEM\\DriverDatabase\\DeviceIds\\ 导出对应的注册信息,以便操作系统能识别这些设备。 最后,顺便将 %WINDIR%\\INF\\xinputhid.PNF 也复制出来 (BTW,它不需要数字签名),这样我们就准备好需要的所有文件了: 安装 XInputHID 驱动如果你不想自己提取,可以用我从 Windows 10 21H1 (19043.1052) 中提取的驱动文件。 点击下载 (2021-12-15) 我不能保证这个文件一定能工作,也不能保证它不会损坏你的计算机,你将需要自行承担可能存在的风险。如果你同意承担此风险,我会告诉你解压密码是小写的 xwtf。 首先,我们需要安装 Catalog 文件。使用 SignTool 进行安装 (BTW,你需要有管理员权限): 12signtool catdb /v "Microsoft-Windows-Client-Desktop-Required-Package~31bf3856ad364e35~amd64~~10.0.19041.1052.cat"signtool catdb /v "Microsoft-Windows-Client-Desktop-Required-Package~31bf3856ad364e35~amd64~~10.0.19041.1288.cat" 然后,使用 NSudo 或 PSExec 或者其他你喜欢的工具拉起一个 TrustedInstaller 或更高权限的命令提示符,复制这些文件: xinputhid.inf_amd64_b01c6ccf7f1e23b6/ -> C:\\Windows\\System32\\DriverStore\\FileRepository xinputhid.PNF -> C:\\Windows\\INF xinputhid.inf_amd64_b01c6ccf7f1e23b6/xinputhid.inf -> C:\\Windows\\INF xinputhid.inf_amd64_b01c6ccf7f1e23b6/xinputhid.sys -> C:\\Windows\\System32\\drivers 最后,使用同样的高权限用户导入 xinputhid.reg 文件,这样就算安装完成了。 通过蓝牙连接你的 Xbox 手柄,此时你应该会看到一个 Bluetooth XINPUT compatible input device 设备,并且 Xbox 手柄上的灯变为常亮。现在,可以开始游戏了 :)","categories":[],"tags":[{"name":"Windows Server","slug":"Windows-Server","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/Windows-Server/"},{"name":"Xbox","slug":"Xbox","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/Xbox/"},{"name":"Bluetooth","slug":"Bluetooth","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/Bluetooth/"},{"name":"Driver","slug":"Driver","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/Driver/"}]},{"title":"给 Windows Server 2022 配置 Windows Hello 指纹解锁","slug":"fingerprint-unlocking-for-windows-server-2022","date":"2021-09-23T11:00:00.000Z","updated":"2022-12-06T04:24:39.761Z","comments":true,"path":"2021/fingerprint-unlocking-for-windows-server-2022/","link":"","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/2021/fingerprint-unlocking-for-windows-server-2022/","excerpt":"","text":"最近从 Windows 10 迁移到了 Windows Server 2022,不过我在设置指纹解锁时发现添加按钮是灰色的,并且系统显示了错误提示 “Windows Hello 在 Windows Server 上不可用”。 在 Google 上找了一圈并没有找到一个可行的方案,这篇 Windows Server 2019 的博客 给出的工具在 2022 中可以加上 PIN,但加上 PIN 后添加指纹的按钮依然是提示不可用的。看来得自己研究一下了。 初步分析根据前面提到那篇博客给出的思路,我大致翻了一下 SettingsHandlers_User.dll,但是并没有找到和指纹解锁 / Windows Hello 有关的东西,猜测 Microsoft 对这块设置进行了重构。 我并不想去研究整个 UWP APP 的逻辑,于是打开火绒剑观察进程模块。很快就发现进入 登录选项 这个标签时会加载 SettingsHandlers_Authentication.dll,相关逻辑应该就藏在这里了。 放进 IDA 一看,这个 DLL 中确实有不少和 Windows Hello 相关的逻辑,然而点进函数我却发现这个 DLL 除了包含大量遥测、日志代码,还用了 eXtended Flow Guard,这直接让部分逻辑的静态分析变得几乎不可能。 碰到 _guard_xfg_dispatch_icall_fptr() 的时候,如果是调用 GUID 还可以去注册表翻一翻 CLSID,但碰到参数是几个寄存器的时候就只能傻眼了。 没办法直接从 UI 逻辑下手,我试图从导入表中找到 WBF 相关内容然后反向追回去,但是却发现这个 DLL 没有 WBF 相关的导入。猜测微软的设计模式和之前那篇分析 2019 的博客中提到的相同,还是把相关的注册组件拆成了一个独立组件。 除此之外,根据这个 DLL 的逻辑粗略分析,按钮的 SetupOrAddFingerprintSetting::get_IsApplicable() 只是简单的从一个变量里读取了这些信息然后直接返回,而 SetupOrAddFingerprintSetting::get_IsEnabled() 等函数是通过 XFG 动态计算的值。猜测 Windows Server 的相关检测也放到了前文提到的独立组件中,或者在进入设置页面的时候就已经全部计算好了。无论如何,我决定先放弃这个文件,看看能不能找到那个 “独立组件”。 凭据注册管理器花了一点时间把 System32 下带 Enrollment 字样的 DLL/EXE 文件全部翻了一遍,最后我定位到了 CredentialEnrollmentManager.exe 这个文件上。 这个 EXE 的标题为 凭据注册管理器,关联到服务 CredentialEnrollmentManagerUserSvc,并且它在我们进入 登录选项 标签时会被自动启动。加之导入表中有 WinBio 相关的一系列函数以及之前那篇分析 2019 的博客提到的 EnrollPin 函数,我猜测实际的注册逻辑和判断逻辑都在这里。 PIN 注册判断从之前在普通 Windows 10 中配置指纹的经验来看,还是必须有 PIN 才能设置指纹,所以这里先研究 PIN 的注册判断逻辑 (事实证明这个决定非常正确)。 根据函数名一个一个看,排除掉 PinEnrollment::v_IsSupported() 后很快我们就看到了 PinEnrollment::v_CanEnroll() 这个很明显是某种判断的函数。调试一下,很容易发现前面两个对自身变量的判断是通过了的,而在 PinEnrollment::CanAddPin() 这里返回了 false 导致我们不能添加 PIN“: 追进 PinEnrollment::CanAddPin(),很容易发现第一个判断 this->byteE8 就没有通过: 再花一点时间找寻找写这个内存的地方,最后找到了 PinEnrollment::RefreshPolicy() 这个函数。仔细一看,上面大多是一些读取用户配置、组策略配置之类的内容,而往下翻我们很快就看到了一个重要的判断 !IsOS(0x1Du): 这个 IsOS 是什么东西呢?让我们看看 Win32 API 文档: IsOS function (shlwapi.h) Checks for specified operating systems and operating system features.dwOS: A value that specifies which operating system or operating system feature to check for. One of the following values (you cannot combine values).Return value: Returns a nonzero value if the specified operating system or operating system feature is detected, otherwise FALSE. 再结合这里传入的 0x1D 分析,很明显这就是我们要找的判断了。 打补丁用 IDA 打一个简单的补丁 (如果你喜欢,这里换成 jnz 也行): 然后我们覆盖一下文件并杀掉之前的进程,重新进入 登录选项 标签,添加 PIN 的按钮就可以正常使用了。除此之外,添加指纹的组件也可以正常工作,看起来这个 Policy 判断是针对 Windows Hello 而不是单纯针对 PIN 的。 注意事项:文件权限覆盖文件的过程中可能会碰到权限问题,你可以通过 NSudo 拉起一个 TrustedInstaller 权限的命令提示符完成覆盖操作。为了确保操作系统的安全性不受破坏,你应该使用 icacls /save 命令来备份 CredentialEnrollmentManager.exe 的 ACL 并在替换完成后使用 icacls /restore 进行还原。当然,你也可以选择手动设置 ACL,条条大路通罗马。 修改好的文件如果你手上没有 IDA 或者不想自己动手,也可以直接使用我修改好的 CredentialEnrollmentManager.exe: 点击下载 (2022-12-06) 我不能保证这个文件一定能工作,也不能保证它不会损坏你的计算机,你将需要自行承担可能存在的风险。如果你同意承担此风险,我会告诉你解压密码是小写的 xwtf。 注意事项:管理员账户Windows Server 的内建 Administrator 账户并不支持配置指纹解锁。如果你尝试进行配置,就会碰到这样的错误:日常使用 Administrator 账户也不是一个好习惯,建立一个独立的 User + Administrators 组账户就可以使用指纹解锁了。","categories":[],"tags":[{"name":"Windows Server","slug":"Windows-Server","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/Windows-Server/"},{"name":"Windows Hello","slug":"Windows-Hello","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/Windows-Hello/"},{"name":"指纹解锁","slug":"指纹解锁","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/%E6%8C%87%E7%BA%B9%E8%A7%A3%E9%94%81/"}]},{"title":"Hello World","slug":"hello-world","date":"2021-08-16T23:39:07.093Z","updated":"2021-08-17T12:04:32.833Z","comments":true,"path":"2021/hello-world/","link":"","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/2021/hello-world/","excerpt":"","text":"Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new "My New Post" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment","categories":[],"tags":[]}],"categories":[],"tags":[{"name":"Blu-ray","slug":"Blu-ray","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/Blu-ray/"},{"name":"UHD","slug":"UHD","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/UHD/"},{"name":"LibreDrive","slug":"LibreDrive","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/LibreDrive/"},{"name":"Windows Server","slug":"Windows-Server","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/Windows-Server/"},{"name":"Xbox","slug":"Xbox","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/Xbox/"},{"name":"Bluetooth","slug":"Bluetooth","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/Bluetooth/"},{"name":"Driver","slug":"Driver","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/Driver/"},{"name":"Windows Hello","slug":"Windows-Hello","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/Windows-Hello/"},{"name":"指纹解锁","slug":"指纹解锁","permalink":"https://afa31148-4a8c-4113-a92f-72626cd2a27b.x.wtf/tags/%E6%8C%87%E7%BA%B9%E8%A7%A3%E9%94%81/"}]}