How itousouta15/pyas works
Project Type and Purpose
• PYAS is a Windows desktop antivirus application.
• It combines a GUI frontend (PyQt5), a scanning engine (deep-learning + YARA rules), a kernel-mode protection driver, and auxiliary repair/tools scripts.
File Structure
• Top-level folders:
• Driver/ – kernel driver (.sys), installer/uninstaller scripts, digital signing tool, Microsoft VC redistributable.
• Engine/ – deep learning models (ONNX), YARA rule files (.yar/.ips).
• Extens/ – system-repair scripts and auxiliary tools.
• Top-level Python modules:
• PYAS.py – main application logic + GUI integration + protection hooks
• PYAS_Engine.py – scanning logic (loads ONNX model, runs YARA scans)
• PYAS_Interface.py – Qt Designer UI definitions
• PYAS_Language.py – i18n (EN, ZH-CN, ZH-TW)
• PYAS_Suffixes.py – file-suffix lists for scanning
• PYAS_Version.py – versioning and metadata
README for Additional Insights
• Confirms Windows-only support, Python dependencies (PyQt5, ONNXRuntime, yara-python, etc.), and external runtime requirements (VC_redist).
• No external online service, but “requests” is installed—likely for updates or signature downloads.
Main Architectural Components
a. Presentation Layer (GUI)
• PyQt5 application (PYAS.py + PYAS_Interface.py + language & resource modules)
b. Application Logic
• PYAS.py orchestrates user actions, feeds file paths to engine, triggers driver protection calls
c. Scanning Engine
• Deep-learning model loader (ONNX via onnxruntime)
• YARA rule matcher (yara-python)
• pefile for PE parsing, numpy, pillow for file handling, pyperclip for clipboard integration
d. Protection Driver
• PYAS_Driver.sys loaded/unloaded via batch scripts
• Communicates with user-mode via IOCTLs (implied)
e. Extensions
• Repair scripts (regedit, batch) and auxiliary tools invoked from within UI or standalone
Interactions and Data Flows
1. User clicks “Scan” in UI →
2. Main app (PYAS.py) calls scanning API in PYAS_Engine.py →
3. Engine loads model (PYAS_Model_A1.onnx) and rules (PYAS_Rules_A1.yar) →
4. Engine returns verdicts →
6. If “Real-time Protection” is enabled, PYAS.py sends control codes to kernel driver →
7. Driver intercepts file operations at the kernel level to enforce blocking/quarantine.
8. Repair/Tools: accessed via menu, launch Extens/Repair/*.bat or Extens/Tools/*.txt
Architectural Patterns & Design Principles
• Layered architecture: Presentation → Application → Engine → System (driver)
• Modular separation: UI, engine, data (models/rules), system hooks
• Pluggable rules/models: Easy to swap ONNX or YARA files without code changes