首页
社区
课程
招聘
[求助]C# Self Hashing Application
发表于: 2010-8-26 04:57 1239

[求助]C# Self Hashing Application

2010-8-26 04:57
1239
C# Self Hashing Application
Calculating Hash Code

Calculating the hash code of a file using algorithms such as MD5 and SHA1 is not too difficult.

But what about an application that computes its own hash code? The tricky part is reading the application file while it is in use.
Open File

To calculate the hash value of the running application the program needs to read its own executing file. However since the file is in use, some methods to read the file will give an error like this:

The process cannot access the file '[file path]' because it is being used by another process.

We can avoid this type of error by using the proper .NET classes to read an open file. For example, the System.IO.File class has a static function OpenRead which returns a stream to read the content of the files.

With OpenRead a C# developer can extract the byte data of any file, including the one of the running application.

[课程]Android-CTF解题方法汇总!

上传的附件:
收藏
免费 0
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//