|
//
// 降低 DirectX 版本, 以便重新安装 DirectX 9.0C
//
RegSet(TEXT("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\DirectX"), TEXT("Version"), REG_SZ, (LPBYTE)TEXT("4.09.00.0900"), NULL);
//
// 安装 DirectX 9.0C 里面的 dsetup.dll dsetup32.dll 用的是 9.0 最初版本, 以便 Windows 2003 安装完整的 DirectX 9.0C
//
System_StartProgram(TEXT("%CurrentDir%\\DxSetup.exe"), TEXT("/Silent"), SW_NORMAL, TRUE);
//
// 还原 dsetup.dll dsetup32.dll 文件, 再次安装 DirectX 9.0C
//
File_MoveFile(TEXT("%CurrentDir%\\dsetup.bak"), TEXT("%CurrentDir%\\dsetup.dll"), TRUE);
File_MoveFile(TEXT("%CurrentDir%\\dsetup32.bak"), TEXT("%CurrentDir%\\dsetup32.dll"), TRUE);
System_StartProgram(TEXT("%CurrentDir%\\DxSetup.exe"), TEXT("/Silent"), SW_NORMAL, TRUE);
//
// 安装 VideoDecoder 提取自 XP 系统 ( 某些老游戏需要 )
//
if (3 == System_GetWindowsVersion())
{
/* Windows 2003 */
File_MoveFile(TEXT("%CurrentDir%\\VideoDecoder\\iccvid.dll"), TEXT("%WinDir%\\System32\\iccvid.dll"), FALSE);
File_MoveFile(TEXT("%CurrentDir%\\VideoDecoder\\iac25_32.ax"), TEXT("%WinDir%\\System32\\iac25_32.ax"), FALSE);
File_MoveFile(TEXT("%CurrentDir%\\VideoDecoder\\ir32_32.dll"), TEXT("%WinDir%\\System32\\ir32_32.dll"), FALSE);
File_MoveFile(TEXT("%CurrentDir%\\VideoDecoder\\ir41_32.ax"), TEXT("%WinDir%\\System32\\ir41_32.ax"), FALSE);
File_MoveFile(TEXT("%CurrentDir%\\VideoDecoder\\ir50_32.dll"), TEXT("%WinDir%\\System32\\ir50_32.dll"), FALSE);
RegSet(TEXT("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32"), TEXT("vidc.cvid"), REG_SZ, (LPBYTE)TEXT("iccvid.dll"), NULL);
RegSet(TEXT("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32"), TEXT("vidc.iv31"), REG_SZ, (LPBYTE)TEXT("ir32_32.dll"), NULL);
RegSet(TEXT("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32"), TEXT("vidc.iv32"), REG_SZ, (LPBYTE)TEXT("ir32_32.dll"), NULL);
RegSet(TEXT("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32"), TEXT("vidc.iv41"), REG_SZ, (LPBYTE)TEXT("ir41_32.ax"), NULL);
RegSet(TEXT("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32"), TEXT("msacm.iac2"), REG_SZ, (LPBYTE)TEXT("iac25_32.ax"), NULL);
RegSet(TEXT("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32"), TEXT("vidc.iv50"), REG_SZ, (LPBYTE)TEXT("ir50_32.dll"), NULL);
}
===================================================
玩 CS 遇到过的情况,解决办法:
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise" /noexecute=alwaysoff /fastdetect
BOOT.INI 里面添加 /noexecute=alwaysoff
=======================================================================
NVIDA 显卡遇到的游戏蓝屏问题,因为 2003 SP2 会遇到这种问题,解决办法就是替换 SP1 里面的 videoprt.sys
//
// Windows 2003 Videoprt.sys 补丁, Videoprt.sys 默认版本在某些显卡上玩游戏会蓝屏.
//
if (3 == System_GetWindowsVersion())
{
if (FALSE == File_GetFileAttributes(TEXT("%WinDir%\\System32\\Drivers\\Videoprt.sys.bak")))
{
System_DisableWindowsFileProtection(TEXT("%WinDir%\\System32\\Drivers\\Videoprt.sys"));
File_MoveFile(TEXT("%WinDir%\\System32\\Drivers\\Videoprt.sys"), TEXT("%WinDir%\\System32\\Drivers\\Videoprt.sys.bak"), TRUE);
File_CopyFile(TEXT("%CurrentDir%\\Videoprt.sys"), TEXT("%WinDir%\\System32\\Drivers\\Videoprt.sys"), FALSE);
File_DeleteFile(TEXT("%WinDir%\\System32\\Dllcache\\Videoprt.sys"), FALSE);
}
}
BOOL TCPIP_XP()
{
//
// 检查文件
//
BYTE Buffer[255] = {0};
HANDLE hFile = File_OpenFile(TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys"), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE);
if (hFile == FALSE)
{
return FALSE;
}
File_SetFilePointer(hFile, FILE_BEGIN, 0X130);
File_ReadFile(hFile, Buffer, 1);
File_CloseFile(hFile);
if (Buffer[0] != 0x6B)
{
return FALSE;
}
//
// 修改文件
//
System_DisableWindowsFileProtection(TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys"));
File_CopyFile(TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys"), TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys.tmp"), TRUE);
hFile = File_OpenFile(TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys.tmp"), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE);
Buffer[0] = 0x61;
File_SetFilePointer(hFile, FILE_BEGIN, 0x130);
if (FALSE == File_WriteFile(hFile, Buffer, 1))
{
File_CloseFile(hFile);
return FALSE;
}
Buffer[0] = 0xFF;
Buffer[1] = 0xFF;
File_SetFilePointer(hFile, FILE_BEGIN, 0x4FB46);
if (FALSE == File_WriteFile(hFile, Buffer, 2))
{
File_CloseFile(hFile);
return FALSE;
}
File_CloseFile(hFile);
//
// 替换文件
//
if (FALSE == File_MoveFile(TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys"), TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys.bak"), TRUE))
{
return FALSE;
}
if (FALSE == File_MoveFile(TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys.tmp"), TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys"), TRUE))
{
return FALSE;
}
File_DeleteFile(TEXT("%WinDir%\\System32\\Dllcache\\Tcpip.sys"), FALSE);
return TRUE;
}
BOOL TCPIP_2003()
{
//
// 检查文件
//
BYTE Buffer[255] = {0};
HANDLE hFile = File_OpenFile(TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys"), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE);
if (hFile == FALSE)
{
return FALSE;
}
File_SetFilePointer(hFile, FILE_BEGIN, 0X138);
File_ReadFile(hFile, Buffer, 1);
File_CloseFile(hFile);
if (Buffer[0] != 0x10)
{
return FALSE;
}
//
// 修改文件
//
System_DisableWindowsFileProtection(TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys"));
File_CopyFile(TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys"), TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys.tmp"), TRUE);
hFile = File_OpenFile(TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys.tmp"), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE);
Buffer[0] = 0x06;
File_SetFilePointer(hFile, FILE_BEGIN, 0x138);
if (FALSE == File_WriteFile(hFile, Buffer, 1))
{
File_CloseFile(hFile);
return FALSE;
}
Buffer[0] = 0xFF;
Buffer[1] = 0xFF;
File_SetFilePointer(hFile, FILE_BEGIN, 0x57974);
if (FALSE == File_WriteFile(hFile, Buffer, 2))
{
File_CloseFile(hFile);
return FALSE;
}
File_CloseFile(hFile);
//
// 替换文件
//
if (FALSE == File_MoveFile(TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys"), TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys.bak"), TRUE))
{
return FALSE;
}
if (FALSE == File_MoveFile(TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys.tmp"), TEXT("%WinDir%\\System32\\Drivers\\Tcpip.sys"), TRUE))
{
return FALSE;
}
File_DeleteFile(TEXT("%WinDir%\\System32\\Dllcache\\Tcpip.sys"), FALSE);
return TRUE;
}
BOOL UXTHEME_XP()
{
//
// 检查文件
//
BYTE Buffer[255] = {0};
HANDLE hFile = File_OpenFile(TEXT("%WinDir%\\System32\\Uxtheme.dll"), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE);
if (hFile == FALSE)
{
return FALSE;
}
File_SetFilePointer(hFile, FILE_BEGIN, 0x140);
File_ReadFile(hFile, Buffer, 2);
File_CloseFile(hFile);
if (Buffer[0]!=0x3A || Buffer[1]!=0xF4)
{
return FALSE;
}
//
// 修改文件
//
System_DisableWindowsFileProtection(TEXT("%WinDir%\\System32\\Uxtheme.dll"));
File_CopyFile(TEXT("%WinDir%\\System32\\Uxtheme.dll"), TEXT("%WinDir%\\System32\\Uxtheme.dll.tmp"), TRUE);
hFile = File_OpenFile(TEXT("%WinDir%\\System32\\Uxtheme.dll.tmp"), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE);
Buffer[0] = 0x21;
Buffer[1] = 0x6E;
File_SetFilePointer(hFile, FILE_BEGIN, 0x140);
if (FALSE == File_WriteFile(hFile, Buffer, 2))
{
File_CloseFile(hFile);
return FALSE;
}
Buffer[0] = 0x33;
Buffer[1] = 0xF6;
Buffer[2] = 0x8B;
Buffer[3] = 0xC6;
Buffer[4] = 0xC9;
Buffer[5] = 0xC2;
Buffer[6] = 0x08;
Buffer[7] = 0x00;
File_SetFilePointer(hFile, FILE_BEGIN, 0x19A9C);
if (FALSE == File_WriteFile(hFile, Buffer, 8))
{
File_CloseFile(hFile);
return FALSE;
}
File_CloseFile(hFile);
//
// 替换文件
//
if (FALSE == File_MoveFile(TEXT("%WinDir%\\System32\\Uxtheme.dll"), TEXT("%WinDir%\\System32\\Uxtheme.dll.bak"), TRUE))
{
return FALSE;
}
if (FALSE == File_MoveFile(TEXT("%WinDir%\\System32\\Uxtheme.dll.tmp"), TEXT("%WinDir%\\System32\\Uxtheme.dll"), TRUE))
{
return FALSE;
}
File_DeleteFile(TEXT("%WinDir%\\System32\\Dllcache\\Uxtheme.dll"), FALSE);
return TRUE;
}
BOOL UXTHEME_2003()
{
//
// 检查文件
//
BYTE Buffer[255] = {0};
HANDLE hFile = File_OpenFile(TEXT("%WinDir%\\System32\\Uxtheme.dll"), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE);
if (hFile == FALSE)
{
return FALSE;
}
File_SetFilePointer(hFile, FILE_BEGIN, 0x148);
File_ReadFile(hFile, Buffer, 2);
File_CloseFile(hFile);
if (0x0804 == GetSystemDefaultUILanguage())
{
if (Buffer[0]!=0xF4 || Buffer[1]!=0xA8) //中文
{
return FALSE;
}
}
else
{
if (Buffer[0]!=0xCA || Buffer[1]!=0x7B) //英文
{
return FALSE;
}
}
//
// 修改文件
//
System_DisableWindowsFileProtection(TEXT("%WinDir%\\System32\\Uxtheme.dll"));
File_CopyFile(TEXT("%WinDir%\\System32\\Uxtheme.dll"), TEXT("%WinDir%\\System32\\Uxtheme.dll.tmp"), TRUE);
hFile = File_OpenFile(TEXT("%WinDir%\\System32\\Uxtheme.dll.tmp"), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE);
if (0x0804 == GetSystemDefaultUILanguage())
{
Buffer[0] = 0x6A; //中文
Buffer[1] = 0x8F;
}
else
{
Buffer[0] = 0x40; //英文
Buffer[1] = 0x62;
}
File_SetFilePointer(hFile, FILE_BEGIN, 0x148);
if (FALSE == File_WriteFile(hFile, Buffer, 2))
{
File_CloseFile(hFile);
return FALSE;
}
Buffer[0] = 0x33;
Buffer[1] = 0xF6;
Buffer[2] = 0x8B;
Buffer[3] = 0xC6;
Buffer[4] = 0xC9;
Buffer[5] = 0xC2;
Buffer[6] = 0x08;
Buffer[7] = 0x00;
File_SetFilePointer(hFile, FILE_BEGIN, 0x2AEB9);
if (FALSE == File_WriteFile(hFile, Buffer, 8))
{
File_CloseFile(hFile);
return FALSE;
}
File_CloseFile(hFile);
//
// 替换文件
//
if (FALSE == File_MoveFile(TEXT("%WinDir%\\System32\\Uxtheme.dll"), TEXT("%WinDir%\\System32\\Uxtheme.dll.bak"), TRUE))
{
return FALSE;
}
if (FALSE == File_MoveFile(TEXT("%WinDir%\\System32\\Uxtheme.dll.tmp"), TEXT("%WinDir%\\System32\\Uxtheme.dll"), TRUE))
{
return FALSE;
}
File_DeleteFile(TEXT("%WinDir%\\System32\\Dllcache\\Uxtheme.dll"), FALSE);
return TRUE;
}
|
上一篇: win7 封装激活失败下一篇: 问Noime大大一个问题,希望解答
|