Microsoft\Windows\Current
Version\Policies\System]下的DisableRegistryTools值为1
实验目的:锁定注册表(本方法利用了Cracker的思路来实现,直接让程序修改程序指令,使调用注册表程序禁止。)
实现方法:C程序
1.regedit.exe
偏移地址:0x69CA 将指令:0x74 0x1A 修改成:0x90 0x90
偏移地址:0x10bf2 将指令:0x74 0x52 修改成:0x90 0x90
#include
bool scanreg(const char *file,long offset, int length,char *the); /*函数说明*/
{
char the[]={ 0x90,0x90 };
scanreg("C:\\WINNT\\regedit.exe",0x69CA,0x02,the); /*调用函数修改winnt下的regedit.exe 其中的0x02是修改长度*/
scanreg("C:\\WINNT\\ServicePackFiles\\i386\\regedit.exe",0x69CA,0x02,the); /*调用函数改变补丁下regedit.exe*/
scanreg("C:\\WINNT\\system32\\regedt32.exe",0x10bf2,0x02,the); /*调用函数修改system32下的regedt32.exe */
scanreg("C:\\WINNT\\ServicePackFiles\\i386\\regedt32.exe",0x10bf2,0x02,the); /*调用函数改变补丁下regedt32.exe*/
}
bool scanreg(const char *file,long offset, int length,char *the)
{
FILE *fp = NULL;
bool result=false;
if((fp=fopen(file,"rb+"))!=NULL) /*打开文件进行读写操作*/
{
fseek(fp,offset,1); /*把指针指向我们定义的偏移地址*/
fwrite(the,length,1,fp); /*修改程序,把指令替换成0x90*/
fclose(fp); /*关闭文件*/
result=true;
}
return(result);
}