Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Windows hangs and crashes when removing the boot device

DymOK93DymOK93 Member Posts: 3

Hi developers!
Now I am doing a project on operating systems and computer security for a my university.
One of the tasks is to place the Windows EFI bootloader on a USB flash drive (not on the main hard drive!);
I hoped that it would be enough to copy the contents of the hidden EFI partition to a USB flash drive, but I ran into unexpected difficulties.
Windows boots fine, yes.
But if I remove the bootable USB flash drive after logging in, three scenarios are possible (on different physical machines the system behaves differently, on virtual machines it also behaves differently. I suppose it depends on the physical USB controller):
1. System immediately crashes wint bsod SYSTEM_THREAD_EXCEPTION_NOT_HANDLED
2. System hangs (doesn't respond to any user input, but responds in the debugger), after 1 minute crashes with bsod INACCESSIBLE_BOOT_DEVICE (without memory dumping!)
3. Everything continues to work fine (Hehe, my personal computer turned out to be a unique device - this behavior appeared only on it)

Having looked at the dump, I found out that in case 1 an access violation occurs due to dereferencing nullpointer in the function and ExNotifyBootDeviceRemoval
In case 2, the problem manifested itself in ExpWaitForBootDevice.

I tried to examine the situation in the debugger, but I didn't achieve significant results.
Which direction should I go?
Has anyone come across a similar one?

Memory dump (for case 1) on GoogleDrive: https://drive.google.com/drive/folders/1Ewd96Gr6wYRPGIfXxKDlYvmjRwQchJr_?usp=sharing

Thank you in advance!

Comments

  • DymOK93DymOK93 Member Posts: 3

    When I took out the USB stick before logging in, the OS was working fine. But after I reinserted the USB stick and pulled it out, everything repeats (1, 2, 3)

  • ThatsBerkanThatsBerkan Member Posts: 17
    edited November 18

    The BCD file is used by the system, so it has to exist. If you remove the flash drive, the system wont be able to access the BCD file anymore.

    Why kind of university asks you to copy the EFI partition to another drive anyway ? This feels like malware related. Most likely trying to boot other computers with a patched bootloader from a flash drive without having to keep it plugged in, stealthly.

    Everything continues to work fine (Hehe, my personal computer turned out to be a unique device - this behavior appeared only on it)

    I bet my life your personal computer is a laptop. Laptop manufacturers usually cache everything in the ram to boot faster. So those files are not really read from disk, they are in memory.

  • DymOK93DymOK93 Member Posts: 3
    edited November 18

    @ThatsBerkan said:
    Why kind of university asks you to copy the EFI partition to another drive anyway ? This feels like malware related. Most likely trying to boot other computers with a patched bootloader from a flash drive without having to keep it plugged in, stealthly.

    No, this is a VeraCrypt encrypted partition with OS.

    @ThatsBerkan said:
    I bet my life your personal computer is a laptop. Laptop manufacturers usually cache everything in the ram to boot faster. So those files are not really read from disk, they are in memory.

    No. Case 2 happens on my laptop (not PC).

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Writing WDF Drivers 7 Dec 2020 LIVE ONLINE
Internals & Software Drivers 25 Jan 2021 LIVE ONLINE
Developing Minifilters 8 March 2021 LIVE ONLINE