闪存驱动器的第一个扇区 (MBR) 是否在插入计算机时执行
每当我将闪存驱动器插入任何计算机时,前 512 字节都会被执行吗?如果是(应该是这种情况),那么我想如果我提取并反汇编 MBR 并放入指向存储的可执行文件(在闪存驱动器上)的内存位置的引用,即使该可执行文件也会< /strong> 只要插入计算机就会执行..?
我怎么能这么做呢?我的意思是,仅通过执行简单的 call
是不行的。我还想了解有关闪存驱动器 MBR 的更多信息,因为它们与引导操作系统的 MBR 不同。谷歌搜索根本没有显示任何有用的东西。所以我想询问社区,是否有人以前做过类似的事情。Do the first 512 bytes get executed whenever I insert the flash drive into any computer? If yes (which should be the case), then I suppose if I extract and disassemble the MBR and put in a reference that points to a memory location of a stored executable (on the flash drive), even that executable will be executed whenever its plugged in a computer..?
How could I do that? I mean, only by doing a simple call <address>
won't do it.. I also wanna know more about MBRs of flash drives since they are different from those MBRs which bootstrap an Operating System. Googling for it doesn't show up anything useful at all..So I thought of asking the community, if anybody has done something like this before.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
闪存驱动器基于传统技术层,以避免对驱动程序的需求。
在最低级别,有 USB 数据包(根据 Pascal Cuoq,请参阅大容量存储设备规范)
每个 USB 事务都是一个 SCSI 命令/响应对。
操作系统将闪存驱动器视为 SCSI 磁盘(例如,您将在 Linux 中看到 /dev/sdX)。
由于闪存驱动器看起来是普通的 SCSI 磁盘,因此它通常具有 MBR/分区表。
然而,大多数操作系统支持“超级软盘”模式,在这种情况下磁盘以 FAT 引导扇区启动。一些较小的闪存驱动器或使用旧实用程序格式化的闪存驱动器可能采用该配置。
您可以使用 Microsoft 的 DSKPROBE 实用程序(使用 PhysicalDrive 选项)或使用 .\PhysicalDriveX 的“dd.exe”作为 Windows 上闪存驱动器 MBR 的示例(其中 X 是数字..通常为 2,具体取决于硬盘驱动器的数量)你有)
在正确配置的计算机上,插入设备时无法执行代码。
即使“自动运行”功能默认打开,您也需要使用看似 CDROM 的设备。
(SCSI 命令集允许设备判断它是 CD 还是 HD,并且闪存驱动器固件很容易撒谎)
Flash drives are based on layers of legacy technology, to avoid the need for drivers.
At the lowest level, there are USB packets (see the Mass Storage Device spec, as per Pascal Cuoq)
Each of the USB transactions is a SCSI command/response pair.
The OS treats the flash drive as a SCSI disk (you'll see /dev/sdX in Linux, for example).
Since the flash drive appears to be a normal SCSI disk, it usually has a MBR/partition table.
However, most operating systems support a "superfloppy" mode, in which case the disk starts with the FAT bootsector. Some smaller flash drives, or those formatted with legacy utilities, might be in that configuration.
You can example the flash drive MBR on windows with the DSKPROBE utility from Microsoft (Use the PhysicalDrive option), or with 'dd.exe' using .\PhysicalDriveX (where X is a number ..typically 2, based on how many hard drives you have)
On properly configured computers, there is no way to execute code when a device is plugged in.
Even when 'autorun' capability was default-on, you needed to use a device which appeared to be a CDROM.
(The SCSI command-set allows a device to say whether it's a CD or HD, and the flash-drive firmware can easily lie)