Board logo

标题: 共享软件防破解的实用招法 [打印本页]

作者: 久木    时间: 2005-7-9 23:35     标题: 共享软件防破解的实用招法

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;
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;





欢迎光临 黑色海岸线论坛 (http://bbs.thysea.com/) Powered by Discuz! 7.2