如何在Delphi中创建不可删除的文件 [英] How to create an undeletable file in Delphi

查看:121
本文介绍了如何在Delphi中创建不可删除的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[以下是我上一个问题的改写,被认为是模棱两可的.]

[the following is a rephrase of my previous question, which was deemed ambiguous].

我正在研究为演示应用程序创建基本的许可机制.我的想法是这样的:该应用程序在首次运行时会创建一个名为"0b1xa487x.ini"的空许可证文件",然后在首次执行后30天到期,并且不再运行因为系统上存在该特定文件.

I'm digging into creating a basic licensing mechanism for a demo application. What I have in mind goes like that: the application creates an empty "license file" called, say "0b1xa487x.ini" upon the first run, then expires 30 days after it has been first executed and can't be run anymore as long as that specific file is present on the system.

我正在寻找的是一种以阻止删除的方式来保护特定文件的方法.由于它将是一个空白文件,没有任何内容,因此我不介意它已损坏,标头损坏,日期无效,以及保持不可删除所需的任何时间.

What I'm looking for is a method to protect that specific file in a way to deter deletion. Since it will be a blank file, devoid of any content, I wouldn't mind it to be corrupt, have corrupt headers, invalid date, whatever it takes to stay undeletable.

我在某处基于文件属性看到了类似的方法(该文件已将HX属性设置在适当的位置);但是,属性方法使我无处可寻,因为在文件属性X的存在下我找不到任何记录的功能.

I've seen a similar approach somewhere based on file attributes (the file had the HX attributes set in place); however, the attribute approach lead me nowhere, as I can't find any documented feature on the existence of a file attribute X.

我还知道还有其他方法,包括rootkit驱动程序和以系统用户身份启动的系统服务,但是这种特定方法似乎最适合这种情况.再次,我概述文件的内容可能也无法访问,我不打算使用该方法从文件运行任何类型的恶意软件,因为我在下面被指控:)

I also know that there are other approaches including rootkit drivers and system services launched as system user, but this particular one seems to fit best in this scenario. Again, I outline that the file's contents may as well be inaccessible, I'm not planning to use the approach in running any kind of malware from the file, as I've been accused below :)

推荐答案

腐败提示不符合某些标准.没有空白文件的标准.

Corrupt suggests not conforming to some standard. There are no standards for blank files.

这篇关于如何在Delphi中创建不可删除的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆