Dual-mode entry point. Handles service initialization, scheduled task creation, and IPC command dispatch.
Named Pipe server. Accepts connections from the UI, parses commands, and dispatches to the appropriate handler.
Low-level keyboard hook (WH_KEYBOARD_LL). Intercepts key presses and enforces keyboard blocking. Includes bypass mechanism via hash verification.
Window monitoring via EnumWindows. Scans window titles against the keyword blocklist. Runs on a timer in the user's interactive session.
Hosts file manipulation for website blocking. Reads/writes C:\Windows\System32\drivers\etc\hosts. Flushes DNS cache via DnsFlushResolverCache (dynamically loaded from dnsapi.dll).
Manages all punishment executions:
- Cut Internet — Disables network interfaces via
netshfor 60 seconds - Screen Freeze — Creates a transparent overlay window
- Keyboard Freeze — Blocks all keyboard input
- Hardware Beep — Uses
Beep()API - Flash — Semi-transparent overlay (
WS_EX_LAYERED, alpha 25) - Drunk Mouse — Randomizes mouse movement
- Auto Apology — Opens apology text in Notepad
SHA-256 hashing utilities for password verification and bypass hash generation.
Elevation: Requires Administrator privileges (requireAdministrator manifest) for named pipe access to the engine.
Main application window with tabs:
- Blocklist — Add/remove websites, applications, keywords
- Settings — Toggle punishments, configure passwords
- Pledge — Set/confirm compliance pledge
- About — Version info and links
- PipeClient.cs — Named Pipe client for engine communication (elevated context required)
- UninstallService.cs — Uninstallation orchestration (stops engine, removes task, cleans files)
- HostsManager.cs — Hosts file backup/restore
- AutoStartService.cs — Scheduled task management
- UninstallDialog.xaml — Dark-themed progress dialog with Cancel/Minimize
- AboutDialog.xaml — Version and credits info