Пример #1
0
        private static void FindFacturas()
        {
            Hóspede        hóspede = new Hóspede();
            ParqueCampismo parque  = new ParqueCampismo();

            Tuple <int, int> pair;

            Console.Write("NIF: ");
            hóspede.NIF = int.Parse(Console.ReadLine());

            Console.Write("Data Inicio(YYYY-MM-DD): ");
            DateTime dataInicio = Convert.ToDateTime(Console.ReadLine());

            Console.Write("Data Fim(YYYY-MM-DD): ");
            DateTime dataFim = Convert.ToDateTime(Console.ReadLine());

            Console.Write("Nome Parque: ");
            parque.nome = Console.ReadLine();

            using (Context context = new Context(connectionString)) {
                ProcUtils procedimento = new ProcUtils(context);

                pair = procedimento.FindFacturas(hóspede, dataInicio, dataFim, parque);
            }
            Console.WriteLine("Despedas totais do hóspede com NIF: {0} - {1} Euros\n", pair.Item1, pair.Item2);
        }
        private void _updateUIThread_Tick(object sender, EventArgs e)
        {
            UpdateInfoLabels();

            if (!ProcUtils.ProcessIsRunning("csgo"))
            {
                Application.Current.Shutdown();
            }
        }
        protected override DllInjectionResult PerformInjection(System.Diagnostics.Process proc, string dllPath)
        {
            this.DllPath = dllPath;

            ProcUtils = new ProcUtils(proc, WinAPI.ProcessAccessFlags.CreateThread | WinAPI.ProcessAccessFlags.VirtualMemoryOperation | WinAPI.ProcessAccessFlags.VirtualMemoryRead | WinAPI.ProcessAccessFlags.VirtualMemoryWrite | WinAPI.ProcessAccessFlags.QueryInformation);

            MemUtils                    = new MemUtils();
            MemUtils.Handle             = ProcUtils.Handle;
            MemUtils.UseUnsafeReadWrite = true;


            if (ProcUtils.Handle == IntPtr.Zero)
            {
                return(new DllInjectionResult("Could not open process", new Win32Exception(Marshal.GetLastWin32Error())));
            }

            IntPtr lpLLAddress = WinAPI.GetProcAddress(WinAPI.GetModuleHandle("kernel32.dll"), "LoadLibraryA");

            if (lpLLAddress == IntPtr.Zero)
            {
                return(new DllInjectionResult("Could not find address of LoadLibraryA", new Win32Exception(Marshal.GetLastWin32Error())));
            }

            IntPtr lpAddress = WinAPI.VirtualAllocEx(ProcUtils.Handle, (IntPtr)null, (IntPtr)dllPath.Length, (uint)WinAPI.AllocationType.Commit | (uint)WinAPI.AllocationType.Reserve, (uint)WinAPI.MemoryProtection.ExecuteReadWrite);

            if (lpAddress == IntPtr.Zero)
            {
                return(new DllInjectionResult("Could not allocate memory for dllPath", new Win32Exception(Marshal.GetLastWin32Error())));
            }

            byte[] bytes = Encoding.ASCII.GetBytes(dllPath);

            try
            {
                MemUtils.WriteString(lpAddress, dllPath, Encoding.ASCII);
            }
            catch (Exception ex)
            {
                return(new DllInjectionResult("Failed to write dllPath to memory", ex));
            }

            RemoteThreadResult result = this.ExecuteRemoteThread(lpLLAddress, lpAddress);

            if (!result.Success)
            {
                return(new DllInjectionResult(result.ErrorMessage));
            }
            hModule = (IntPtr)result.ReturnValue;

            if (hModule == IntPtr.Zero)
            {
                return(new DllInjectionResult("The base-address of the injected module is zero"));
            }

            return(new DllInjectionResult(true));
        }
Пример #4
0
        private static void CreateEstadaInTime()
        {
            Hóspede responsável     = new Hóspede();
            Hóspede hóspede         = new Hóspede();
            Estada  estada          = new Estada();
            Extra   extraPessoal    = new Extra();
            Extra   extraAlojamento = new Extra();

            Console.Write("NIF Hóspede Responsável: ");
            responsável.NIF = int.Parse(Console.ReadLine());

            Console.Write("NIF Hóspede Acompanhante: ");
            hóspede.NIF = int.Parse(Console.ReadLine());

            Console.Write("Data Inicial da Estada(YYYY-MM-DD HH:MM:SS): ");
            estada.dataInício = Convert.ToDateTime(Console.ReadLine());

            Console.Write("Data Final da Estada(YYYY-MM-DD HH:MM:SS): ");
            estada.dataFim = Convert.ToDateTime(Console.ReadLine());

            Console.Write("Tipo de Alojamento(tenda/bungalow): ");
            string tipoAloj = Console.ReadLine();

            Console.Write("Lotação de pessoas: ");
            int lot = int.Parse(Console.ReadLine());

            Console.Write("Identificador extra pessoal: ");
            extraPessoal.id        = int.Parse(Console.ReadLine());
            extraPessoal.associado = "pessoa";

            Console.Write("Identificador extra alojamento: ");
            extraAlojamento.id        = int.Parse(Console.ReadLine());
            extraAlojamento.associado = "alojamento";

            if (tipoAloj.Equals("tenda"))
            {
                using (Context context = new Context(connectionString)) {
                    Tenda tenda = new Tenda();
                    tenda.númeroMáximoPessoas = lot;
                    tenda.tipoAlojamento      = "tenda";
                    ProcUtils procedimento = new ProcUtils(context);
                    procedimento.createEstadaInTime(responsável, hóspede, estada, tenda, extraPessoal, extraAlojamento);
                }
            }
            else
            {
                using (Context context = new Context(connectionString)) {
                    Bungalow bungalow = new Bungalow();
                    bungalow.númeroMáximoPessoas = lot;
                    bungalow.tipoAlojamento      = "bungalow";
                    ProcUtils procedimento = new ProcUtils(context);
                    procedimento.createEstadaInTime(responsável, hóspede, estada, bungalow, extraPessoal, extraAlojamento);
                }
            }
        }
Пример #5
0
        private static void FinishEstadaWithFactura()
        {
            Estada estada = new Estada();

            Console.Write("ID Estada: ");
            estada.id = int.Parse(Console.ReadLine());
            using (Context context = new Context(connectionString)) {
                ProcUtils procedimento = new ProcUtils(context);
                procedimento.finishEstadaWithFactura(estada);
            }
        }
        protected override DllInjectionResult PerformInjection(System.Diagnostics.Process proc, string dllPath)
        {
            this.DllPath = dllPath;

            ProcUtils = new ProcUtils(proc, WinAPI.ProcessAccessFlags.CreateThread | WinAPI.ProcessAccessFlags.VirtualMemoryOperation | WinAPI.ProcessAccessFlags.VirtualMemoryRead | WinAPI.ProcessAccessFlags.VirtualMemoryWrite | WinAPI.ProcessAccessFlags.QueryInformation);

            MemUtils = new MemUtils();
            MemUtils.Handle = ProcUtils.Handle;
            MemUtils.UseUnsafeReadWrite = true;

            if (ProcUtils.Handle == IntPtr.Zero)
            {
                return new DllInjectionResult("Could not open process", new Win32Exception(Marshal.GetLastWin32Error()));
            }

            IntPtr lpLLAddress = WinAPI.GetProcAddress(WinAPI.GetModuleHandle("kernel32.dll"), "LoadLibraryA");

            if (lpLLAddress == IntPtr.Zero)
            {
                return new DllInjectionResult("Could not find address of LoadLibraryA", new Win32Exception(Marshal.GetLastWin32Error()));
            }

            IntPtr lpAddress = WinAPI.VirtualAllocEx(ProcUtils.Handle, (IntPtr)null, (IntPtr)dllPath.Length, (uint)WinAPI.AllocationType.Commit | (uint)WinAPI.AllocationType.Reserve, (uint)WinAPI.MemoryProtection.ExecuteReadWrite);

            if (lpAddress == IntPtr.Zero)
            {
                return new DllInjectionResult("Could not allocate memory for dllPath", new Win32Exception(Marshal.GetLastWin32Error()));
            }

            byte[] bytes = Encoding.ASCII.GetBytes(dllPath);

            try
            {
                MemUtils.WriteString(lpAddress, dllPath, Encoding.ASCII);
            }
            catch(Exception ex)
            {
                return new DllInjectionResult("Failed to write dllPath to memory", ex);
            }

            RemoteThreadResult result = this.ExecuteRemoteThread(lpLLAddress, lpAddress);

            if (!result.Success)
            {
                return new DllInjectionResult(result.ErrorMessage);
            }
            hModule = (IntPtr)result.ReturnValue;

            if (hModule == IntPtr.Zero)
                return new DllInjectionResult("The base-address of the injected module is zero");

            return new DllInjectionResult(true);
        }
Пример #7
0
        private static void DeleteParque()
        {
            ParqueCampismo parque = new ParqueCampismo();

            Console.Write("Nome Parque: ");
            parque.nome = Console.ReadLine();

            using (Context context = new Context(connectionString)) {
                ProcUtils procedimento = new ProcUtils(context);
                procedimento.DeletePark(parque);
            }
        }
Пример #8
0
        /// <summary>
        /// Performs an DLL-injection
        /// </summary>
        /// <param name="pid">ID of the process to inject into</param>
        /// <param name="dllPath">Path of the DLL-file to inject</param>
        /// <returns>A DLLInjectionResult holding data about this injection-attempt</returns>
        public DllInjectionResult Inject(int pid, string dllPath, string moduleName = null)
        {
            if (pid < 0)
            {
                throw new ArgumentException("Process-ID is invalid", "pid");
            }
            if (!ProcUtils.ProcessIsRunning(pid))
            {
                throw new Exception(string.Format("Process with id {0} not found", pid));
            }

            return(Inject(Process.GetProcessById(pid), dllPath));
        }
Пример #9
0
        /// <summary>
        /// Performs an DLL-injection
        /// </summary>
        /// <param name="processName">Name of the process to inject into</param>
        /// <param name="dllPath">Path of the DLL-file to inject</param>
        /// <returns>A DLLInjectionResult holding data about this injection-attempt</returns>
        public DllInjectionResult Inject(string processName, string dllPath)
        {
            if (string.IsNullOrEmpty(processName))
            {
                throw new ArgumentException("String must not be null or empty", "processName");
            }
            if (!ProcUtils.ProcessIsRunning(processName))
            {
                throw new Exception(string.Format("Process \"{0}\" not found", processName));
            }

            return(Inject(Process.GetProcessesByName(processName)[0], dllPath));
        }
Пример #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Window_Initialized(object sender, EventArgs e)
        {
            Closing += MainWindow_Closing;

            if (ProcUtils.ProcessIsRunning("csgo"))
            {
                Settings.Init();
                Memory.Init();
                Init();
                InitUI();
            }
            else
            {
                Application.Current.Shutdown();
            }
        }
Пример #11
0
        private static void SendEmails()
        {
            List <string> messages;

            Console.Write("Intervalo: ");
            int intervalo = int.Parse(Console.ReadLine());

            using (Context context = new Context(connectionString)) {
                ProcUtils procedimento = new ProcUtils(context);
                messages = procedimento.SendEmails(intervalo);
            }

            Console.WriteLine("\nEmails enviados: \n");

            messages.ForEach((string message) => {
                Console.Write(message);
            });
        }
Пример #12
0
        private static void ListarActividades()
        {
            List <string> actividades;

            Console.Write("Data Inicio(YYYY-MM-DD): ");
            DateTime dataInicio = Convert.ToDateTime(Console.ReadLine());

            Console.Write("Data Fim(YYYY-MM-DD): ");
            DateTime dataFim = Convert.ToDateTime(Console.ReadLine());

            using (Context context = new Context(connectionString)) {
                ProcUtils procedimento = new ProcUtils(context);
                actividades = procedimento.ListarActividades(dataInicio, dataFim);
            }

            Console.WriteLine("\nActividades disponiveis: \n");

            actividades.ForEach((string actividade) => {
                Console.WriteLine(actividade);
            });
        }
Пример #13
0
        private static void InscreverHóspede()
        {
            Hóspede     hóspede = new Hóspede();
            Actividades actividade;

            Console.Write("NIF Hospede: ");
            hóspede.NIF = int.Parse(Console.ReadLine());

            Console.Write("Nome Parque: ");
            string nomeParq = Console.ReadLine();

            Console.Write("Numero Sequencial: ");
            int numeroSeq = int.Parse(Console.ReadLine());

            Console.Write("Ano(YYYY): ");
            int ano = int.Parse(Console.ReadLine());

            using (Context context = new Context(connectionString)) {
                ActividadesMapper actividadesMapper = new ActividadesMapper(context);
                actividade = actividadesMapper.Read(new Tuple <string, int, int>(nomeParq, numeroSeq, ano));
                ProcUtils procedimento = new ProcUtils(context);
                procedimento.InscreverHospede(actividade, hóspede);
            }
        }
        public static void Main(string[] args)
        {
            System.Windows.Forms.Application.EnableVisualStyles();
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);

            PrintSuccess("[>]=-- Zat's CSGO-ESP");
            PrintEncolored("[www.unknowncheats.me - Leading the game hacking scene since 2000]", ConsoleColor.Cyan);
            Thread scroller = new Thread(new ThreadStart(LoopScroll));

            scroller.IsBackground = true;
            scroller.Start();
            KeyUtils    = new KeyUtils();
            ConfigUtils = new CSGOConfigUtils();

            //ESP
            ConfigUtils.BooleanSettings.AddRange(new string[] { "espEnabled", "espBox", "espSkeleton", "espName", "espHealth", "espAllies", "espEnemies" });
            //Aim
            ConfigUtils.BooleanSettings.AddRange(new string[] { "aimDrawFov", "aimEnabled", "aimToggle", "aimHold", "aimSmoothEnabled", "aimFilterSpotted", "aimFilterSpottedBy", "aimFilterEnemies", "aimFilterAllies", "aimFilterSpottedBy" });
            ConfigUtils.KeySettings.Add("aimKey");
            ConfigUtils.FloatSettings.AddRange(new string[] { "aimFov", "aimSmoothValue" });
            ConfigUtils.IntegerSettings.Add("aimBone");
            //RCS
            ConfigUtils.BooleanSettings.Add("rcsEnabled");
            ConfigUtils.FloatSettings.Add("rcsForce");
            //Trigger
            ConfigUtils.BooleanSettings.AddRange(new string[] { "triggerEnabled", "triggerToggle", "triggerHold", "triggerFilterEnemies", "triggerFilterAllies", "triggerBurstEnabled", "triggerBurstRandomize" });
            ConfigUtils.KeySettings.Add("triggerKey");
            ConfigUtils.FloatSettings.AddRange(new string[] { "triggerDelayFirstShot", "triggerDelayShots", "triggerBurstShots" });
            //Radar
            ConfigUtils.BooleanSettings.AddRange(new string[] { "radarEnabled", "radarAllies", "radarEnemies" });
            ConfigUtils.FloatSettings.AddRange(new string[] { "radarScale", "radarWidth", "radarHeight" });
            //Crosshair
            ConfigUtils.BooleanSettings.AddRange(new string[] { "crosshairEnabled", "crosshairOutline" });
            ConfigUtils.IntegerSettings.AddRange(new string[] { "crosshairType" });
            ConfigUtils.UIntegerSettings.AddRange(new string[] { "crosshairPrimaryColor", "crosshairSecondaryColor" });
            ConfigUtils.FloatSettings.AddRange(new string[] { "crosshairWidth", "crosshairSpreadScale", "crosshairRadius" });
            //Windows
            ConfigUtils.BooleanSettings.AddRange(new string[] { "windowSpectatorsEnabled", "windowPerformanceEnabled", "windowBotsEnabled", "windowEnemiesEnabled" });


            ConfigUtils.FillDefaultValues();

            if (!File.Exists("euc_csgo.cfg"))
            {
                ConfigUtils.SaveSettingsToFile("euc_csgo.cfg");
            }
            ConfigUtils.ReadSettingsFromFile("euc_csgo.cfg");

            PrintInfo("> Waiting for CSGO to start up...");
            while (!ProcUtils.ProcessIsRunning(GAME_PROCESS))
            {
                Thread.Sleep(250);
            }

            ProcUtils       = new ProcUtils(GAME_PROCESS, WinAPI.ProcessAccessFlags.VirtualMemoryRead | WinAPI.ProcessAccessFlags.VirtualMemoryWrite | WinAPI.ProcessAccessFlags.VirtualMemoryOperation);
            MemUtils        = new ExternalUtilsCSharp.MemUtils();
            MemUtils.Handle = ProcUtils.Handle;

            PrintInfo("> Waiting for CSGOs window to show up...");
            while ((hWnd = WinAPI.FindWindowByCaption(hWnd, GAME_TITLE)) == IntPtr.Zero)
            {
                Thread.Sleep(250);
            }

            ProcessModule clientDll, engineDll;

            PrintInfo("> Waiting for CSGO to load client.dll...");
            while ((clientDll = ProcUtils.GetModuleByName(@"bin\client.dll")) == null)
            {
                Thread.Sleep(250);
            }
            PrintInfo("> Waiting for CSGO to load engine.dll...");
            while ((engineDll = ProcUtils.GetModuleByName(@"engine.dll")) == null)
            {
                Thread.Sleep(250);
            }

            Framework = new Framework(clientDll, engineDll);

            PrintInfo("> Initializing overlay");
            using (SHDXOverlay = new SharpDXOverlay())
            {
                SHDXOverlay.Attach(hWnd);
                SHDXOverlay.TickEvent          += overlay_TickEvent;
                SHDXOverlay.BeforeDrawingEvent += SHDXOverlay_BeforeDrawingEvent;
                InitializeComponents();
                SharpDXRenderer renderer  = SHDXOverlay.Renderer;
                TextFormat      smallFont = renderer.CreateFont("smallFont", "Century Gothic", 10f);
                TextFormat      largeFont = renderer.CreateFont("largeFont", "Century Gothic", 14f);
                TextFormat      heavyFont = renderer.CreateFont("heavyFont", "Century Gothic", 14f, FontStyle.Normal, FontWeight.Heavy);

                windowMenu.Font               = smallFont;
                windowMenu.Caption.Font       = largeFont;
                windowGraphs.Font             = smallFont;
                windowGraphs.Caption.Font     = largeFont;
                windowSpectators.Font         = smallFont;
                windowSpectators.Caption.Font = largeFont;
                windowBots.Font               = smallFont;
                windowBots.Caption.Font       = largeFont;
                graphMemRead.Font             = smallFont;
                graphMemWrite.Font            = smallFont;

                for (int i = 0; i < ctrlPlayerESP.Length; i++)
                {
                    ctrlPlayerESP[i].Font = heavyFont;
                    SHDXOverlay.ChildControls.Add(ctrlPlayerESP[i]);
                }
                ctrlRadar.Font = smallFont;

                windowMenu.ApplySettings(ConfigUtils);

                SHDXOverlay.ChildControls.Add(ctrlCrosshair);
                SHDXOverlay.ChildControls.Add(ctrlRadar);
                SHDXOverlay.ChildControls.Add(windowMenu);
                SHDXOverlay.ChildControls.Add(windowGraphs);
                SHDXOverlay.ChildControls.Add(windowSpectators);
                SHDXOverlay.ChildControls.Add(windowBots);
                SHDXOverlay.ChildControls.Add(cursor);
                PrintInfo("> Running overlay");
                System.Windows.Forms.Application.Run(SHDXOverlay);
            }
            ConfigUtils.SaveSettingsToFile("euc_csgo.cfg");
        }
Пример #15
0
        public void Update()
        {
            //If the game processes is not running, close the cheat.
            if (!ProcUtils.ProcessIsRunning(Program.GameProcess))
            {
                Environment.Exit(0);
            }

            WindowTitle = GetActiveWindowTitle();
            if (WindowTitle != Program.GameTitle)
            {
                return;
            }

            var players  = new List <Tuple <int, Player> >();
            var entities = new List <Tuple <int, BaseEntity> >();
            var weapons  = new List <Tuple <int, Weapon> >();

            State        = (SignOnState)Program.MemUtils.Read <int>((IntPtr)(ClientState + Offsets.ClientState.InGame));
            _localPlayer = Program.MemUtils.Read <int>((IntPtr)(ClientDllBase + Offsets.Misc.LocalPlayer));
            ViewMatrix   = Program.MemUtils.ReadMatrix((IntPtr)_viewMatrix, 4, 4);


            //If we are not ingame do not update
            if (State != SignOnState.SignonstateFull)
            {
                return;
            }

            var data = new byte[16 * 8192];

            Program.MemUtils.Read((IntPtr)_entityList, out data, data.Length);

            for (var i = 0; i < data.Length / 16; i++)
            {
                var address = BitConverter.ToInt32(data, 16 * i);
                if (address == 0)
                {
                    continue;
                }
                var entity = new BaseEntity(address);
                if (!entity.IsValid())
                {
                    continue;
                }
                if (entity.IsPlayer())
                {
                    players.Add(new Tuple <int, Player>(i, new Player(entity)));
                }
                else if (entity.IsWeapon())
                {
                    weapons.Add(new Tuple <int, Weapon>(i, new Weapon(entity)));
                }
                else
                {
                    entities.Add(new Tuple <int, BaseEntity>(i, entity));
                }
            }

            Players  = players.ToArray();
            Entities = entities.ToArray();
            Weapons  = weapons.ToArray();

            //Check if our player exists
            if (players.Exists(x => x.Item2.Address == _localPlayer))
            {
                LocalPlayer       = new LocalPlayer(players.First(x => x.Item2.Address == _localPlayer).Item2);
                LocalPlayerWeapon = LocalPlayer.GetActiveWeapon();
                //Only gets the weapon name and formates it properly and retunrs a string. Used for Weapon Configs
                WeaponSection = LocalPlayer.GetActiveWeaponName();
            }
        }