Thread View: cn.comp.os.winxp
1 messages
1 total messages
Started by �dz�ǰ
Tue, 16 May 2006 14:50
�����?WindowsXpSP2��Ҫ�滻�ļ����ļ�
Author: �dz�ǰ
Date: Tue, 16 May 2006 14:50
Date: Tue, 16 May 2006 14:50
416 lines
16466 bytes
16466 bytes
�����?WindowsXpSP2��Ҫ�滻�ļ����ļ�
���� 22:36|leshijiazu|�����ʹ�á�||
��windowsSP2������Ϊ�˷����ʹ��Ҫ�滻һЩϵͳ�ļ�,������Щ�ļ���ϵͳ�ļ�,������Щϵͳ�ļ�ͨ����ϵͳ�İ汾������������,����������滻��Щ�ļ�ʱҪ���Dz����ԺͰ�ȫ��.
���Ǿ����ܵ�ʹ�ð�ȫϵ��Ƚϸߵ�replacer.�����ֹ��滻����Ҫ���鷳.��ֻ����ש����.
1.uxtheme.dll
ϵͳ��������,�滻�����ʹ�÷ǹٷ�����.�Ƽ�ʹ��UXTheme Multi-Patcher
2.tcpip.dll
BT����,���SP2��TCP������Ϊ10������.�Ƽ�ʹ��XP_SP2_tcpPatch
3.termsrv.dll
����Զ�̵�¼����Terminal Service��ϵͳ�ļ�,����XP SP2 Build
2055֧�������û�ͬʱ��¼���������?�ǵ���ȫ���أ������յ���ʽ��Sp2�оͲ��ܶ��û���½Զ��������.�Ƽ�ʹ�õ������������������,
��WinConnect Server
�滻˵��:
��build2055�汾�е�termsrv.dll�滻
�滻��ʱ��Ҫ�滻һ����systerm32�е�.��һ����system32\dllcache�е�.2��λ�õ�termsrv.dll
�滻����ע���HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal
Server\Licensing Core�н���DWORDֵEnableConcurrentSessions���Ҹ�ֵΪ1.
termsrv.dll����ļ���С��Լ��210k����,�ӹ�����վ���صĴ���ѹ���ļ�,����Ǵӹ�����վ���ص���termsrv.dl_�ļ�����Ҫ����ij�termsrv.zipȻ���ѹ����,��Ҫֱ�Ӹij�termsrv.dll
4.sfc_os.dll
ϵͳ�ļ������ļ�.������Ultraedit32��������ļ�,�ĺ���Զ���ע����SFCSetting=ffffff9d���ü�ֵ������ȫ�����ļ���������.
תһƪ�������滻����ʹ�õ�ϵͳ�ļ�,��Ϥ���Ŀ��Կ���.
�������滻����ʹ�õ�ϵͳ�ļ�
Ҫ�����������:
����1. �滻����ʹ�õ��ļ�.
����2. ���滻ϵͳ�ļ�ʱ����ʾ��CD�ĶԻ���.
���������������߿����滻����ʹ�õ��ļ�,zap��inuse. ����û��Դ����,
ֻ�����������. inuse�Ƚϴ�40K, zap��С7K. �ͷ���zap��.
������ida��zap. ����һ�����ĺ���, ԭ����Ĺ���ԭ���ǰ�����ļ�������λ��,
��Ϊ�Ƚϼ�ֱ�����ϴ���.
-------------------cut zap.c---------
#include <Windows.h>
BOOL ZapDelFile(char *szFileToDel)
{
char cTempFileName;
char cTempPathName;
char cFileName;
if(szFileToDel == ':'){
sprintf(cTempPathName, "%c:\\", szFileToDel);
}
else{
GetModuleFileName(NULL, cFileName, 0x100);
sprintf(cTempPathName, "%c:\\", cFileName);
}
if(GetTempFileName(cTempPathName, "_@", 0, cTempFileName) == 0){
return FALSE;
}
if(MoveFileEx(szFileToDel, cTempFileName, 1) == 0){
return FALSE;
}
if(MoveFileEx(cTempFileName, NULL, 4) == 0){
return FALSE;
}
return TRUE;
}
void usage(char *n) {
printf("usage: %s fileNeedToDel\n", n);
exit(0);
}
int main(int argc, char* argv)
{
printf("Zap programed by bgate. *\n\n");
if (argc != 2)
usage(argv);
if(ZapDelFile(argv) == TRUE){
printf("OK");
}
else{
printf("error %d", GetLastError());
}
return 0;
}
-------------------end cat-----------
�����������Ѿ���������ȥɾ������ʹ�õ�ϵͳ�ļ���,
����ɾ��֮��ᵯ���������Windows CD�Ի���.
����ע��: ɾϵͳ�ļ�ǰ���ñ���, ������ǰ�ָ�,
����ɾϵͳ�ļ�ǰ����Ҫ��dllcache����Ӧ�ı���ɾ��. ����ϵͳ���Զ��ָ�.
��������������취ȥ������Ի���:
����1.Windows 2000��ִ��ϵͳ�ļ������Ĵ�����sfc.dll��, Xpϵͳ����sfc_os.dll��.
����2.ע����а�һ����SfcDisable�ļ���ΪFFFFFF9D�����´�����ʱ���ļ���������ʧЧ.
��������ķ�������Win2K sp4+�Ͻ��е�. ���з�����sfc.dll�汾��5.0.2195.6673
������ida��sfc.dll��string����sfcdisable, û�ҵ�! ��string��ʾUnicode.
���¿�����. �ҵ���SfcDisable���õ�һ���ط�.��������
.text:769269F9 call _SfcQueryRegDwordWithAlternate@16 ;
SfcQueryRegDwordWithAlternate(x,x,x,x)
.text:769269FE push ebx
.text:769269FF push offset ??_C@_1BG@HOGG@?$AAS?$AAf?$AAc?$AAD?; "SfcDisable"
.text:76926A04 push edi
.text:76926A05 push esi
.text:76926A06 mov _SFCDebug, eax
.text:76926A0B call _SfcQueryRegDwordWithAlternate@16 ;
SfcQueryRegDwordWithAlternate(x,x,x,x)
.text:76926A10 push ebx
.text:76926A11 push offset
??_C@_1BA@HLJH@?$AAS?$AAf?$AAc?$AAS?$AAc?$AAa?$AAn?$AA?$AA@ ; "SfcScan"
.text:76926A16 push edi
.text:76926A17 push esi
.text:76926A18 mov _SFCDisable, eax
.text:76926A1D call _SfcQueryRegDwordWithAlternate@16 ;
SfcQueryRegDwordWithAlternate(x,x,x,x)
.text:76926A22 push ebx
.text:76926A23 push offset
??_C@_1BC@KFAJ@?$AAS?$AAf?$AAc?$AAQ?$AAu?$AAo?$AAt?$AAa?$AA?$AA@ ; "SfcQuota"
.text:76926A28 push edi
.text:76926A29 push esi
.text:76926A2A mov _SFCScan, eax
��������_SfcQueryRegDwordWithAlternate@16�Ƕ�ע���ĺ���. ������,
���ע�����SfcDisable��ֵ������_SFCDisable��. ��, ����softice.
��_SFCDisable����ϵ�. �������ø�д��zapȥɾϵͳ�ļ�, softice��������.
�ϵ�����������ط�, eipΪ7692A326, _SFCDisableΪ2.
.text:7692A319 push ecx
.text:7692A31A and , 0
.text:7692A31F cmp _SFCDisable, 3
.text:7692A326 push ebx
.text:7692A327 push ebp
.text:7692A328 push esi
.text:7692A329 push edi
.text:7692A32A jnz short loc_7692A333
.text:7692A32C xor eax, eax
.text:7692A32E jmp loc_7692A459
����F5�˳�, һ���Ի����˳���, �Ͷ����������һ��. �ܺ�, ����������δ���"cmp
_SFCDisable, 3". ��ʱ_SFCDisableΪ2�����˶Ի���,
��ô�ҾͰ����Ϊ3����zapɾϵͳ�ļ�����. ��, ����ܺ�,
���û�����ò�CD�ĶԻ�����.
Ҳ����˵ֻҪ���ǰ�_SFCDisable��Ϊ3����͵͵���滻ϵͳ�ļ���.
����ͬ�汾�����ַ�Dz�һ���, ��switch������������Dz���.
��д����ͨ���ԵĴ���.
������ʼ������Ĺ���ԭ������Winlogon�������ж�ϵͳ�ļ����в���.
�����sfc.dll�����������.
���Ǿ�ֻ��õ��������������Ȼ����������"ע��"���Ϳ�����.����������δ�����������,
�ҵ������76924544���, ����76924544�ϼӸ��ϵ�, ����ȥɾ�ļ�. softice�������,
�����ں�������, �����ڸղ����õĶ�_SFCDisable�Ķ�ȡ��,
û���к������ھ������˺������еĴ���, ��������������. �ǵñ��ҳ���ɱ��,
��2000Դ���� : ). ���˰���û�ҵ���Ӧ������ֻ���˻��������,
��������������NtWaitForMultipleObjects. ��, �ѹ�û�ж��ں���������,
ԭ���������˺�������Ȼ���ں�������һֱû�˳�. ע�ͺ���ķ���������.
������ʱ������Ĺ���ԭ������winlogon����sfc.dll�е����������ϵͳ����ʱ������һϵ���¼�.
��Ȼwinlogon������, ��ô��ҲӦ�õó���. ��depends��winlogon.
��Ȼ��sfc.dll����������������. һ���Ǹղŷ������Ǹ�, ������һϵ���¼�.
������һ��, �����ַ��76926869, ��������, �ر���һϵ���¼�.
��������ֻҪ��winlogon��ע��������"��һ��"�������ȡ���ļ�����������.
����winlogon�������ע�����. 26A��־����������ƪ�����ᵽ��ע�뷽��:"adjust
debugger access rightz to our process". ��Ҳ��һƪSFCDisable������,
���õķ��������ڴ�������������, Ȼ����. ͨ����Ӧ��û��ô��.
���������ע�뷽���Ǵ�crazylord�Ĵ����п�������, �������. ,
д�������ü����, ��֮ˮƽ����, д�IJ������ŵĵط��ͽ����ſ�.
-----------------cut antisfc.c-----------
#include <stdlib.h>
#include "Windows.h"
#include "Tlhelp32.h"
#pragma comment( lib, "Advapi32.lib" )
typedef void (_stdcall * CLOSEEVENTS)(void);
typedef unsigned long DWORD;
typedef DWORD ANTISFC_ACCESS;
/*
* ANTISFC structures
*/
typedef struct _ANTISFC_PROCESS {
DWORD Pid; // process pid
HANDLE ProcessHandle; // process handle
char ImageName; // image name (not full path)
} ANTISFC_PROCESS, *PANTISFC_PROCESS;
__inline void ErrorMessageBox(char *szAdditionInfo)
{
printf("error on %s, error code %d. \n", szAdditionInfo, GetLastError());
}
void usage(char *n) {
printf("usage: %s \n", n);
printf("\t/d: disable sfc file protecte fuction.\n");
exit(0);
}
DWORD Init() {
DWORD Ret = 0;
HANDLE hToken;
LUID sedebugnameValue;
TOKEN_PRIVILEGES tkp;
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES |
TOKEN_QUERY, &hToken)) {
ErrorMessageBox("OpenProcessToken");
} else {
if (!LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &sedebugnameValue)) {
ErrorMessageBox("LookupPrivilegeValue");
} else {
tkp.PrivilegeCount = 1;
tkp.Privileges.Luid = sedebugnameValue;
tkp.Privileges.Attributes = SE_PRIVILEGE_ENABLED;
if (!AdjustTokenPrivileges(hToken, FALSE, &tkp, sizeof tkp, NULL, NULL)) {
ErrorMessageBox("AdjustTokenPrivileges");
} else {
Ret = 1;
}
}
CloseHandle(hToken);
}
return(Ret);
}
DWORD GetPidEx(char *proc_name, char *full_path) {
DWORD dwPid=0;
HANDLE hSnapshot;
PROCESSENTRY32 pe;
BOOL Ret;
if (isdigit(proc_name))
dwPid = strtoul(proc_name, NULL, 0);
else
dwPid = -1;
hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hSnapshot == (HANDLE) -1){
ErrorMessageBox("CreateToolhelp32Snapshot");
return(0);
}
pe.dwSize = sizeof(PROCESSENTRY32);
Ret = Process32First(hSnapshot, &pe);
while (Ret) {
if((strncmp(strlwr(pe.szExeFile), strlwr(proc_name), strlen(proc_name)) == 0)
|| (pe.th32ProcessID == dwPid)) {
dwPid = pe.th32ProcessID;
strcpy(full_path, pe.szExeFile);
break;
}
pe.dwSize = sizeof(PROCESSENTRY32);
Ret = Process32Next(hSnapshot, &pe);
}
CloseHandle(hSnapshot);
if (dwPid == -1)
dwPid = 0;
return(dwPid);
}
DWORD InitProcess(PANTISFC_PROCESS Process, char *proc_name, ANTISFC_ACCESS
access) {
DWORD Ret=0;
Process->Pid = GetPidEx(proc_name, Process->ImageName);
if (Process->Pid != 0 && Process->ImageName != 0) {
Process->ProcessHandle = OpenProcess(access, FALSE, Process->Pid);
if (Process->ProcessHandle == NULL)
ErrorMessageBox("OpenProcess");
else
Ret = 1;
}
return(Ret);
}
DWORD InjectThread(PANTISFC_PROCESS Process,
PVOID function) {
HANDLE hThread;
DWORD dwThreadPid = 0, dwState;
hThread = CreateRemoteThread(Process->ProcessHandle,
NULL,
0,
(DWORD (__stdcall *) (void *)) function,
NULL,
0,
&dwThreadPid);
if (hThread == NULL) {
ErrorMessageBox("CreateRemoteThread");
goto cleanup;
}
dwState = WaitForSingleObject(hThread, 4000); // attends 4 secondes
switch (dwState) {
case WAIT_TIMEOUT:
case WAIT_FAILED:
ErrorMessageBox("WaitForSingleObject");
goto cleanup;
case WAIT_OBJECT_0:
break;
default:
ErrorMessageBox("WaitForSingleObject");
goto cleanup;
}
CloseHandle(hThread);
return dwThreadPid;
cleanup:
CloseHandle(hThread);
return 0;
}
int main(int argc, char* argv)
{
ANTISFC_PROCESS Process;
HMODULE hSfc;
DWORD dwThread;
CLOSEEVENTS pfnCloseEvents;
DWORD dwVersion;
printf("AntiSfc programed by bgate. *\n\n");
if (argc != 2)
usage(argv);
if (strcmp(argv, "/d") != 0) {
usage(argv);
}
if (Init()) {
printf("debug privilege set\n");
} else {
printf("error on get debug privilege\n");
return(0);
}
if(InitProcess(&Process, "winlogon.exe", PROCESS_ALL_ACCESS) == 0) {
printf("error on get process info. \n");
return(0);
}
dwVersion = GetVersion();
if ((DWORD)(LOBYTE(LOWORD(dwVersion))) == 5){ // Windows 2000/XP
if((DWORD)(HIBYTE(LOWORD(dwVersion))) == 0){ //Windows 2000
hSfc = LoadLibrary("sfc.dll");
printf("Win2000\n");
}
else {//if((DWORD)(HIBYTE(LOWORD(dwVersion))) = 1) //Windows XP
hSfc = LoadLibrary("sfc_os.dll");
printf("Windows XP\n");
}
}
//else if () //2003?
else {
printf("unsupported version\n");
}
pfnCloseEvents = (CLOSEEVENTS)GetProcAddress(hSfc,
MAKEINTRESOURCE(2));
if(pfnCloseEvents == NULL){
printf("Load the sfc fuction failed\n");
FreeLibrary(hSfc);
return(0);
}
FreeLibrary(hSfc);
dwThread = InjectThread(&Process,
pfnCloseEvents);
if(dwThread == 0){
printf("failed\n");
}
else{
printf("OK\n");
}
CloseHandle(Process.ProcessHandle);
return(0);
}
------------------end cut---------
����������zap�滻ϵͳ�ļ�ǰ����һ��antisfc������, ��Ҳ��������д��һ��.
������������2000, xp, 2003?���κΰ汾��ʹ��. ������ֻ��Win2K sp4+, WinXP
sp1+�ϲ��Թ�.
�������ĵ�ȱ�����滻��ϵͳ�ļ�ֻ������������Ч, д����.
--
������...�Ҽ���2006.05.09��21:05�ٴ�Ϊ�����Ů����ʧ����Ͻ���һ����...
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads