-
Автор темы
- #1
Привет! С самого начала создания external чита ломал голову, как сделать внутриигровое меню?
(Тип это же external(внешний) чит, а нодо внедрятся в игру) И вот недавно нашёл и разобрал сурс чита Zat's чит (P.S не реклама), в котором есть то самое внутриигровое меню, хочу с вами поделиться создание его с нуля! C#
Приступим!
Всё можно запускать - наше меню готово!!!
(Тип это же external(внешний) чит, а нодо внедрятся в игру) И вот недавно нашёл и разобрал сурс чита Zat's чит (P.S не реклама), в котором есть то самое внутриигровое меню, хочу с вами поделиться создание его с нуля! C#
Приступим!
1) Создадим обычное консольное приложение
И добавим некоторые ссылки:
System.Window.Forms
ExternalUtilsCSharp.dll
ExternalUtilsCSharp.SharpDXRenderer.dll
SharpDX.Direct2D1.dll
SharpDX.dll
SharpDX.DXGI.dll
И добавим некоторые ссылки:
System.Window.Forms
ExternalUtilsCSharp.dll
ExternalUtilsCSharp.SharpDXRenderer.dll
SharpDX.Direct2D1.dll
SharpDX.dll
SharpDX.DXGI.dll
Пожалуйста, авторизуйтесь для просмотра ссылки.
(кликабельно)2) Добавим директивы через using
Код:
using ExternalUtilsCSharp;
using ExternalUtilsCSharp.MathObjects;
using ExternalUtilsCSharp.SharpDXRenderer;
using ExternalUtilsCSharp.SharpDXRenderer.Controls;
using ExternalUtilsCSharp.SharpDXRenderer.Controls.Crosshairs;
using ExternalUtilsCSharp.SharpDXRenderer.Controls.Layouts;
using ExternalUtilsCSharp.UI.UIObjects;
using SharpDX.Direct2D1;
using SharpDX.DirectWrite;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
3) В наш класс добавим следующий регион, для инициализации объектов:
Код:
#region For initializing
static void checkBox_CheckedChanged(object sender, EventArgs e)
{
SharpDXCheckBox control = (SharpDXCheckBox)sender;
}
private static void radioButton_CheckedChanged(object sender, EventArgs e)
{
SharpDXRadioButton control = (SharpDXRadioButton)sender;
}
private static void trackBar_ValueChangedEvent(object sender, EventArgs e)
{
SharpDXTrackbar control = (SharpDXTrackbar)sender;
}
static void buttonKey_KeyChangedEvent(object sender, EventArgs e)
{
SharpDXButtonKey control = (SharpDXButtonKey)sender;
}
static void button_MouseClickEventUp(object sender, ExternalUtilsCSharp.UI.Control<SharpDXRenderer, SharpDX.Color, SharpDX.Vector2, TextFormat>.MouseEventArgs e)
{
if (!e.LeftButton)
return;
SharpDXPanel panel = (SharpDXPanel)((SharpDXButton)sender).Tag;
panel.Visible = !panel.Visible;
}
private static void comboValue_SelectedIndexChangedEvent<T>(object sender, SharpDXComboValue<T>.ComboValueEventArgs e)
{
}
static void control_ColorChangedEvent(object sender, EventArgs e)
{
SharpDXColorControl control = (SharpDXColorControl)sender;
}
private static void InitColorControl(ref SharpDXColorControl control, string text, object tag, Color color)
{
control = new SharpDXColorControl();
control.Text = text;
control.Tag = tag;
control.Color = color;
control.ColorChangedEvent += control_ColorChangedEvent;
}
private static void InitComboValue<T>(ref SharpDXComboValue<T> control, string text, object tag, params Tuple<string, T>[] values)
{
control = new SharpDXComboValue<T>();
control.Text = text;
control.Tag = tag;
control.Values = values;
control.SelectedIndexChangedEvent += comboValue_SelectedIndexChangedEvent;
}
private static void InitButtonKey(ref SharpDXButtonKey control, string text, object tag)
{
control = new SharpDXButtonKey();
control.Text = text;
control.Tag = tag;
control.KeyChangedEvent += buttonKey_KeyChangedEvent;
}
private static void InitPanel(ref SharpDXPanel control, string text, bool dynamicWidth = true, bool dynamicHeight = true, bool fillParent = true, bool visible = true)
{
control = new SharpDXPanel();
control.Text = text;
control.DynamicHeight = dynamicHeight;
control.DynamicWidth = dynamicWidth;
control.FillParent = fillParent;
control.Visible = visible;
}
private static void InitToggleButton(ref SharpDXButton control, string text, SharpDXPanel tag)
{
control = new SharpDXButton();
control.Text = text;
control.Tag = tag;
control.MouseClickEventUp += button_MouseClickEventUp;
}
private static void InitTrackBar(ref SharpDXTrackbar control, string text, object tag, float min = 0, float max = 100, float value = 50, int numberofdecimals = 2)
{
control = new SharpDXTrackbar();
control.Text = text;
control.Tag = tag;
control.Minimum = min;
control.Maximum = max;
control.Value = value;
control.NumberOfDecimals = numberofdecimals;
control.ValueChangedEvent += trackBar_ValueChangedEvent;
}
private static void InitRadioButton(ref SharpDXRadioButton control, string text, object tag, bool bChecked)
{
control = new SharpDXRadioButton();
control.Text = text;
control.Tag = tag;
control.Checked = bChecked;
control.CheckedChangedEvent += radioButton_CheckedChanged;
}
private static void InitLabel(ref SharpDXLabel control, string text, bool fixedWidth = false, float width = 0f, SharpDXLabel.TextAlignment alignment = SharpDXLabel.TextAlignment.Left)
{
control = new SharpDXLabel();
control.FixedWidth = fixedWidth;
control.Width = width;
control.TextAlign = alignment;
control.Text = text;
control.Tag = null;
}
private static void InitCheckBox(ref SharpDXCheckBox control, string text, object tag, bool bChecked)
{
control = new SharpDXCheckBox();
control.Text = text;
control.Tag = tag;
control.Checked = bChecked;
control.CheckedChangedEvent += checkBox_CheckedChanged;
}
#endregion
4) Добавим этот код в функцию Main, он служит для внедрения меню в игру
Код:
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Console.WriteLine("YouGame.biz", ConsoleColor.Red);
KeyUtils = new KeyUtils();
Console.WriteLine("Waiting for CSGO procces...");
while (!ProcUtils.ProcessIsRunning(Procces))
Thread.Sleep(250);
ProcUtils = new ProcUtils(Procces, WinAPI.ProcessAccessFlags.VirtualMemoryRead | WinAPI.ProcessAccessFlags.VirtualMemoryWrite | WinAPI.ProcessAccessFlags.VirtualMemoryOperation);
MemUtils = new ExternalUtilsCSharp.MemUtils();
MemUtils.Handle = ProcUtils.Handle;
while ((WinAPI.GetForegroundWindow() != WinAPI.FindWindowByCaption(hWnd, Procces_TITLE)))
Thread.Sleep(250);
hWnd = WinAPI.FindWindowByCaption(hWnd, Procces_TITLE);
using (Overlay = new SharpDXOverlay())
{
Overlay.Attach(hWnd);
Overlay.TickEvent += overlay_TickEvent;
Overlay.BeforeDrawingEvent += BeforeDrawingEvent;
InitializeComponents();
SharpDXRenderer renderer = Overlay.Renderer;
TextFormat smallFont = renderer.CreateFont("smallFont", "Agency FB", 12f);
TextFormat largeFont = renderer.CreateFont("largeFont", "Agency FB", 16f);
Menu.Font = smallFont;
Menu.Caption.Font = largeFont;
Overlay.ChildControls.Add(Menu);
Overlay.ChildControls.Add(cursor);
Console.WriteLine("Starting cheat");
System.Windows.Forms.Application.Run(Overlay);
}
5) Добавим эти функции в наш класс, они служат для обновления кадров меню
Код:
private static void BeforeDrawingEvent(object sender, ExternalUtilsCSharp.UI.Overlay<SharpDXRenderer, SharpDX.Color, SharpDX.Vector2, TextFormat>.OverlayEventArgs e)
{
e.Overlay.Renderer.DrawText("YouGame.biz: Active", new SharpDX.Color(1f, 1f, 1f, 1f), new TextFormat(new SharpDX.DirectWrite.Factory(), "Agency FB", 14.0f), new SharpDX.Vector2(0, 0));
}
private static void overlay_TickEvent(object sender, SharpDXOverlay.DeltaEventArgs e)
{
seconds += e.SecondsElapsed;
//Update logic
KeyUtils.Update();
Overlay.UpdateControls(e.SecondsElapsed, KeyUtils);
//Process input
if (KeyUtils.KeyWentUp(WinAPI.VirtualKeyShort.INSERT))
{
Menu.Visible = !Menu.Visible;
cursor.Visible = !cursor.Visible;
}
//Update UI
if (seconds >= 1)
{
seconds = 0;
}
}
6) Добавим меню, табы, курсор, сам оверлэй, напель в табы, и ещё некоторые объекты
Код:
private const string Procces = "csgo";
private const string Procces_TITLE = "Counter-Strike: Global Offensive";
private static SharpDXOverlay Overlay;
private static SharpDXWindow Menu;
private static SharpDXTabControl tabcontrol;
private static SharpDXCursor cursor;
private static KeyUtils KeyUtils;
private static IntPtr hWnd;
private static double seconds = 0;
private static ProcUtils ProcUtils;
private static MemUtils MemUtils;
private static SharpDXPanel Visuals;
private static SharpDXButtonKey buttonkey;
private static SharpDXCheckBox checkbox;
private static SharpDXColorControl colorControl;
private static SharpDXComboValue<int> combovalue;
private static SharpDXLabel label;
private static SharpDXRadioButton radioButton;
private static SharpDXTrackbar trackbar;
private static SharpDXPanel Aim;
private static SharpDXPanel Legit;
private static SharpDXPanel Settings;
7) Инициализируем их
Код:
cursor = new SharpDXCursor();
Menu = new SharpDXWindow();
Menu.Caption.Text = "YouGame.biz";
Menu.X = 0;
Menu.DynamicWidth = true;
Menu.BackColor = new SharpDX.Color(1f, 1f, 1f, 1f);
tabcontrol = new SharpDXTabControl();
tabcontrol.BackColor = new SharpDX.Color(1f, 1f, 1f, 1f);
tabcontrol.DrawBorder = true;
tabcontrol.DynamicWidth = true;
tabcontrol.FillParent = false;
InitPanel(ref Visuals, "Visuals");
Visuals.ContentLayout = new TableLayout(1);
InitButtonKey(ref buttonkey, "Button key", "");
InitCheckBox(ref checkbox, "Check box", "", false);
InitColorControl(ref colorControl, "Color control", "", new Color(1f, 0f, 0f , 1f));
InitComboValue(ref combovalue, "Combo value", "", new Tuple<string, int>("First", 1), new Tuple<string, int>("Second", 2));
InitLabel(ref label, "Label", true);
InitRadioButton(ref radioButton, "Radio button", "", false);
InitTrackBar(ref trackbar, "Trackbar", "", 0, 180, 50, 2);
InitPanel(ref Aim, "You");
Aim.ContentLayout = new TableLayout(1);
InitPanel(ref Settings, "Game");
Settings.ContentLayout = new TableLayout(1);
InitPanel(ref Legit, "Biz");
Legit.ContentLayout = new TableLayout(1);
//Add items
tabcontrol.AddChildControl(Visuals);
tabcontrol.AddChildControl(Aim);
tabcontrol.AddChildControl(Settings);
tabcontrol.AddChildControl(Legit);
Menu.Panel.AddChildControl(tabcontrol);
Visuals.AddChildControl(label);
Visuals.AddChildControl(radioButton);
Visuals.AddChildControl(checkbox);
Visuals.AddChildControl(buttonkey);
Visuals.AddChildControl(combovalue);
Visuals.AddChildControl(trackbar);
Visuals.AddChildControl(colorControl);
Всё можно запускать - наше меню готово!!!
Пожалуйста, зарегистрируйтесь или авторизуйтесь, чтобы увидеть содержимое.
Последнее редактирование: