Code: Select all
CipherSize$ = "b5af67c75b77f50bc437618b36d0403938006fa4a1bc9d7495972498"
UseSHA2Fingerprint()
If StringFingerprint(Str(FileSize(ProgramFilename())), #PB_Cipher_SHA2, 224) <> CipherSize$
MessageRequester("ERROR!", "The program has been altered by other means than the developer intended and will now quit.")
EndIf
;The rest of your programs code goes after the file size checking code.
;-------------------------------------------------------------------------------
;The code below should be run on an executable after it has been compiled.
;You will have to compile twice in order to get the correct cipher size.
;CipherSize$ is just a way to hide the actual file size from a virus but is not 100% protection.
;Debug StringFingerprint(Str(FileSize(ProgramFilename())), #PB_Cipher_SHA2, 224)