Write MBR Code

前端 未结 11 2018
攒了一身酷
攒了一身酷 2021-02-01 08:20

I am an electrical engineer who has recently discovered the need to modify the code in the MBR. Basically I need the ability to execute code on the HDD before, the OS starts up

11条回答
  •  再見小時候
    2021-02-01 09:18

    Basically I figure I'll insert a call and leave the rest of the MBR alone

    What will be called by this subroutine call? The only code in memory at that point is whatever is in the MBR or ROM.

    Please think carefully about whether you really need this or that's there's not a better alternative before you spend too much time on it. Third-party code written to an MBR (other than the MBR that the OS loader puts in there) is often not well received by users because:

    • antivirus programs often flag it as suspicious code, because it's a technique viruses have used to gain control of machines
    • programs have used the technique of inserting themselves into an MBR and storing additional code and data in 'reserved' sectors of the disc (because there's really not much one can do and store in an MBR). Unfortunately, since there's no good, standard way to actually reserve those sectors, this technique (sometimes used for copy protection) can cause corruption of data structures on the disk (ie., all data on the drive goes bye-bye). Users really hate that. I believe at one point Quicken used a protection scheme that did something like this and faced a pretty big backlash.

    So if you do decide to continue on this path, please tread carefully and be prepared for headaches.

提交回复
热议问题