D
DioProcess

API Reference

C/C++

Complete documentation of all 80+ DioProcess SDK methods organized by category.

DioProcessSDK Class

Main SDK class that wraps driver communication.

class DioProcessSDK {
public:
    DioProcessSDK();
    ~DioProcessSDK();
    
    BOOL Open();
    void Close();
    BOOL IsOpen() const;
    
    // 80+ methods organized by category below
};

Connection Methods

MethodReturnsDescription
Open()BOOLOpen handle to \\.\DioProcess driver
Close()voidClose driver handle
IsOpen()BOOLCheck if driver handle is valid

Collection Control Methods

Control kernel callback event collection.

MethodReturnsDescription
StartCollection()BOOLStart collecting callback events
StopCollection()BOOLStop callback event collection
GetCollectionState()BOOLQuery whether collection is active
RegisterCallbacks()BOOLRegister kernel callbacks (Ps, Ob, Cm)
UnregisterCallbacks()BOOLUnregister all kernel callbacks

Process Protection Methods

Manipulate kernel-level process protection (PPL/PS_PROTECTION).

MethodReturnsDescription
ProtectProcess(ULONG pid)BOOLApply PPL protection to process (WinTcb signer)
UnprotectProcess(ULONG pid)BOOLRemove PPL protection from process
ProtectProcessEx(ULONG pid, ProcessProtectionLevel level)BOOLApply specific protection level (None/Light/Full)
EnableAllPrivileges(ULONG pid)BOOLEnable all 40 token privileges (SeDebugPrivilege, etc.)
ClearDebugFlags(ULONG pid)BOOLClear anti-debug flags (DebugPort, BeingDebugged, NtGlobalFlag)

Callback Enumeration Methods

Enumerate registered kernel callbacks from various subsystems.

MethodOutput Structure
EnumProcessCallbacks(buf, size, &returned)CallbackInformation[]
EnumThreadCallbacks(buf, size, &returned)CallbackInformation[]
EnumImageCallbacks(buf, size, &returned)CallbackInformation[]
EnumObjectCallbacks(buf, size, &returned)ObjectCallbackInformation[]
EnumRegistryCallbacks(buf, size, &returned)RegistryCallbackInformation[]
EnumMinifilters(buf, size, &returned)MinifilterInformation[]

All enumeration methods return ULONG count at buffer start, followed by array of structures.

Callback Removal Methods

Remove (NOP out) kernel callbacks by index.

MethodReturnsDescription
RemoveProcessCallback(ULONG index)BOOLRemove process callback by index
RemoveThreadCallback(ULONG index)BOOLRemove thread callback by index
RemoveImageCallback(ULONG index)BOOLRemove image load callback by index
RemoveObjectCallback(ULONG index)BOOLRemove object callback (ObRegisterCallbacks)
RemoveRegistryCallback(ULONG index)BOOLRemove registry callback by index
UnlinkMinifilter(LPCWSTR name)BOOLUnlink minifilter callbacks by name

Callback Restore Methods

Restore previously removed kernel callbacks.

MethodReturnsDescription
RestoreProcessCallback(ULONG index)BOOLRestore removed process callback
RestoreThreadCallback(ULONG index)BOOLRestore removed thread callback
RestoreImageCallback(ULONG index)BOOLRestore removed image callback
RestoreObjectCallback(ULONG index)BOOLRestore removed object callback
RestoreRegistryCallback(ULONG index)BOOLRestore removed registry callback

Hypervisor Control Methods

Control the Ring -1 hypervisor.

MethodReturnsDescription
HvStart()BOOLStart the hypervisor (virtualize OS)
HvStop()BOOLStop the hypervisor
HvPing(HvPingResponse*)BOOLGet hypervisor status and hook count
HvProtectProcess(ULONG pid)BOOLHide process via hypervisor EPT
HvUnprotectProcess(ULONG pid)BOOLUnhide process from EPT
HvHideDriver(LPCWSTR name)BOOLHide driver from enumeration
HvUnhideDriver(LPCWSTR name)BOOLUnhide driver
HvInjectShellcode(pid, buf, size)BOOLRing -1 shellcode injection via EPT
HvInjectDll(pid, path)BOOLRing -1 DLL injection via EPT
HvInstallHooks()BOOLInstall all EPT hooks
HvRemoveHooks()BOOLRemove all EPT hooks

HV Memory Methods

Read/write memory via hypervisor EPT.

MethodReturnsDescription
HvReadVm(ULONG pid, ULONG64 addr, buf, size)BOOLRead virtual memory via hypervisor
HvWriteVm(ULONG pid, ULONG64 addr, buf, size)BOOLWrite virtual memory via hypervisor

DKOM Hiding Methods

Hide processes via Direct Kernel Object Manipulation.

MethodReturnsDescription
HideProcess(ULONG pid)BOOLUnlink process from ActiveProcessLinks
UnhideProcess(ULONG pid)BOOLRelink process to list
EnumHiddenProcesses(buf, size, &count)BOOLList currently hidden processes

File Hiding Methods

Hide files from directory enumeration.

MethodReturnsDescription
HideFile(LPCWSTR path)BOOLHide file from directory listing
UnhideFile(LPCWSTR path)BOOLUnhide file
EnumHiddenFiles(buf, size, &count)BOOLList currently hidden files

Port Hiding Methods

Hide TCP/UDP ports from network enumeration.

MethodReturnsDescription
HidePort(USHORT port, UCHAR proto)BOOLHide TCP(6) or UDP(17) port
UnhidePort(USHORT port, UCHAR proto)BOOLUnhide port
EnumHiddenPorts(buf, size, &count)BOOLList currently hidden ports

Memory Hiding Methods

Hide memory regions from process enumeration.

MethodReturnsDescription
HideMemory(ULONG pid, ULONG64 addr, ULONG size)BOOLHide memory region from VAD enumeration

Kernel Injection Methods

Inject code from Ring 0 via RtlCreateUserThread.

MethodReturnsDescription
KernelInjectShellcode(req*, resp*)BOOLRing 0 shellcode injection
KernelInjectDll(req*, resp*)BOOLRing 0 DLL injection via LoadLibraryW
KernelManualMap(req*, resp*)BOOLRing 0 manual mapping (no IAT)

Early Injection Methods

Inject DLLs at process creation before user code runs.

MethodReturnsDescription
EarlyInjectArm(target, dllPath, oneShot)BOOLArm injection for target process name
EarlyInjectDisarm()BOOLDisarm early injection
EarlyInjectStatus(EarlyInjectStatusResponse*)BOOLGet injection state and count

Physical Memory Methods

Direct physical memory access via MmCopyMemory.

MethodReturnsDescription
TranslateVa(pid, virtAddr, TranslateVaResp*)BOOLWalk CR3 page tables VA → PA
ReadPhysical(physAddr, buf, size)BOOLRead from physical address
WritePhysical(physAddr, buf, size)BOOLWrite to physical address
PhysReadVm(pid, virtAddr, buf, size)BOOLRead via translate + physical read

VM Region Methods

Enumerate virtual memory regions.

MethodReturnsDescription
EnumVmRegions(pid, buf, size, &count)BOOLList VM regions via VAD tree walk

EPT Hook Methods

Install invisible execute-page hooks via Extended Page Tables.

MethodReturnsDescription
EptHookInstall(pid, addr, patch, size, &idx)BOOLInstall EPT hook with patch bytes
EptHookRemove(ULONG hookIndex)BOOLRemove EPT hook by index
EptHookList(buf, size, &count)BOOLList all active EPT hooks

Register Change Methods

Monitor and modify registers at specific addresses.

MethodReturnsDescription
RegChangeInstall(pid, addr, reg, op, val, &idx)BOOLInstall register change hook
RegChangeRemove(ULONG hookIndex)BOOLRemove register change by index
RegChangeRemoveAll()BOOLRemove all register changes
RegChangeList(buf, size, &count)BOOLList all register changes

Process Kill Methods

Various methods to terminate protected processes.

MethodReturnsDescription
KillProcessTerminate(ULONG pid)BOOLTerminate via ZwTerminateProcess
KillProcessUnmap(ULONG pid)BOOLUnmap main module sections
KillProcessPebCorrupt(ULONG pid)BOOLCorrupt PEB to crash process

Thread Control Methods

Suspend, resume, and terminate threads.

MethodReturnsDescription
SuspendProcess(ULONG pid)BOOLSuspend all threads in process
ResumeProcess(ULONG pid)BOOLResume all threads in process
SuspendThread(ULONG tid)BOOLSuspend single thread
ResumeThread(ULONG tid)BOOLResume single thread
TerminateThread(ULONG tid)BOOLTerminate thread via ZwTerminateThread

System Thread Enumeration

Enumerate kernel-mode system threads.

MethodReturnsDescription
EnumSystemThreads(buf, size, &count)BOOLList system threads (PID 4)
EnumAllKernelThreads(buf, size, &count)BOOLList all kernel-mode threads

Packet Capture Methods

Network packet capture via NDIS filter driver.

MethodReturnsDescription
PacketStartCapture(interfaceIdx)BOOLStart capturing on interface
PacketStopCapture()BOOLStop packet capture
PacketGetPackets(buf, size, &count)BOOLRetrieve captured packets
PacketAddFilter(filterRule)BOOLAdd BPF-style packet filter
PacketRemoveFilter(filterId)BOOLRemove packet filter
PacketClearFilters()BOOLClear all packet filters
PacketGetStats(PacketCaptureStats*)BOOLGet capture statistics
PacketEnumInterfaces(buf, size, &count)BOOLList available network interfaces

Memory Copy Methods

Read process memory via MmCopyVirtualMemory.

MethodReturnsDescription
CopyMemory(pid, srcAddr, dstBuf, size)BOOLCopy memory from target process (KsDumper-style)

Configuration Methods

Configure driver offsets for different Windows versions.

MethodReturnsDescription
SetRegistryCallbackOffsets(cookie, context)BOOLSet CM_CALLBACK offsets
SetEthreadOffsets(startAddr, win32Start)BOOLSet ETHREAD field offsets
SetThreadApiAddresses(suspend, resume, term)BOOLSet thread API function addresses

Key Structures

// Callback information (process, thread, image)
struct CallbackInformation {
    ULONG Index;                                // Callback slot index
    ULONG64 CallbackAddress;                    // Kernel address
    CHAR ModuleName[MAX_MODULE_NAME_LENGTH];    // Driver name
};

// Object callback (ObRegisterCallbacks)
struct ObjectCallbackInformation {
    CHAR ModuleName[MAX_MODULE_NAME_LENGTH];
    CHAR Altitude[MAX_ALTITUDE_LENGTH];
    ObjectCallbackType ObjectType;
    ObjectCallbackOperations Operations;
    ULONG64 PreOperationCallback;
    ULONG64 PostOperationCallback;
    ULONG Index;
};

// CID table entry
struct CidTableEntry {
    ULONG Id;                                   // PID or TID
    ULONG64 ObjectAddress;                      // EPROCESS or ETHREAD
    CidObjectType ObjectType;                   // Process or Thread
    ULONG ParentPid;                            // Parent/owner PID
    CHAR ProcessName[MAX_PROCESS_NAME_LENGTH];  // Image file name
};

// Hypervisor ping response
struct HvPingResponse {
    BOOLEAN IsRunning;
    BOOLEAN HooksInstalled;
    ULONG ProtectedProcessCount;
    ULONG HiddenDriverCount;
};

// Physical memory translation
struct TranslateVaResponse {
    ULONG64 PhysicalAddress;
    ULONG PageSize;
    BOOLEAN Valid;
};

// EPT hook info
struct EptHookInfo {
    ULONG ProcessId;
    ULONG64 TargetAddress;
    ULONG PatchSize;
    ULONG HookIndex;
    BOOLEAN Active;
};

// Register change info
struct RegisterChangeInfo {
    ULONG ProcessId;
    ULONG64 Address;
    RegisterType Register;
    ChangeOperation Operation;
    ULONG64 Value;
    ULONG HookIndex;
    BOOLEAN Active;
};

// Hidden port info
struct HiddenPortInfo {
    USHORT Port;
    UCHAR Protocol;      // 6 = TCP, 17 = UDP
    ULONG Index;
};

// Packet capture entry
struct PacketEntry {
    ULONG64 Timestamp;
    ULONG Length;
    UCHAR Direction;     // 0 = inbound, 1 = outbound
    BYTE Data[MAX_PACKET_SIZE];
};

// Kernel inject request/response
struct KernelInjectShellcodeRequest {
    ULONG ProcessId;
    ULONG ShellcodeSize;
    BYTE Shellcode[4096];
};

struct KernelInjectResponse {
    ULONG64 ShellcodeAddress;
    ULONG64 ModuleBase;
    ULONG64 ThreadHandle;
    BOOLEAN Success;
};

// Early injection status
struct EarlyInjectStatusResponse {
    BOOLEAN Armed;
    WCHAR TargetProcess[MAX_PATH];
    WCHAR DllPath[MAX_PATH];
    BOOLEAN OneShot;
    ULONG InjectionCount;
    ULONG LastInjectedPid;
};

IOCTL Codes

Direct IOCTL codes for advanced usage (grouped by category):

CodeNameCategory
0x800IOCTL_START_COLLECTIONCollection
0x801IOCTL_STOP_COLLECTIONCollection
0x805IOCTL_PROTECT_PROCESSProtection
0x806IOCTL_UNPROTECT_PROCESSProtection
0x807IOCTL_ENABLE_PRIVILEGESProtection
0x808IOCTL_CLEAR_DEBUG_FLAGSProtection
0x809IOCTL_ENUM_PROCESS_CALLBACKSCallbacks
0x80AIOCTL_ENUM_THREAD_CALLBACKSCallbacks
0x80BIOCTL_ENUM_IMAGE_CALLBACKSCallbacks
0x810IOCTL_REMOVE_CALLBACKCallbacks
0x820IOCTL_HV_STARTHypervisor
0x821IOCTL_HV_STOPHypervisor
0x822IOCTL_HV_PINGHypervisor
0x840IOCTL_HV_INJECT_SHELLCODEHypervisor
0x841IOCTL_HV_INJECT_DLLHypervisor
0x850IOCTL_HIDE_PROCESSHiding
0x860IOCTL_HIDE_FILEHiding
0x870IOCTL_HIDE_PORTHiding
0x880IOCTL_KERNEL_INJECT_SHELLCODEInjection
0x881IOCTL_KERNEL_INJECT_DLLInjection
0x890IOCTL_EARLY_INJECT_ARMInjection
0x8A0IOCTL_TRANSLATE_VAMemory
0x8A1IOCTL_READ_PHYSICALMemory
0x8A2IOCTL_WRITE_PHYSICALMemory
0x8B0IOCTL_EPT_HOOK_INSTALLEPT
0x8B1IOCTL_EPT_HOOK_REMOVEEPT
0x8C0IOCTL_REG_CHANGE_INSTALLEPT
0x900IOCTL_PACKET_START_CAPTURENetwork
0x908IOCTL_KILL_PROCESSControl

Full IOCTL codes available in DioProcessSDK.h (100+ codes).

Error Handling

// All methods return BOOL/bool
if (!sdk.ProtectProcess(pid)) {
    DWORD error = GetLastError();
    
    // Common error codes:
    // ERROR_ACCESS_DENIED (5)     - Not admin
    // ERROR_FILE_NOT_FOUND (2)    - Driver not loaded
    // ERROR_INVALID_PARAMETER (87)- Invalid PID
    // ERROR_NOT_SUPPORTED (50)    - Unsupported Windows version
}