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: [email protected] http://www.uncleme.com