Many of the authors of sharing software are programmed using Delphi. Everyone doesn’t want their software to be cracked by the registration machine. Here is a good way for everyone. If you find programs such as registration machine when running the program, you can do it yourself. Delete it yourself, so that you can prevent the registration machine to a certain extent.
The program deletes its own code as follows:
procedure KillSelf;
var
f:textfile;
Begin
assignfile(f,''./killme.bat''); // Create a new bat file in the program directory
rewrite(f); //Start write content to this bat file
writeeln(f,''@echo off'');
writeeln(f,'':loop'');
writeeln(f,''
writeeln(f,''if exist ./file.exe goto loop'');
writeeln(f,''
closefile(f); //End of writing content
winexec(''./killme.bat'', SW_HIDE); //Call to delete your own bat file,
Close; //Close yourself
end;
We can also use Delphi to call Bios information to encrypt the registration code of the shared software. Of course, we cannot only use the Bios information as the registration code, as this is very easy to crack. You need to design a series of algorithms to correct Bios information is encrypted. The detailed code is as follows:
procedure GetBiosInfo;
Begin
lblMainBoardBiosName.Caption :=^I+string(Pchar(Ptr($FE061)));
lblMainBoardBiosCopyRight.Caption :=^I+string(Pchar(Ptr($FE091)));
lblMainBoardBiosDate.Caption :=^I+string(Pchar(Ptr($FFFF5)));
lblMainBoardBiosSerialNo.Caption :=^I+string(Pchar(Ptr($FEC71)));
end;
Add this program to your program and you can get a series of information about the motherboard Bios, among which lblMainBoardBiosName, lblMainBoardBiosCopyRight, lblMainBoardBiosDate and lblMainBoardBiosSerialNo are all TLabels.