最新消息:

NSIS 破解系统主题文件

nsis 永恒心锁 1349浏览 0评论
!define HAVE_UPX
!ifdef HAVE_UPX
!endif
SetCompressor /SOLID /FINAL lzma
XPStyle on
VAR PATFILE
ICON IN.ico
UninstallIcon UN.ico
Name "Windows XP桌面主题支持"
OutFile "Windows XP桌面主题支持.exe"
InstallDir "$windir\AppPatch"
ShowInstDetails show
LoadLanguageFile "${NSISDIR}\Contrib\Language files\SimpChinese.nlf"
LangString Name ${LANG_SIMPCHINESE} "Simplified Chinese"
UninstPage uninstConfirm
UninstPage instfiles
Function .onInit
SetSilent silent
BringToFront
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CurrentVersion"
StrCmp "$R0" '5.1' VER +1
MessageBox MB_ICONSTOP|MB_OK "你的系统版本不是Windows XP(Windows 版本5.1),$\n安装此程序可能有风险,建议不要安装.$\n或将系统版本告诉我,寻找其它解决方法."
abort "系统版本错误."
VER:
MessageBox MB_ICONQUESTION|MB_YESNO|MB_TOPMOST "是否安装Windows XP桌面主题支持?" IDYES +2
quit
SetSilent normal
FunctionEnd
Section
InitPluginsDir
GetDllVersion "$SYSDIR\UxTheme.dll" $0 $1
StrCmp "$1" '190056580' SP2 +1
StrCmp "$1" '183501906' SP1 +1
MessageBox MB_ICONSTOP|MB_OK "UxTheme.dll版本不是此安装程序可识别的$\n$\r6.0.2800.1106(Windows XP Service Pack 1)$\n$\r或6.0.2900.2180(Windows XP Service Pack 2),$\n$\r所以安装将不能继续.并请与张润华联系!"
abort "UxTheme.dll系统版本错误."
SP1:
DetailPrint '系统:Windows XP Service Pack 1'
DetailPrint 'UxTheme.dll版本:6.0.2800.1106'
STRCPY $PATFILE XPSP1.PAT
goto Begin
SP2:
DetailPrint '系统:Windows XP Service Pack 2'
DetailPrint 'UxTheme.dll版本:6.0.2900.2180'
STRCPY $PATFILE XPSP2.PAT
Begin:
;卸载信息
DetailPrint '正在卸载旧有的Windows XP桌面主题支持...'
ExecWait '"$INSTDIR\UnTheme.exe" /S _?=$INSTDIR'
START:
SetOverwrite off
DetailPrint '正在清除Windows的备份文件,以免破解被恢复...'
RMDir /r "$windir\LastGood"
Delete "$sysdir\dllcache\*"
SetDetailsPrint None
;MessageBox MB_ICONQUESTION|MB_YESNO "ok" idyes +2
;abort
DetailPrint '正在准备破解文件...'
GetFileTime "$Sysdir\UxTheme.dll" $R3 $R3
CopyFiles /FILESONLY /SILENT "$SYSDIR\UxTheme.dll" "D:\"
RMDir /r "$windir\LastGood"
Delete "$sysdir\dllcache\*"
CopyFiles /FILESONLY /SILENT "$SYSDIR\UxTheme.dll" "$INSTDIR\ReUXTheme.crk"
InitPluginsDir
CopyFiles /FILESONLY /SILENT "$SYSDIR\UxTheme.dll" "$PLUGINSDIR\OldUxTheme.dll"
rename "$SYSDIR\UxTheme.dll" "$PLUGINSDIR\^^.TMP"
SETOUTPATH $PLUGINSDIR
FILE XPSP1.PAT
FILE XPSP2.PAT
DetailPrint '正在破解UxTheme Library...'

vpatch::vpatchfile "$PLUGINSDIR\$PATFILE" "$PLUGINSDIR\OldUxTheme.dll" "$PLUGINSDIR\UxTheme.dll"
Pop $R0
DetailPrint '$R0'
STRCMP $R0 OK +1 Bad
DetailPrint '破解成功!'
RMDir /r "$windir\LastGood"
Delete "$sysdir\dllcache\*"
nsExec::ExecToLog 'CMD /C "xcopy /Y /V /H /R "$PLUGINSDIR\UxTheme.dll" "$SYSDIR""'
CopyFiles /FILESONLY /SILENT "$PLUGINSDIR\UxTheme.dll" "$windir\LastGood\SYSTEM32\"
CopyFiles /FILESONLY /SILENT "$PLUGINSDIR\UxTheme.dll" "$sysdir\dllcache\"
CopyFiles /FILESONLY /SILENT "$PLUGINSDIR\UxTheme.dll" "$SYSDIR"
GETFILETIME "$SYSDIR\UxTheme.dll" $R4 $R4
STRCMP $R3 $R4 bad +1
IfFileExists "$Sysdir\UxTheme.dll" Good DANG
Bad:
MessageBox MB_YESNO|MB_ICONEXCLAMATION "破解失效,可能是此软件还没有完善导致的,是否重试?" IDYES START IDNO +1
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\crUxTheme"
rename "$SYSDIR\^^.TMP" "$PLUGINSDIR\UxTheme.dll"
CopyFiles "$Instdir\ReUXTheme.crk" "$sysdir\"
CopyFiles "D:\UxTheme.dll" "$Sysdir\"
GETFILETIME "$SYSDIR\UxTheme.dll" $R5 $R5
STRCMP $R3 $R5 +1 +2
MessageBox MB_ICONINFORMATION|MB_OK "系统已经恢复原来状态!"
ABORT
DANG:
MessageBox MB_ICONstop|MB_ok '危险!此程序安装后发现桌面主题支持文件"$Sysdir\UxTheme.dll"损坏且不可修复,$\n$\r请不要关闭计算机.插入WindowsXP安装盘.$\n$\r再按确定.'
WriteINIStr "$Sysdir\UxTheme.dll" "1" "1" "1"
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\crUxTheme"
abort

Good:
SetDetailsPrint both
MessageBox MB_ICONINFORMATION|MB_OK '由于此程序更改了Windows XP的核心文件,$\n$\r所以肯定会弹出"Windows XP文件保护"框两三次,不用理会它.按[取消]即可.$\n$\r不会对系统做成危害.'
strcpy $9 "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\crUxTheme"
WriteRegStr HKLM "$9" "DisplayIcon" "$INSTDIR\Uninstall.exe"
WriteRegStr HKLM "$9" "DisplayName" "$(^Name)"
WriteRegStr HKLM "$9" "DisplayVersion" ""
WriteRegStr HKLM "$9" "Publisher" "张润华"
WriteRegStr HKLM "$9" "UninstallString" "$INSTDIR\UnTheme.exe"
WriteRegStr HKLM "$9" "InstallLocation" "$INSTDIR"
ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "RegisteredOwner"
ReadRegStr $R2 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "RegisteredOrganization"
WriteRegStr HKLM "$9" "RegOwner" "$R1"
WriteRegStr HKLM "$9" "RegCompany" "$R2"
WriteRegStr HKLM "$9" "Contact" "张润华"
WriteRegStr HKLM "$9" "Comments" "$(^Name)-制作:张润华"
WriteUninstaller "$INSTDIR\UnTheme.exe"
RMDIR /rebootok $PLUGINSDIR
MessageBox MB_ICONQUESTION|MB_YESNO "安装成功!$\n$\r必须重启计算机后破解才能生效!$\n$\r是否立即重启?" idno +2
reboot
quit
MessageBox MB_ICONINFORMATION|MB_OK "请尽快重启计算机防止更改被恢复!"
SectionEnd
Section "Uninstall"
InitPluginsDir
SetOverwrite off
Rename "$sysdir\UxTheme.dll" "$PLUGINSDIR\~ux.tmp"
Delete /rebootok "$PLUGINSDIR\~ux.tmp"
Delete "$PLUGINSDIR\UxTheme.dll"
CopyFiles "$INSTDIR\ReUXTheme.crk" "$sysdir\UxTheme.dll"
CopyFiles "D:\UxTheme.dll" "$Sysdir\"
IfFileExists "$Sysdir\UxTheme.dll" OK +1
MessageBox MB_ICONstop|MB_ok '危险!发现桌面主题支持文件"$Sysdir\UxTheme.dll"丢失,$\n请不要关闭计算机.插入WindowsXP安装盘.$\n再按确定.'
WriteINIStr "$Sysdir\UxTheme.dll" "1" "1" "1"
OK:
Delete "$INSTDIR\UnTheme.exe"
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\crUxTheme"
MessageBox MB_OK|MB_ICONINFORMATION "重启计算机后卸载将完成."
RMDIR /rebootok "$PLUGINSDIR"
SectionEnd
永恒心锁,版权所有丨如未注明,均为转载丨本网站采用BY-NC-SA协议进行授权

转载请注明:永恒心锁-分享互联网 » NSIS 破解系统主题文件

您必须 登录 才能发表评论!