Runs-expiring trial programs

This is an illustration of an easy way to distribute a number-of-runs-protected trial copy of your software. Your program puts up a 5 second splash screen saying how many times it has run, then either runs your program, or if the limit has been exceeded exits via a nag screen reminding users where to obtain the full version and closes. It also checks that the hardware it is running on has not changed, so if a licenced owner 'gives' a copy to someone else it will not run.

The number of runs is stored in one byte of the bmp file. This kind of obfuscation is called 'steganography'. If a 'cracker' is tryng to break your protection they don't know what they are looking for or even where... If your users only have available the tkn fle they have no way of knowing which byte, and only examining date stamps would show the bmp has been altered- one byte does not show in its display.

This shows the changed bytes of the bmp. If you compare in an image viewer with the provided original you might JUST see which bytes changed- it is not in the part of the bmp you might expect, and is certainly not noticeable.

The main body of the program is copied onto the preamble code which does the protection bit. ( It might be neater to run a tkn version of it.) Here I used a BMI calculator as an example. It runs normally, including opening a modal graph analysis program.

If the limit- here 5- is exceeded, you get this screen.

If the machine IDE HDD drive is changed you get this screen. Closing it shuts program down.

There is a zipped package. available on my site. Basically you read the bmp as if it was any binary file and play with one byte. In the unzipped package ( which includes all the LB dlls although LB users have them already) there is also the tkn file and the executable, so you can see how someone sent the executable could not reverse engineer it. Oh, and here's code to reset the number of 'lives' left.
    open "j.bmp" for input as #b
        l        =lof( #b)
        content$ =input$( #b, l)
    close #b
    content$ =left$( content$, l -25); "0"; mid$( content$, l -23)
    open "j.bmp" for output as #b
        #b, content$;
    close #b

Now you can supply un-re-distributable code to license-buyers, which will run only on their machine. Get the client user to obtain the processor IDE ID as below, and as detailed in the LB Forums, and when they send it to you, you send back the customised version with it embedded in the bmp. They have no way to know how or where it is hidden. This could be automated by using the code to find it alrady in the code, but you want contact and payment details for each new licenced user.

open "HardwareIDExtractorC.dll" for dll as #id
CallDLL #id, "GetIDESerialNumber", DriveNumber as long, ret as ulong
print winstring(ret)
close #id