D
DioProcess

ESP Management

EFI

Install, remove, and manage the DioProcess EFI driver on the EFI System Partition.

Boot Modification Warning

Modifying the ESP can render your system unbootable. Always have recovery media ready before making changes. Test on VMs first.

Overview

The EFI System Partition (ESP) contains all UEFI boot files. DioProcess installs its EFI driver to the ESP and creates a boot entry that loads before Windows.

Installation Location

EFI System Partition (typically S: when mounted)
└── EFI/
    ├── Microsoft/
    │   └── Boot/
    │       └── bootmgfw.efi  (Windows Boot Manager)
    └── DioProcess/
        └── DioProcessEfi.efi  (DioProcess bootkit)

Installation Process

  1. Mount ESP — Uses mountvol /s to mount ESP to a temporary drive letter
  2. Copy EFI driver — Copies DioProcessEfi.efi to ESP:\EFI\DioProcess\
  3. Create boot entry — Uses bcdedit to copy Windows Boot Manager entry
  4. Set path — Points the new entry to DioProcess EFI driver
  5. Set as default — Optionally sets DioProcess as the default boot entry
  6. Unmount ESP — Cleans up the temporary mount

Rust API

crates/uefi/src/esp.rs
use crate::UefiError;
use std::process::Command;

/// Install EFI driver to ESP
pub fn install_efi_driver(efi_path: &str) -> Result<(), UefiError> {
    // 1. Mount ESP
    let esp_drive = mount_esp()?;
    
    // 2. Create directory
    let dest_dir = format!("{}\\EFI\\DioProcess", esp_drive);
    std::fs::create_dir_all(&dest_dir)?;
    
    // 3. Copy EFI file
    let dest_path = format!("{}\\DioProcessEfi.efi", dest_dir);
    std::fs::copy(efi_path, &dest_path)?;
    
    // 4. Create boot entry (copy from bootmgr)
    let output = Command::new("bcdedit")
        .args(["/copy", "{bootmgr}", "/d", "DioProcess"])
        .output()?;
    
    // Parse GUID from output
    let guid = parse_guid_from_bcdedit(&output.stdout)?;
    
    // 5. Set the path to our EFI driver
    Command::new("bcdedit")
        .args(["/set", &guid, "path", "\\EFI\\DioProcess\\DioProcessEfi.efi"])
        .output()?;
    
    // 6. Unmount ESP
    unmount_esp(&esp_drive)?;
    
    Ok(())
}

/// Remove EFI driver from ESP
pub fn remove_efi_driver() -> Result<(), UefiError> {
    // 1. Mount ESP
    let esp_drive = mount_esp()?;
    
    // 2. Remove EFI file
    let efi_path = format!("{}\\EFI\\DioProcess\\DioProcessEfi.efi", esp_drive);
    std::fs::remove_file(&efi_path).ok();
    std::fs::remove_dir(format!("{}\\EFI\\DioProcess", esp_drive)).ok();
    
    // 3. Remove boot entry
    let entries = list_boot_entries()?;
    for entry in entries {
        if entry.description == "DioProcess" {
            Command::new("bcdedit")
                .args(["/delete", &entry.guid])
                .output()?;
        }
    }
    
    // 4. Unmount ESP
    unmount_esp(&esp_drive)?;
    
    Ok(())
}

fn mount_esp() -> Result<String, UefiError> {
    // mountvol /s assigns the ESP to the next available drive letter
    Command::new("mountvol")
        .args(["S:", "/s"])
        .output()?;
    Ok("S:".to_string())
}

fn unmount_esp(drive: &str) -> Result<(), UefiError> {
    Command::new("mountvol")
        .args([drive, "/d"])
        .output()?;
    Ok(())
}

Boot Order

After installation, the boot order becomes:

  1. DioProcess EFI driver loads
  2. Driver hooks ExitBootServices
  3. Driver reads NVRAM configuration
  4. Driver applies patches (DSE/KPP bypass)
  5. Driver chainloads Windows Boot Manager
  6. Windows continues normal boot

UI Access

EFI driver installation is managed from the title bar:

  • Install EFI button — Downloads from GitHub (or browse local with -debug flag)
  • Uninstall EFI button — Removes driver and boot entry
  • Status indicator — Shows if EFI driver is currently installed

Manual Installation

For manual installation from an elevated command prompt:

:: Mount ESP
mountvol S: /s

:: Create directory
mkdir S:\EFI\DioProcess

:: Copy EFI driver
copy DioProcessEfi.efi S:\EFI\DioProcess\

:: Create boot entry
bcdedit /copy {bootmgr} /d "DioProcess"
:: Note the GUID that is output, e.g., {12345678-...}

:: Set the path
bcdedit /set {12345678-...} path \EFI\DioProcess\DioProcessEfi.efi

:: (Optional) Set as default
bcdedit /default {12345678-...}

:: Unmount ESP
mountvol S: /d

Manual Removal

:: List current boot entries
bcdedit /enum firmware

:: Find the DioProcess entry GUID and delete it
bcdedit /delete {12345678-...}

:: Mount ESP and remove files
mountvol S: /s
rmdir /s /q S:\EFI\DioProcess
mountvol S: /d

Recovery

If the system fails to boot after installing the EFI driver:

  1. Boot from Windows installation media or recovery drive
  2. Select "Repair your computer" → Command Prompt
  3. Run: bcdedit /delete {dioprocess-guid}
  4. Remove EFI files: rd /s /q S:\EFI\DioProcess
  5. Reboot normally

Testing with QEMU

Test the EFI driver in a VM before installing on real hardware:

# Use the provided QEMU script
cd efi\tools
.\Run-Qemu.ps1 -EfiPath ..\..\DioProcessEfi.efi

# Or manually:
qemu-system-x86_64 -bios OVMF.fd -hda win10.qcow2 \
    -drive file=fat:rw:esp/,format=raw,media=disk