1、检测主程序大小,防止破解补丁之类:
function tform1.gesselfsf: integer;
var
f: file of byte;
begin
filemode:=0;
assignfile(f,'.\filename.exe');
reset(f);
result:=filesize(f);
closefile(f);
end;
2、检测创建日期和时间,让破解补丁实效:
function tform1.findate:string;
var
t:tdate;
begin
shortdateformat:='yyyy-mm-dd';
t:=filedatetodatetime(fileage('filename.exe'));
result:=datetostr(t);
end;
3、注册码加密函数嵌入数学函数,增加破解难度:
(略)
4、必要时自己删除自己(主程序):
procedure tform1.funll;
var
hmodule:thandle;
buff:array[0..255]of char;
hkernel32:thandle;
pexitprocess,pdeletefilea,punmapviewoffile:pointer;
begin
hmodule:=getmodulehandle(nil);
getmodulefilename(hmodule, buff, sizeof(buff));
closehandle(thandle(4));
hkernel32:=getmodulehandle('kernel32');
pexitprocess:=getprocaddress(hkernel32, 'exitprocess');
pdeletefilea:=getprocaddress(hkernel32, 'deletefilea');
punmapviewoffile:=getprocaddress(hkernel32, 'unmapviewoffile');
asm
lea eax, buff
push 0
push 0
push eax
push pexitprocess
push hmodule
push pdeletefilea
push punmapviewoffile
ret
end;
begin
funll;
end;
end;
具体怎么使用,那要看你自己的意愿了和需要了。反正俺是这样做的,俺的软件adsl拨号计时器只在很早版本上出过注册机,后来的v3.70出过破解补丁——其实只是破掉了启动时提示注册的对话框,实质上根本没破解。用了上述的着法以后,到现在的v5.28版本,再没有过什么破解补丁或注册机。
如果现在的v5.28版本谁能破解,将立即公布程序源码。怎么样?
e-mail: uncleme@126.com http://www.uncleme.com