简体   繁体   English

十六进制编辑器可能从exe文件中删除代码? (C ++)

[英]removing code from an exe file with hex editor possible? (c++)

so I was wondering if I could simply use some identification passages in my application to identify the origin of a copyright infringement (not yet implemented, just a thought). 因此我想知道我是否可以在应用程序中简单地使用一些标识段落来标识版权侵权的起因(尚未实施,仅是一种想法)。 But then I figured, probably it's possible to simply cut the respective passages in my code or edit them to make identification impossible with the help of a hex editor or thelike. 但是后来我想到,可能可以简单地在我的代码中剪切各个段落,或者在十六进制编辑器或类似工具的帮助下对其进行编辑以使其无法识别。 Is this possible? 这可能吗? Let's assume for example I would put a hidden comment into the code which could be accessed in a certain secret way (eg by clicking somewhere). 例如,假设我将一个隐藏的注释放入代码中,该注释可以通过某种秘密方式(例如,单击某处)进行访问。 Now if someone possessed two program units (ie which were sold to two different people) would he be able to delete/edit the ''difference'' in a hex editor? 现在,如果某人拥有两个程序单元(即卖给两个不同的人),他是否可以在十六进制编辑器中删除/编辑“差异”?

You can calculate a hash of (the important parts of) the executable, sign it cryptographically, and embed the hash and signature in the executable. 您可以计算可执行文件(重要部分)的哈希,对其进行加密签名,然后将哈希和签名嵌入可执行文件中。 If the executable is modified, the hash will change. 如果可执行文件被修改,则哈希将更改。 If the hash is modified, the signature won't match. 如果哈希值被修改,则签名将不匹配。

If you'd prefer to prevent infringement, rather than just detecting it, then each time the executable runs, it can validate the hash and the signature, refusing to run if they've been modified. 如果您希望防止侵权,而不仅仅是检测到侵权,那么每次可执行文件运行时,它都可以验证哈希和签名,并在修改后拒绝运行。

To identify the source of an application you need to be able to uniquely identify the application. 要标识应用程序的来源,您需要能够唯一标识该应用程序。

This is usually done by providing each customer with a unique key that must be present for the application to run. 通常,这是通过为每个客户提供一个唯一的密钥来完成的,以便应用程序运行。 On start-up the application checks the key is present and is valid. 在启动时,应用程序检查密钥是否存在并且有效。

You can prevent simple editing of the key by using cryptographic means of encoding the key. 您可以通过使用对密钥进行编码的加密方式来防止对密钥进行简单的编辑。 Thus modifying the key with a hex editor will not produce a new key but an invalid key. 因此,使用十六进制编辑器修改密钥不会产生新密钥,而是无效密钥。 Just make the program refuse to run when there is an invalid key. 只要有无效的密钥,使程序拒绝运行即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM