47 lines
2.3 KiB
PowerShell
47 lines
2.3 KiB
PowerShell
<#
|
||
.SYNOPSIS
|
||
在官方 Dalamud 尚未解锁新版本前,向已启动的国际服客户端手动注入 Dalamud。
|
||
#>
|
||
$ErrorActionPreference = 'Stop'
|
||
|
||
Write-Host "=== FFXIV 国际服 Dalamud 强制注入工具 ===" -ForegroundColor Cyan
|
||
|
||
# 1. 寻找正在运行的 ffxiv_dx11 游戏进程
|
||
$processes = Get-Process -Name "ffxiv_dx11" -ErrorAction SilentlyContinue
|
||
if (-not $processes) {
|
||
Write-Host "[!] 未检测到运行中的 ffxiv_dx11.exe 游戏进程!" -ForegroundColor Yellow
|
||
Write-Host " 步骤:" -ForegroundColor Gray
|
||
Write-Host " 1. 请先打开 XIVLauncher 正常登录并启动国际服游戏(即使提示插件已锁定也不影响启动客户端)。" -ForegroundColor Gray
|
||
Write-Host " 2. 待游戏进入标题画面或角色选择界面后,再次运行本脚本。" -ForegroundColor Gray
|
||
return
|
||
}
|
||
|
||
# 2. 定位 Dalamud.Injector
|
||
$injectorPath = Join-Path $env:APPDATA "XIVLauncher\addon\Hooks\15.0.3.6\Dalamud.Injector.exe"
|
||
if (-not (Test-Path $injectorPath)) {
|
||
$injectorPath = Join-Path $env:APPDATA "XIVLauncher\addon\Hooks\dev\Dalamud.Injector.exe"
|
||
}
|
||
|
||
if (-not (Test-Path $injectorPath)) {
|
||
Write-Host "[X] 未找到 Dalamud.Injector.exe,请确认 XIVLauncher 已正确下载 Dalamud 环境。" -ForegroundColor Red
|
||
return
|
||
}
|
||
|
||
Write-Host "[+] 找到 Dalamud 注入器: $injectorPath" -ForegroundColor Green
|
||
|
||
foreach ($proc in $processes) {
|
||
Write-Host "[*] 正在向游戏进程 PID: $($proc.Id) ($($proc.ProcessName)) 注入 Dalamud..." -ForegroundColor Cyan
|
||
& $injectorPath inject $proc.Id
|
||
$exitCode = $LASTEXITCODE
|
||
|
||
if ($exitCode -eq 0) {
|
||
Write-Host "[+] 注入指令执行成功 (ExitCode 0)!" -ForegroundColor Green
|
||
Write-Host " 请切回游戏窗口:" -ForegroundColor Yellow
|
||
Write-Host " - Dalamud 将自动初始化并加载 Dev 插件 [IC.Rebuild 0.1.16.0]" -ForegroundColor Gray
|
||
Write-Host " - 在聊天框输入 /icr 可打开 IC.Rebuild 面板" -ForegroundColor Gray
|
||
Write-Host " - 检查 M0 状态(23/23 关键特征码均已 100% 匹配)" -ForegroundColor Gray
|
||
} else {
|
||
Write-Host "[!] 注入器返回退出码 $exitCode,如提示权限不足,请右键选择『以管理员身份运行』本脚本。" -ForegroundColor Red
|
||
}
|
||
}
|