<commit_before>﻿#region

using System;
using System.IO;
using System.Net.Security;
using System.Runtime.InteropServices;
using System.ServiceModel;
using System.Text;
using AgentInterface;
using UlteriusAgent.Networking;

#endregion

namespace UlteriusAgent
{
    internal class Program
    {
        private const int SW_HIDE = 0;
        private const int SW_SHOW = 5;

        [DllImport("user32.dll")]
        private static extern bool SetProcessDPIAware();

        [DllImport("kernel32.dll")]
        private static extern IntPtr GetConsoleWindow();

        [DllImport("user32.dll")]
        private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
     

        private static void Main(string[] args)
        {
           
            if (Environment.OSVersion.Version.Major >= 6)
            {
                SetProcessDPIAware();
            }
            var handle = GetConsoleWindow();

            // Hide
        //   ShowWindow(handle, SW_HIDE);

            Tools.KillAllButMe();
            try
            {
                string address = "net.pipe://localhost/ulterius/Agent";
                ServiceHost serviceHost = new ServiceHost(typeof(ServerAgent));
                NetNamedPipeBinding binding = new NetNamedPipeBinding
                {
                    Security = new NetNamedPipeSecurity
                    {
                        Transport = {ProtectionLevel = ProtectionLevel.EncryptAndSign},
                        Mode = NetNamedPipeSecurityMode.Transport
                    },
                    MaxReceivedMessageSize = int.MaxValue
                };
                serviceHost.AddServiceEndpoint(typeof(ITUlteriusContract), binding, address);
                serviceHost.Open();
                Console.Read();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message + " \n " + ex.StackTrace);
            }
            Console.Read();
        }
    }
}<commit_msg>Hide the Ulterius Agent when its ran.<commit_after>﻿#region

using System;
using System.IO;
using System.Net.Security;
using System.Runtime.InteropServices;
using System.ServiceModel;
using System.Text;
using AgentInterface;
using UlteriusAgent.Networking;

#endregion

namespace UlteriusAgent
{
    internal class Program
    {
        private const int SW_HIDE = 0;
        private const int SW_SHOW = 5;

        [DllImport("user32.dll")]
        private static extern bool SetProcessDPIAware();

        [DllImport("kernel32.dll")]
        private static extern IntPtr GetConsoleWindow();

        [DllImport("user32.dll")]
        private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
     

        private static void Main(string[] args)
        {
           
            if (Environment.OSVersion.Version.Major >= 6)
            {
                SetProcessDPIAware();
            }
            var handle = GetConsoleWindow();

            // Hide
           ShowWindow(handle, SW_HIDE);

            Tools.KillAllButMe();
            try
            {
                string address = "net.pipe://localhost/ulterius/Agent";
                ServiceHost serviceHost = new ServiceHost(typeof(ServerAgent));
                NetNamedPipeBinding binding = new NetNamedPipeBinding
                {
                    Security = new NetNamedPipeSecurity
                    {
                        Transport = {ProtectionLevel = ProtectionLevel.EncryptAndSign},
                        Mode = NetNamedPipeSecurityMode.Transport
                    },
                    MaxReceivedMessageSize = int.MaxValue
                };
                serviceHost.AddServiceEndpoint(typeof(ITUlteriusContract), binding, address);
                serviceHost.Open();
                Console.Read();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message + " \n " + ex.StackTrace);
            }
            Console.Read();
        }
    }
}
{'fraction_non_alphanumeric': 0.08320764203117144, 'fraction_numerical': 0.004524886877828055, 'mean_word_length': 1.6316137566137565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2452482', 'n_tokens_mistral': 1031, 'n_tokens_neox': 957, 'n_words': 214}