# techzy-programmer/spyied architecture

> Architecture diagram of the GitHub repository techzy-programmer/spyied, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/techzy-programmer/spyied
- Repository: https://github.com/techzy-programmer/spyied

## Overview

Key Components to Include in the System Design:

##### Controller Application (C# WPF Application)
- Main Components:
- UI Layer (Views)
- ViewModels (MVVM Pattern)
- Services Layer
- Models
- Helpers

##### Payload Application (Go-based Client)
- Main Components:
- Network Communications
- Activity Monitoring
- Screen Capture Service
- System Information Collection

##### High-Level Architecture

- Controller   | <----> |    Payload    |
- (C# WPF App)  |        | (Go Client)   |

##### Controller Details
- Controller (WPF)

- Views                                 |

- Dashboard     |                   |
- ScreenShare   |                   |
- Settings      |                   |

- ViewModels (MVVM)                    |

- Corresponding |                   |
- ViewModels    |                   |

- Services                             |

- TCP Service   |                   |
- UDP Service   |                   |
- Page Service  |                   |

##### Payload Details
Structure the Payload component:
- Payload (Go Client)

- Activities                            |

- Network        |                  |
- Screen Stream  |                  |
- Update        |                  |

- Network                              |

- TCP Client     |                  |
- UDP Client     |                  |

- Services                             |

- Screen Service |                  |

##### Communication Flows
- TCP communication between Controller and Payload
- UDP communication for screen sharing
- Data flow between internal components

- Blue: UI Components
- Green: Network Services
- Yellow: Business Logic/Services
- Gray: Helper/Utility Components

Important Elements to Highlight:
##### Dual Communication Protocols
- TCP for reliable command and control
- UDP for screen sharing (likely chosen for performance)

##### MVVM Architecture in Controller
- Clear separation of Views, ViewModels, and Models
- Service layer for business logic

##### Modular Structure in Payload
- Activity-based organization
- Separate network handling
- Dedicated screen capture service

Additional Considerations:

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Controller["Controller Application (C# WPF)"]
        direction TB
        UI["UI Layer"]
        VM["ViewModels Layer"]
        SL["Services Layer"]
        ML["Models Layer"]
        
        subgraph UIComponents["Views"]
            direction TB
            DV["Dashboard View"]
            SV["Screen Share View"]
            SetV["Settings View"]
            MW["Main Window"]
        end
        
        subgraph ViewModels["ViewModels"]
            direction TB
            MVM["Main Window ViewModel"]
            PVM["Page ViewModels"]
        end
        
        subgraph Services["Services"]
            direction TB
            TCP["TCP Service"]
            UDP["UDP Service"]
            PS["Page Service"]
        end
        
        subgraph Models["Models"]
            direction TB
            TM["TCP Messages"]
            UM["UDP Messages"]
            AC["App Config"]
            VS["Target System"]
        end
        
        UI --> UIComponents
        UIComponents --> ViewModels
        ViewModels --> Services
        Services --> Models
    end
    
    subgraph Payload["Payload Application (Go)"]
        direction TB
        
        subgraph Network["Network Layer"]
            direction TB
            TC["TCP Client"]
            UC["UDP Client"]
            MD["Message Definitions"]
        end
        
        subgraph Activities["Activities"]
            direction TB
            NA["Network Activity"]
            SS["Screen Stream"]
            UA["Update Activity"]
        end
        
        subgraph ScreenService["Screen Services"]
            direction TB
            MS["Main Service"]
            HF["Helper Functions"]
            DS["Data Structures"]
        end
        
        subgraph SystemInfo["System Information"]
            direction TB
            SI["System Info Utils"]
            GC["Global Constants"]
        end
        
        Network --> Activities
        Activities --> ScreenService
        Activities --> SystemInfo
    end
    
    Controller <--> |TCP/UDP Communication| Payload
    
    %% Click events for component mapping
    click DV "https://github.com/Techzy-Programmer/Spyied/blob/main/Controller/Views/Pages/DashboardPage.xaml"
    click SV "https://github.com/Techzy-Programmer/Spyied/blob/main/Controller/Views/Pages/ScreenSharePage.xaml"
    click SetV "https://github.com/Techzy-Programmer/Spyied/blob/main/Controller/Views/Pages/SettingsPage.xaml"
    click MW "https://github.com/Techzy-Programmer/Spyied/blob/main/Controller/Views/Windows/MainWindow.xaml"
    click MVM "https://github.com/Techzy-Programmer/Spyied/blob/main/Controller/ViewModels/Windows/MainWindowViewModel.cs"
    click PVM "https://github.com/Techzy-Programmer/Spyied/tree/main/Controller/ViewModels/Pages"
    click TCP "https://github.com/Techzy-Programmer/Spyied/blob/main/Controller/Services/TCPService.cs"
    click UDP "https://github.com/Techzy-Programmer/Spyied/blob/main/Controller/Services/UDPService.cs"
    click PS "https://github.com/Techzy-Programmer/Spyied/blob/main/Controller/Services/PageService.cs"
    click TM "https://github.com/Techzy-Programmer/Spyied/blob/main/Controller/Models/TCPMsg.cs"
    click UM "https://github.com/Techzy-Programmer/Spyied/blob/main/Controller/Models/UDPMsg.cs"
    click AC "https://github.com/Techzy-Programmer/Spyied/blob/main/Controller/Models/AppConfig.cs"
    click VS "https://github.com/Techzy-Programmer/Spyied/blob/main/Controller/Models/Victim.cs"
    click TC "https://github.com/Techzy-Programmer/Spyied/blob/main/Payload/network/tcp_client.go"
    click UC "https://github.com/Techzy-Programmer/Spyied/blob/main/Payload/network/udp_client.go"
    click MD "https://github.com/Techzy-Programmer/Spyied/blob/main/Payload/network/tcp_msgs.go"
    click NA "https://github.com/Techzy-Programmer/Spyied/blob/main/Payload/activity/network.go"
    click SS "https://github.com/Techzy-Programmer/Spyied/blob/main/Payload/activity/screen_stream.go"
    click UA "https://github.com/Techzy-Programmer/Spyied/blob/main/Payload/activity/update.go"
    click MS "https://github.com/Techzy-Programmer/Spyied/blob/main/Payload/service/screen/streaming.go"
    click HF "https://github.com/Techzy-Programmer/Spyied/blob/main/Payload/service/screen/helpers.go"
    click DS "https://github.com/Techzy-Programmer/Spyied/blob/main/Payload/service/screen/structs.go"
    click SI "https://github.com/Techzy-Programmer/Spyied/blob/main/Payload/helpers/utils/system_info.go"
    click GC "https://github.com/Techzy-Programmer/Spyied/blob/main/Payload/helpers/vars/global_const.go"
    
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px
    classDef controller fill:#e1f5fe,stroke:#01579b
    classDef payload fill:#f3e5f5,stroke:#4a148c
    classDef network fill:#e8f5e9,stroke:#1b5e20
    classDef service fill:#fff3e0,stroke:#e65100
    
    class Controller controller
    class Payload payload
    class Network,TC,UC,MD network
    class Services,ScreenService service
```
