예제 #1
0
파일: Form1.cs 프로젝트: Frehzy/CSGOCheat
        public Form1()
        {
            InitializeComponent();
            //если процесс игры не найден
            while (!FindProcess.GetDll())
            {
                DialogResult ifnotcsgo = MessageBox.Show("Game process not found. Continue?", "Error", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                if (ifnotcsgo == DialogResult.No)
                {
                    try { Environment.Exit(0); }
                    catch { Application.Exit(); }
                }
            }

            tabPageAdv1.TabVisible = false;

            //checkcsgo
            Thread checkcs = new Thread(FindProcess.Check);

            Variable.check = true;
            checkcs.Start();

            //уведомление в начале
            string notif_text = "Press 'Insert' to enable Cheat";

            Notifier.Notif(notif_text);

            //распаковка hazedumper и config.json
            string temp_hazedumper = Application.StartupPath + "/hazedumper.exe";

            if (File.Exists(temp_hazedumper))
            {
                File.Delete(temp_hazedumper);
            }
            File.WriteAllBytes(temp_hazedumper, Properties.Resources.hazedumper);
            string temp_config = Application.StartupPath + "/config.json";

            if (File.Exists(temp_config))
            {
                File.Delete(temp_config);
            }
            File.WriteAllText(temp_config, Properties.Resources.config);

            _overlayStatus = false;

            OffsetsUpdater.DeleteFile();
            OffsetsUpdater.GetOffsets();

            //DEBUG
            try
            {
                string pathToFile = Application.StartupPath + $"/csgo.cs";
                // Считываем строки в массив
                string[] allLines = File.ReadAllLines(pathToFile, Encoding.GetEncoding(1251));
                // Добавляем каждую строку
                Offsets_csgo_cs.Items.Add("Information from the file: csgo.cs");
                foreach (string line in allLines)
                {
                    Offsets_csgo_cs.Items.Add(line);
                }

                string   pathToLog   = Application.StartupPath + $"/hazedumper.log";
                string[] allLinesLog = File.ReadAllLines(pathToLog, Encoding.GetEncoding(1251));
                DebugLog.Items.Add("Information from the file: hazedumper.log");
                foreach (string lineLog in allLinesLog)
                {
                    DebugLog.Items.Add(lineLog);
                }
            }
            catch (Exception ex)
            {
                Offsets_csgo_cs.Items.Add("Failed to load offsets");
                Offsets_csgo_cs.Items.Add(ex);
                Offsets_csgo_process.Items.Add("Failed to load offsets");
                Offsets_csgo_process.Items.Add(ex);
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            //проверка оффсетов на их роботоспособность
            bool   isOkay  = true;
            string keyWord = "WARN";
            var    lines   = File.ReadLines(Application.StartupPath + $"/hazedumper.log");
            string result  = string.Join("\n", lines.Where(s => s.IndexOf(keyWord, StringComparison.InvariantCultureIgnoreCase) >= 0));

            if (result.Length != 0)
            {
                MessageBox.Show(result, "Offsets are not found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                isOkay = false;
            }

            OffsetsUpdater.Update();
            OffsetsUpdater.DeleteFile();
            if (File.Exists(temp_hazedumper))
            {
                File.Delete(temp_hazedumper);
            }
            if (File.Exists(temp_config))
            {
                File.Delete(temp_config);
            }

            if (isOkay == false)
            {
                Process[] listprosecc = Process.GetProcesses();
                try
                {
                    foreach (Process proc in Process.GetProcessesByName(Variable.CheatName))
                    {
                        proc.Kill();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }


            // СТРАШНО

            Offsets_csgo_process.Items.Add("Information from the cheat");
            #region Заполнение Offsets_csgo_process
            Offsets_csgo_process.Items.Add("public const Int32 dwEntityListDistance = 0x" + Offsets.dwEntityListDistance.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "cs_gamerules_data " + "= 0x" + netvars.cs_gamerules_data.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_ArmorValue " + "= 0x" + netvars.m_ArmorValue.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_Collision " + "= 0x" + netvars.m_Collision.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_CollisionGroup " + "= 0x" + netvars.m_CollisionGroup.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_Local " + "= 0x" + netvars.m_Local.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_MoveType " + "= 0x" + netvars.m_MoveType.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_OriginalOwnerXuidHigh " + "= 0x" + netvars.m_OriginalOwnerXuidHigh.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_OriginalOwnerXuidLow " + "= 0x" + netvars.m_OriginalOwnerXuidLow.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_SurvivalGameRuleDecisionTypes " + "= 0x" + netvars.m_SurvivalGameRuleDecisionTypes.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_SurvivalRules " + "= 0x" + netvars.m_SurvivalRules.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_aimPunchAngle " + "= 0x" + netvars.m_aimPunchAngle.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_aimPunchAngleVel " + "= 0x" + netvars.m_aimPunchAngleVel.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_angEyeAnglesX " + "= 0x" + netvars.m_angEyeAnglesX.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_angEyeAnglesY " + "= 0x" + netvars.m_angEyeAnglesY.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_bBombPlanted " + "= 0x" + netvars.m_bBombPlanted.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_bFreezePeriod " + "= 0x" + netvars.m_bFreezePeriod.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_bGunGameImmunity " + "= 0x" + netvars.m_bGunGameImmunity.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_bHasDefuser " + "= 0x" + netvars.m_bHasDefuser.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_bHasHelmet " + "= 0x" + netvars.m_bHasHelmet.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_bInReload " + "= 0x" + netvars.m_bInReload.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_bIsDefusing " + "= 0x" + netvars.m_bIsDefusing.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_bIsQueuedMatchmaking " + "= 0x" + netvars.m_bIsQueuedMatchmaking.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_bIsScoped " + "= 0x" + netvars.m_bIsScoped.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_bIsValveDS " + "= 0x" + netvars.m_bIsValveDS.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_bSpotted " + "= 0x" + netvars.m_bSpotted.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_bSpottedByMask " + "= 0x" + netvars.m_bSpottedByMask.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_bStartedArming " + "= 0x" + netvars.m_bStartedArming.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_clrRender " + "= 0x" + netvars.m_clrRender.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_dwBoneMatrix " + "= 0x" + netvars.m_dwBoneMatrix.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_fAccuracyPenalty " + "= 0x" + netvars.m_fAccuracyPenalty.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_fFlags " + "= 0x" + netvars.m_fFlags.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_flC4Blow " + "= 0x" + netvars.m_flC4Blow.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_flDefuseCountDown " + "= 0x" + netvars.m_flDefuseCountDown.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_flDefuseLength " + "= 0x" + netvars.m_flDefuseLength.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_flFallbackWear " + "= 0x" + netvars.m_flFallbackWear.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_flFlashDuration " + "= 0x" + netvars.m_flFlashDuration.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_flFlashMaxAlpha " + "= 0x" + netvars.m_flFlashMaxAlpha.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_flLastBoneSetupTime " + "= 0x" + netvars.m_flLastBoneSetupTime.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_flLowerBodyYawTarget " + "= 0x" + netvars.m_flLowerBodyYawTarget.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_flNextAttack " + "= 0x" + netvars.m_flNextAttack.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_flNextPrimaryAttack " + "= 0x" + netvars.m_flNextPrimaryAttack.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_flSimulationTime " + "= 0x" + netvars.m_flSimulationTime.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_flTimerLength " + "= 0x" + netvars.m_flTimerLength.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_hActiveWeapon " + "= 0x" + netvars.m_hActiveWeapon.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_hMyWeapons " + "= 0x" + netvars.m_hMyWeapons.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_hObserverTarget " + "= 0x" + netvars.m_hObserverTarget.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_hOwner " + "= 0x" + netvars.m_hOwner.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_hOwnerEntity " + "= 0x" + netvars.m_hOwnerEntity.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iAccountID " + "= 0x" + netvars.m_iAccountID.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iClip1 " + "= 0x" + netvars.m_iClip1.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iCompetitiveRanking " + "= 0x" + netvars.m_iCompetitiveRanking.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iCompetitiveWins " + "= 0x" + netvars.m_iCompetitiveWins.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iCrosshairId " + "= 0x" + netvars.m_iCrosshairId.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iEntityQuality " + "= 0x" + netvars.m_iEntityQuality.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iFOV " + "= 0x" + netvars.m_iFOV.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iFOVStart " + "= 0x" + netvars.m_iFOVStart.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iGlowIndex " + "= 0x" + netvars.m_iGlowIndex.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iHealth " + "= 0x" + netvars.m_iHealth.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iItemDefinitionIndex " + "= 0x" + netvars.m_iItemDefinitionIndex.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iItemIDHigh " + "= 0x" + netvars.m_iItemIDHigh.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iMostRecentModelBoneCounter " + "= 0x" + netvars.m_iMostRecentModelBoneCounter.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iObserverMode " + "= 0x" + netvars.m_iObserverMode.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iShotsFired " + "= 0x" + netvars.m_iShotsFired.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iState " + "= 0x" + netvars.m_iState.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_iTeamNum " + "= 0x" + netvars.m_iTeamNum.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_lifeState " + "= 0x" + netvars.m_lifeState.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_nFallbackPaintKit " + "= 0x" + netvars.m_nFallbackPaintKit.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_nFallbackSeed " + "= 0x" + netvars.m_nFallbackSeed.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_nFallbackStatTrak " + "= 0x" + netvars.m_nFallbackStatTrak.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_nForceBone " + "= 0x" + netvars.m_nForceBone.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_nTickBase " + "= 0x" + netvars.m_nTickBase.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_rgflCoordinateFrame " + "= 0x" + netvars.m_rgflCoordinateFrame.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_szCustomName " + "= 0x" + netvars.m_szCustomName.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_szLastPlaceName " + "= 0x" + netvars.m_szLastPlaceName.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_thirdPersonViewAngles " + "= 0x" + netvars.m_thirdPersonViewAngles.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_vecOrigin " + "= 0x" + netvars.m_vecOrigin.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_vecVelocity " + "= 0x" + netvars.m_vecVelocity.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_vecViewOffset " + "= 0x" + netvars.m_vecViewOffset.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_viewPunchAngle " + "= 0x" + netvars.m_viewPunchAngle.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "clientstate_choked_commands " + "= 0x" + signatures.clientstate_choked_commands.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "clientstate_delta_ticks " + "= 0x" + signatures.clientstate_delta_ticks.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "clientstate_last_outgoing_command " + "= 0x" + signatures.clientstate_last_outgoing_command.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "clientstate_net_channel " + "= 0x" + signatures.clientstate_net_channel.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "convar_name_hash_table " + "= 0x" + signatures.convar_name_hash_table.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwClientState " + "= 0x" + signatures.dwClientState.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwClientState_GetLocalPlayer " + "= 0x" + signatures.dwClientState_GetLocalPlayer.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwClientState_IsHLTV " + "= 0x" + signatures.dwClientState_IsHLTV.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwClientState_Map " + "= 0x" + signatures.dwClientState_Map.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwClientState_MapDirectory " + "= 0x" + signatures.dwClientState_MapDirectory.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwClientState_MaxPlayer " + "= 0x" + signatures.dwClientState_MaxPlayer.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwClientState_PlayerInfo " + "= 0x" + signatures.dwClientState_PlayerInfo.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwClientState_State " + "= 0x" + signatures.dwClientState_State.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwClientState_ViewAngles " + "= 0x" + signatures.dwClientState_ViewAngles.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwEntityList " + "= 0x" + signatures.dwEntityList.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwForceAttack " + "= 0x" + signatures.dwForceAttack.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwForceAttack2 " + "= 0x" + signatures.dwForceAttack2.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwForceBackward " + "= 0x" + signatures.dwForceBackward.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwForceForward " + "= 0x" + signatures.dwForceForward.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwForceJump " + "= 0x" + signatures.dwForceJump.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwForceLeft " + "= 0x" + signatures.dwForceLeft.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwForceRight " + "= 0x" + signatures.dwForceRight.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwGameDir " + "= 0x" + signatures.dwGameDir.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwGetAllClasses " + "= 0x" + signatures.dwGetAllClasses.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwGlobalVars " + "= 0x" + signatures.dwGlobalVars.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwGlowObjectManager " + "= 0x" + signatures.dwGlowObjectManager.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwInput " + "= 0x" + signatures.dwInput.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwInterfaceLinkList " + "= 0x" + signatures.dwInterfaceLinkList.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwLocalPlayer " + "= 0x" + signatures.dwLocalPlayer.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwMouseEnable " + "= 0x" + signatures.dwMouseEnable.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwMouseEnablePtr " + "= 0x" + signatures.dwMouseEnablePtr.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwPlayerResource " + "= 0x" + signatures.dwPlayerResource.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwRadarBase " + "= 0x" + signatures.dwRadarBase.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwSensitivity " + "= 0x" + signatures.dwSensitivity.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwSensitivityPtr " + "= 0x" + signatures.dwSensitivityPtr.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwSetClanTag " + "= 0x" + signatures.dwSetClanTag.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwViewMatrix " + "= 0x" + signatures.dwViewMatrix.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwWeaponTable " + "= 0x" + signatures.dwWeaponTable.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwWeaponTableIndex " + "= 0x" + signatures.dwWeaponTableIndex.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwYawPtr " + "= 0x" + signatures.dwYawPtr.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwZoomSensitivityRatioPtr " + "= 0x" + signatures.dwZoomSensitivityRatioPtr.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwbSendPackets " + "= 0x" + signatures.dwbSendPackets.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "dwppDirect3DDevice9 " + "= 0x" + signatures.dwppDirect3DDevice9.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "force_update_spectator_glow " + "= 0x" + signatures.force_update_spectator_glow.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "interface_engine_cvar " + "= 0x" + signatures.interface_engine_cvar.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "is_c4_owner " + "= 0x" + signatures.is_c4_owner.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_bDormant " + "= 0x" + signatures.m_bDormant.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_pStudioHdr " + "= 0x" + signatures.m_pStudioHdr.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_pitchClassPtr " + "= 0x" + signatures.m_pitchClassPtr.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "m_yawClassPtr " + "= 0x" + signatures.m_yawClassPtr.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "model_ambient_min " + "= 0x" + signatures.model_ambient_min.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "set_abs_angles " + "= 0x" + signatures.set_abs_angles.ToString("X"));
            Offsets_csgo_process.Items.Add("public static Int32 " + "set_abs_origin " + "= 0x" + signatures.set_abs_origin.ToString("X"));
            #endregion


            //отслеживание клавиши Insert
            gHook          = new GlobalKeyboardHook();
            gHook.KeyDown += new KeyEventHandler(gHook_KeyDown);
            foreach (Keys key in Enum.GetValues(typeof(Keys)))
            {
                gHook.HookedKeys.Add(key);
            }
            gHook.hook();
        }
예제 #2
0
        private void InjectButton_Click(object sender, EventArgs e)
        {
            if (!Inject.GetDll())
            {
                StatusLabel.Text      = "NotFound";
                StatusLabel.ForeColor = Color.Red;
                StatusLabel.Left      = 0;

                LegitBotButton.Enabled   = false;
                legitControl1.Enabled    = false;
                RageBotButton.Enabled    = false;
                rageControl1.Enabled     = false;
                SettingsButton.Enabled   = false;
                settingsControl1.Enabled = false;
                DebugButton.Enabled      = true;
            }
            else
            {
                StatusLabel.Text      = "Found";
                StatusLabel.ForeColor = Color.Green;
                StatusLabel.Left      = 22;

                LegitBotButton.Enabled   = true;
                legitControl1.Enabled    = true;
                RageBotButton.Enabled    = true;
                rageControl1.Enabled     = true;
                SettingsButton.Enabled   = true;
                settingsControl1.Enabled = true;
                DebugButton.Enabled      = true;

                Thread.Sleep(500);

                //checkcsgo
                Thread checkcs = new Thread(Inject.Check);
                Variable.check = true;
                checkcs.Start();

                //уведомление в начале
                string notif_text = "Press 'Insert' to enable Cheat";
                Notifier.Notif(notif_text);

                //распаковка hazedumper и config.json
                string temp_hazedumper = Application.StartupPath + "/hazedumper.exe";
                if (File.Exists(temp_hazedumper))
                {
                    File.Delete(temp_hazedumper);
                }
                File.WriteAllBytes(temp_hazedumper, Properties.Resources.hazedumper);
                string temp_config = Application.StartupPath + "/config.json";
                if (File.Exists(temp_config))
                {
                    File.Delete(temp_config);
                }
                File.WriteAllText(temp_config, Properties.Resources.config);

                _overlayStatus = false;

                OffsetsUpdater.DeleteFile();
                OffsetsUpdater.GetOffsets();

                //проверка оффсетов на их роботоспособность
                bool   isOkay  = true;
                string keyWord = "WARN";
                var    lines   = File.ReadLines(Application.StartupPath + $"/hazedumper.log");
                string result  = string.Join("\n", lines.Where(s => s.IndexOf(keyWord, StringComparison.InvariantCultureIgnoreCase) >= 0));
                if (result.Length != 0)
                {
                    MessageBox.Show(result, "Offsets are not found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    isOkay = false;
                }

                OffsetsUpdater.Update();
                OffsetsUpdater.DeleteFile();
                if (File.Exists(temp_hazedumper))
                {
                    File.Delete(temp_hazedumper);
                }
                if (File.Exists(temp_config))
                {
                    File.Delete(temp_config);
                }

                if (isOkay == false)
                {
                    Process[] listprosecc = Process.GetProcesses();
                    try
                    {
                        foreach (Process proc in Process.GetProcessesByName(Variable.CheatName))
                        {
                            proc.Kill();
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }

                //отслеживание клавиши Insert
                gHook          = new GlobalKeyboardHook();
                gHook.KeyDown += new KeyEventHandler(gHook_KeyDown);
                foreach (Keys key in Enum.GetValues(typeof(Keys)))
                {
                    gHook.HookedKeys.Add(key);
                }
                gHook.hook();
            }
        }