使用REA逆向重制Windows照片查看器

随笔 8 3天前

REA逆向一切!对于喜欢Windows照片查看器的朋友有福了,这是一个独立的重制版可执行程序,目前版本V1.0,大小仅262KB, 点此下载。

MD5:aa9dd121cd71bdfa628f8e2b34c6c6ba
SHA1:7795777aed83c79ec5c61cd53bc546f026d84f9e
SHA256:eebaa5feabb04d60b928c613d95e0ff2f7159087f0fd182e139866912ff5f961
SHA512:0ca44ad4536fbc99941734a7eef83d9fdcb128c0e3001268c88da97b557c5d68fb349febf2c5045c4f385247d0a6cdf60bc7eb2d7a3c95ecf10913194c6befe2


功能如下:

  • 界面还原度接近100%;

  • 新增“上下方向键”放大和缩小图片;

  • 支持“拖拽图片打开”,解决了原版不支持拖拽打开的难题;

  • 支持“打开时按实际尺寸1:1显示”功能,可在设置中勾选是否启用;

  • 菜单栏移除用处不大的“定制照片、电子邮件、刻录数据光盘、制作副本”等功能;


运行环境:

不需要安装 .NET SDK / Visual Studio;只需要 Windows 自带的 .NET Framework 4.8。


另附移除图片打开方式中经典“Windows照片查看器”的打开方式脚本,因使用网上流行的“Win10找回照片查看器”注册表脚本,一旦导入注册表,在打开方式中很难去除,复制以下代码另存为.ps1文件,右键使用PowerShell运行即可:

# =====================================================================================================
#  移除图片"打开方式"中的经典"Windows照片查看器"
#  适用:JPG/JPEG/PNG/GIF/BMP/TIF/TIFF/ICO 等图片格式右键"打开方式"里重复出现"Windows照片查看器"的问题
#  用法:
#     方法A(普通权限,处理用户级关键项即可):右键本文件 → 使用 PowerShell 运行
#     方法B(推荐,同时清理系统级注册):以管理员身份运行 PowerShell,再执行本脚本
#  说明:脚本会重启资源管理器;纯 .reg 无法删除 OpenWithProgids 中的单个值,故本方案用PowerShell实现。
# =====================================================================================================

$ErrorActionPreference = 'Continue'
$admin = (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)

$exts = 'jpg','jpeg','png','gif','bmp','tif','tiff','jfif','jpe','webp','ico'

Write-Host '=== 1/5 移除打开方式程序ID(OpenWithProgids)中的 PhotoViewer.FileAssoc.Tiff ===' -ForegroundColor Cyan
foreach($e in $exts){
  $p = "Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.$e\OpenWithProgids"
  if(Test-Path -LiteralPath $p){
    if((Get-Item -LiteralPath $p).Property -contains 'PhotoViewer.FileAssoc.Tiff'){
      Remove-ItemProperty -LiteralPath $p -Name 'PhotoViewer.FileAssoc.Tiff' -ErrorAction Stop
      Write-Host "  [已移除] .$e 打开方式中的 PhotoViewer.FileAssoc.Tiff"
    } else { Write-Host "  [跳过] .$e 无该程序ID" }
  }
}

Write-Host '=== 2/5 清除扩展名默认程序ID(HKCU\Software\Classes\.ext) ===' -ForegroundColor Cyan
foreach($e in $exts){
  $out = reg delete "HKCU\Software\Classes\.$e" /ve /f 2>$null | Out-String
  Write-Host "  .$e 默认程序ID已清除(若原为空则忽略)"
}

Write-Host '=== 3/5 移除打开方式列表(MRU)中的 DllHost.exe / PhotoViewerClone.exe ===' -ForegroundColor Cyan
foreach($e in $exts){
  $p = "Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.$e\OpenWithList"
  if(Test-Path -LiteralPath $p){
    $k = Get-Item -LiteralPath $p
    foreach($prop in @($k.Property)){
      if($prop -eq 'MRUList'){ continue }
      $v = $k.GetValue($prop)
      if($v -in @('DllHost.exe','PhotoViewerClone.exe')){
        Remove-ItemProperty -LiteralPath $p -Name $prop
        $mru = [string]$k.GetValue('MRUList')
        $mru = (($mru.ToCharArray() | Where-Object { $_ -ne [char]$prop }) -join '')
        Set-ItemProperty -LiteralPath $p -Name 'MRUList' -Value $mru
        Write-Host "  [已移除] .$e 打开方式列表中的 $v"
      }
    }
  }
}

Write-Host '=== 4/5 删除 .gif 的 UserChoiceLatest(若指向经典查看器) ===' -ForegroundColor Cyan
$gifUC = "Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.gif\UserChoiceLatest"
if(Test-Path -LiteralPath $gifUC){
  if((Get-ItemProperty -LiteralPath $gifUC).ProgId -eq 'PhotoViewer.FileAssoc.Tiff'){
    Remove-Item -LiteralPath $gifUC -Recurse -Force
    Write-Host '  [已移除] .gif 的 UserChoiceLatest'
  }
}

Write-Host '=== 5/5 重启资源管理器 ===' -ForegroundColor Cyan
Stop-Process -Name explorer -Force -ErrorAction SilentlyContinue
Start-Sleep -Seconds 2
if(-not (Get-Process -Name explorer -ErrorAction SilentlyContinue)){ Start-Process explorer.exe }

Write-Host ''
Write-Host '完成!图片"打开方式"中的经典"Windows照片查看器"已移除。' -ForegroundColor Green
Write-Host '提示:'
Write-Host "  · 本次是否以管理员运行:$admin"
Read-Host '按回车键退出'

界面素材版权归 Microsoft 所有,本程序仅供个人学习使用,请勿商用。

分享给朋友: