# hfiref0x/dsefix architecture

> Architecture diagram of the GitHub repository hfiref0x/dsefix, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hfiref0x/dsefix
- Repository: https://github.com/hfiref0x/dsefix

## Overview

DSEFix is an x64 Windows utility that attempts to disable Driver Signature Enforcement and can restore its default setting with `-e`. Its documented approach uses a vulnerable VirtualBox kernel driver to modify the version-specific Code Integrity setting. The excerpts show driver loading and IOCTL setup, but omit parts of the command and patch routines; those links are limited to the documented workflow and explicit function responsibilities.

Main entry points: [`Source/DSEFix/main.c`](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/main.c) (Program entry), [`Source/DSEFix/cui/cui.c`](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/cui/cui.c) (Console output), [`Source/DSEFix/vboxdrv.h`](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/vboxdrv.h) (VBox driver image), [`Source/DSEFix/sup.c`](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/sup.c) (Driver file utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command interface"]
  node_entry["Program entry<br/>[main.c]"]
  node_command["Command processing<br/>[main.c]"]
  node_console["Console output<br/>[cui.c]"]
end

subgraph group_driver["Driver access"]
  node_lifecycle["Driver lifecycle<br/>[main.c]"]
  node_embedded["VBox driver image<br/>[vboxdrv.h]"]
  node_driverfile["Driver file utilities<br/>[sup.c]"]
  node_ioctl["VBox IOCTL loader<br/>[main.c]"]
end

subgraph group_patch["Integrity control"]
  node_patch["DSE state patching<br/>[main.c]"]
  node_ci["Code Integrity state"]
end

subgraph group_support["Runtime support"]
  node_decoder["x64 instruction decoder<br/>[hde64.c]"]
  node_systeminfo["System information<br/>[sup.c]"]
  node_ntapi["NT API definitions<br/>[ntos.h]"]
  node_strings["String and argument helpers"]
end

node_user(("Administrator"))
node_windows["Windows SCM and device"]
node_kernel["Windows kernel"]

node_user -->|"runs"| node_entry
node_entry -->|"dispatches"| node_command
node_entry -->|"reports"| node_console
node_command -->|"starts driver"| node_lifecycle
node_lifecycle -->|"uses image"| node_embedded
node_lifecycle -->|"backs up and writes"| node_driverfile
node_lifecycle -->|"manages service"| node_windows
node_lifecycle -->|"opens device"| node_ioctl
node_ioctl -->|"sends requests"| node_windows
node_command -->|"selects operation"| node_patch
node_patch -->|"decodes instructions"| node_decoder
node_patch -->|"accesses memory"| node_kernel
node_kernel -->|"contains setting"| node_ci
node_command -->|"queries system"| node_systeminfo
node_entry -.->|"uses helpers"| node_strings
node_entry -.->|"uses declarations"| node_ntapi

click node_entry "https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/main.c"
click node_command "https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/main.c"
click node_console "https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/cui/cui.c"
click node_lifecycle "https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/main.c"
click node_embedded "https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/vboxdrv.h"
click node_driverfile "https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/sup.c"
click node_ioctl "https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/main.c"
click node_patch "https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/main.c"
click node_decoder "https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/hde/hde64.c"
click node_systeminfo "https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/sup.c"
click node_ntapi "https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/ntdll/ntos.h"
click node_strings "https://github.com/hfiref0x/dsefix/tree/master/Source/DSEFix/minirtl"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_command,node_console toneBlue
class node_lifecycle,node_embedded,node_driverfile,node_ioctl toneAmber
class node_patch,node_ci toneMint
class node_decoder,node_systeminfo,node_ntapi,node_strings toneRose
class node_user,node_windows,node_kernel toneIndigo
```

## Components

### Command interface

- [Program entry](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/main.c): `Source/DSEFix/main.c`
- [Command processing](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/main.c): `Source/DSEFix/main.c`
- [Console output](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/cui/cui.c): `Source/DSEFix/cui/cui.c`

### Driver access

- [Driver lifecycle](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/main.c): `Source/DSEFix/main.c`
- [VBox driver image](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/vboxdrv.h): `Source/DSEFix/vboxdrv.h`
- [Driver file utilities](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/sup.c): `Source/DSEFix/sup.c`
- [VBox IOCTL loader](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/main.c): `Source/DSEFix/main.c`

### Integrity control

- [DSE state patching](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/main.c): `Source/DSEFix/main.c`
- **Code Integrity state**

### Runtime support

- [x64 instruction decoder](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/hde/hde64.c): `Source/DSEFix/hde/hde64.c`
- [System information](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/sup.c): `Source/DSEFix/sup.c`
- [NT API definitions](https://github.com/hfiref0x/dsefix/blob/master/Source/DSEFix/ntdll/ntos.h): `Source/DSEFix/ntdll/ntos.h`
- [String and argument helpers](https://github.com/hfiref0x/dsefix/tree/master/Source/DSEFix/minirtl): `Source/DSEFix/minirtl`

### Other components

- **Administrator**
- **Windows SCM and device**
- **Windows kernel**

## Connections

- Administrator → Program entry: runs
- Program entry → Command processing: dispatches
- Program entry → Console output: reports
- Command processing → Driver lifecycle: starts driver
- Driver lifecycle → VBox driver image: uses image
- Driver lifecycle → Driver file utilities: backs up and writes
- Driver lifecycle → Windows SCM and device: manages service
- Driver lifecycle → VBox IOCTL loader: opens device
- VBox IOCTL loader → Windows SCM and device: sends requests
- Command processing → DSE state patching: selects operation
- DSE state patching → x64 instruction decoder: decodes instructions
- DSE state patching → Windows kernel: accesses memory
- Windows kernel → Code Integrity state: contains setting
- Command processing → System information: queries system
- Program entry → String and argument helpers: uses helpers
- Program entry → NT API definitions: uses declarations
