I want to create some simple copy protection for my program, I want my program could be run only from original read-only optical di开发者_运维知识库sc (CD/DVD), my question is:
- is there any unique number for each optical media that I could check against my program?
- is there a simple way (or C++ snippets) to programatically check whether my program was launched from optical disc instead of writable disk?
- is there any copy protection scheme that you know i could use, but i prefer end-user doesn't need to input any serial number, need internet access or use some usb-dongle.
No. You didn't specify an operating system, but I know of no operating system in common use that ties the state of your code in virtual memory back to the medium it was launched from. Once your program is running, the whole concept of 'where was it launched from' is generally not well-defined.
You tagged 'dongle'. Requiring a USB key, or some particular media, is possible, but you can't guarantee that the code launched from it.
Short answer: "No", Longer answer, In order to be able to run your program the computer must read it all. There is no simple effective way you can tie the program to that physical disk.
精彩评论