delphi共享软件防破解的实用招法


本文整理自网络,侵删。

 声明不是万能的哦

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;

相关阅读 >>

Delphi android应用程序的关闭退出

Delphi 测试字符串读取类: tstringreader

Delphi 日期字符串转换日期格式

Delphi 获取文件大小方法

Delphi隐藏系统托盘tray图标

Delphi xe5 android 开发实现手机打电话和发短信

Delphi renamefile 文件改名

Delphi makeuniquefilename 创建文件名如果已经存在自动更改文件名

Delphi android服务向导

pos、ansipos、fillchar在Delphi2010中unicode的问题

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    暂无评论...