How do I read/write (program) the MBR/VBR of a flash drive?

时间秒杀一切 提交于 2019-12-13 08:06:17

问题


I'm looking for a method of reading/writing (actually programming) the Master Boot Record (or maybe VBR) of a usb mass storage device. Actually its a flash drive whose MBR I want to program, so that whenever I plug it into any computer, a program (stored on my flash drive in a file) gets executed.

I know quite a bit of assembly but I don't know how to go about programming MBRs.. Please help

Thanks


回答1:


If you're using linux, you can simple open the device file /dev/sdXY and write to it, the MBR will be the first 512 bytes.



来源:https://stackoverflow.com/questions/6371231/how-do-i-read-write-program-the-mbr-vbr-of-a-flash-drive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!