将文件存储在MBR中 [英] Store file in MBR

查看:91
本文介绍了将文件存储在MBR中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以访问系统的主启动记录(MBR).我们可以通过c#编码将文件/数据存储在MBR中吗?请解释.

Is it possible to access Master Boot Record (MBR) of a system. Can we store our file/data in MBR through c# coding? Please explain.

推荐答案

为什么要在MBR上存储文件?它不是文件存储位置.还有很多其他位置可以存储文件.假设您不要求进行恶意活动,则无法使用C#直接读取/写入.那将是没有API的高级语言,但是可以使用P/Invoke来实现.
Why do you want to store your file on MBR? It is not file storage location. There are plenty other locations to store your files. Assuming that you are not asking for malicious activity, you can not read/write directly using C#. That would be very high level language with no API, but it is doable using P/Invoke.


优素福是对的.关于您的目的,这看起来像是一个儿童捉迷藏游戏.

如果需要安全性,请帮个忙,了解安全性.我暗示吗?安全性不是基于秘密的隐藏技术.如果一个人知道,另一个人可以学习.安全性基于众所周知的开放算法.您认为公开和秘密是矛盾吗?这是因为您没有了解安全性.

谢谢你,祝你好运,
—SA
This is possible; Yusuf is right. As to your purpose, this looks like a children Hide-and-Seek game.

If you need security, do yourself a favor, learn about security. I hint? Security is not based on secret hidden techniques; if one person knows, another person can learn it. Security is based on commonly known open algorithms. You think open and secret is a contradiction? This is because you did not learn about security.

Thank you and good luck,
—SA


这是一项艰巨的任务.

首先尝试使用VC ++(作为dll项目)使函数写入MBR.

为此,请在MSDN中查找Windows API,例如
CreateFile
http://msdn.microsoft.com/en-us/library/aa363858% 28VS.85%29.aspx [ ^ ]
DeviceIoControl
http://msdn.microsoft.com/en-us/library/aa363216% 28VS.85%29.aspx [ ^ ]

然后使用C#pInvoke签名使用LoadLibrary(),GetProcAddress()调用您的函数,该函数将写入MBR

但是您也会遇到安全问题,因此建议您访问此链接
了解.NET代码访问安全性 [
It''s a big task.

First try to make a function using VC++ (as a dll project) to write to MBR.

To do so look for the windows API in MSDN such as
CreateFile
http://msdn.microsoft.com/en-us/library/aa363858%28VS.85%29.aspx[^]
DeviceIoControl
http://msdn.microsoft.com/en-us/library/aa363216%28VS.85%29.aspx[^]

Then using C# pInvoke signature use LoadLibrary(), GetProcAddress() call your function which writes to MBR

But you will also face security problem, hence I recommend you to visit this link
Understanding .NET Code Access Security[^]


这篇关于将文件存储在MBR中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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