# SETEA DRIVER
Driver that allows to set Extended Attributes including Kernel Extended Attributes.

## PROJECT STRUCTURE
### \drv
Code for kernel driver
### \lib
Code for user-space library to install driver and interact with it
### \cmd
Code for test utility that can query and set EA incl KEA (with the driver)
### \proj 
Files required to build project with MSVC

## BUILD
### Prerequisites
- Microsoft Visual Studio 2019
- Download Windows 11 SDK (22000.1)
- Download WDK for Windows 11 10.0.22000.1
### Build
- Open `\proj\SetEA.sln` with MS Visual Studio 2019. 
- Build solution
- Default output directory is `\proj\x64\<Debug|Release>`
- Only files with extensions: `.sys`, `.exe`, `.dll` are necessary
- `.cer` file contains a self-issued test certificate used to sign the driver
- `.pdb` files contains debugging information for project that might be helpful in event of app or system crash

## INSTALL
- Copy driver files to target machine
- Run `cmd.exe` as admin. Run `bcdedit /testsigning on` to bring machine to Test Mode (Note: Secure Boot must be off)
- Reboot
- Install the driver by running `SetEA.exe -i <full sys file path>`, e.g. `SetEA.exe -i C:\driver\seteadrv.sys`

## USAGE
- Read EA of file, e.g. `SetEA.exe -q C:\windows\system32\kernel32.dll`
- Save EA of file, e.g. `SetEA.exe -q C:\windows\system32\kernel32.dll > k.txt`
- Create a copy of file `copy C:\windows\system32\kernel32.dll .\kernel32.dll`
- Check copy doesn't preserve KEA by `SetEA.exe -q C:\windows\system32\kernel32.dll`
- Load driver `SetEA.exe -l`
- Set EA with the driver `SetEA.exe -s C:\windows\system32\kernel32.dll k.txt`

## UNINSTALL
- Unload driver `SetEA.exe -p`
- Uninstall the driver  `SetEA.exe -u`
- Delete driver files 
- Run `cmd.exe` as admin. Run `bcdedit /testsigning off` to switch Test Mode off
- Reboot