How to create a undeletable registry key (or file) in C++

别说谁变了你拦得住时间么 提交于 2020-01-12 09:54:54

问题


I would like to create time limited version of a game I am developping in C++. I already meet some program that create files I am still not able to delete, and other that created registry key very hard to delete (because there were several sub key and needed to change owner to the deeper first, delete it go up, change owner...).

Then I think the only way is to create something in the computer that is not (or hardly) deletable to mark the beginning of trial. I know how to create key or file but not how to protect them.

Thanks.


回答1:


The standard Windows API is unable to deal with null characters in key/value names, whereas the native API can. As such, you can create a key containing one or more NULL characters in the name to store your licensing data, which would not be deletable using standard tools like regedit.

See: http://technet.microsoft.com/en-us/sysinternals/dd581628 for details and source code.



来源:https://stackoverflow.com/questions/4913258/how-to-create-a-undeletable-registry-key-or-file-in-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!