Dẫn nhập
Ở những bài trước, chúng ta đã cùng nhau scan các thông số cần thiết liên quan đến game MegamanX4. Trong bài này, Kteam sẽ hướng dẫn bạn cách
dùng C# để chỉnh bất tử máu . Bài hôm nay là bài quan trọng nhất cả khóa, vì có rất nhiều kiến thức được sử dụng như
DELEGATE , Design pattern,
MULTITHREAD ,
REF , ....Và được chắt lọc hệ thống rất kỹ lưỡng.
Megaman X4 là một tựa game rất thú vị gắn bó với mình một thời gian dài qua điện tử bấm, khi mà máy tính hay lập trình còn là gì đó vô cùng xa vời. Mình còn nhớ nguyên mấy tháng mùa hè dí đầu dí cổ vào game để luyện tay qua màn, mãi mà không
phá đảo được. Giờ vẫn còn cay! Vậy nên để thử thách bản thân, mình đã tạo ra một giải pháp giúp mình chinh phục "giấc mơ tuổi thơ này". Đó chính là
TOOL CHEAT GAME MEGAMAN X4 . :v :v :v
Nội dung
Để theo dõi bài này một cách tốt nhất bạn cần có kiến thức về:
Trong bài này, chúng ta sẽ tìm hiểu về
Phần mềm sử dụng
Tại thời điểm quay khóa này, mình sử dụng WPF nên phần mềm thông dụng sẽ là
Visual Studio 2019 . Bạn hoàn toàn có thể tải và sử dụng Visual Studio theo hướng dẫn bên trong bài
CÀI ĐẶT MÔI TRƯỜNG PHÁT TRIỂN IDE VISUAL STUDIO 2015 (không sử dụng phiên bản thấp hơn) hoặc CÀI ĐẶT MÔI TRƯỜNG PHÁT TRIỂN IDE VISUAL STUDIO
2019 .
Source code tham khảo
MainWindow.xaml
<Window x:Class ="MegamanUI.MainWindow"
xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x ="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d ="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc ="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local ="clr-namespace:MegamanUI"
mc:Ignorable ="d"
WindowStyle ="None"
Loaded ="Window_Loaded"
ResizeMode ="CanMinimize"
WindowStartupLocation ="CenterScreen"
Height ="350" Width ="550" >
<Window.Background >
<ImageBrush ImageSource ="Images/bg-kteam.png" > </ImageBrush >
</Window.Background >
<Grid >
<DockPanel PreviewMouseLeftButtonDown ="DockPanel_PreviewMouseLeftButtonDown"
HorizontalAlignment ="Stretch" LastChildFill ="False" VerticalAlignment ="Top" Background ="Transparent" Height ="25" >
<Image DockPanel.Dock ="Right" Source ="Images/x.png"
Cursor ="Hand"
PreviewMouseDown ="Image_PreviewMouseDown_1"
Margin ="0 0 15 0" >
<Image.Style >
<Style TargetType ="Image" >
<Setter Property ="Width " Value ="12"></Setter >
<Style .Triggers >
<Trigger Property ="Image .IsMouseOver " Value ="True ">
<Setter Property ="Width " Value ="15"></Setter >
</Trigger >
</Style .Triggers >
</Style >
</Image.Style >
</Image >
<Image DockPanel.Dock ="Right" Source ="Images/-.png"
PreviewMouseDown ="Image_PreviewMouseDown"
Margin ="0 0 10 0" Cursor ="Hand" >
<Image.Style >
<Style TargetType ="Image" >
<Setter Property ="Width " Value ="12"></Setter >
<Style .Triggers >
<Trigger Property ="Image .IsMouseOver " Value ="True ">
<Setter Property ="Width " Value ="15"></Setter >
</Trigger >
</Style .Triggers >
</Style >
</Image.Style >
</Image >
</DockPanel >
<Image Source ="Images/megaman-logo-kteam.png"
Height ="30"
Margin ="28 3 0 0"
Cursor ="Hand"
MouseDown ="Image_MouseDown_1"
HorizontalAlignment ="Left" VerticalAlignment ="Top" > </Image >
<Image Source ="Images/kteam-logo.png"
Height ="30"
Margin ="0 0 40 10"
Cursor ="Hand"
MouseDown ="Image_MouseDown_2"
HorizontalAlignment ="Right" VerticalAlignment ="Bottom" > </Image >
<Image Height ="220"
Margin ="0 0 40 10"
Cursor ="Hand"
MouseDown ="Image_MouseDown"
MouseEnter ="Image_MouseEnter"
HorizontalAlignment ="Center" VerticalAlignment ="Center" >
<Image.Style >
<Style TargetType ="Image" >
<Setter Property ="Source " Value ="Images /Megaman-Kteam .png "></Setter >
<Style .Triggers >
<MultiDataTrigger >
<MultiDataTrigger .Conditions >
<Condition Binding ="{Binding IsInjected}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="Source" Value="Images/Megaman-Gaea-Armor-Kteam.png"></Setter>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsInjected}" Value="False"></Condition>
<Condition Binding="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsMouseOver}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="Source" Value="Images/Megaman-Gaea-Armor-Kteam.png"></Setter>
</MultiDataTrigger>
</Style.Triggers>
</Style >
</Image.Style >
</Image >
<TextBlock FontFamily ="{StaticResource mainFont}"
Foreground ="#00FFFF"
VerticalAlignment ="Bottom"
HorizontalAlignment ="Center"
Margin ="0 0 170 5"
FontSize ="20" >
<TextBlock.Style >
<Style TargetType ="TextBlock" >
<Setter Property ="Text " Value ="Created by K9 "></Setter >
<Style .Triggers >
<EventTrigger RoutedEvent ="Window .Loaded ">
<BeginStoryboard Storyboard ="{StaticResource createStoryStart}"></BeginStoryboard>
</EventTrigger>
</Style.Triggers>
</Style >
</TextBlock.Style >
</TextBlock >
<Grid HorizontalAlignment ="Center"
VerticalAlignment ="Center"
Height ="90"
Width ="110"
Cursor ="Hand"
Margin ="0 0 280 130"
MouseDown ="Image_MouseDown_OneHitCreep"
MouseEnter ="Image_MouseEnter_OneHitCreep" >
<Image >
<Image.Style >
<Style TargetType ="Image" >
<Setter Property ="Source " Value ="Images /OneHitCreep /OneHitCreep-kteam .png "></Setter >
<Style .Triggers >
<MultiDataTrigger >
<MultiDataTrigger .Conditions >
<Condition Binding ="{Binding IsOneHitCreep}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="Source" Value="Images/OneHitCreep/OneHitCreep-Active-kteam.png"></Setter>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsOneHitCreep}" Value="False"></Condition>
<Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Grid}, Path=IsMouseOver}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="Source" Value="Images/OneHitCreep/OneHitCreep-Active-kteam.png"></Setter>
</MultiDataTrigger>
</Style.Triggers>
</Style >
</Image.Style >
</Image >
<StackPanel HorizontalAlignment ="Center"
Width ="50"
Cursor ="Hand"
Margin ="0 0 20 40"
VerticalAlignment ="Center" >
<TextBlock TextWrapping ="Wrap" TextAlignment ="Center" FontFamily ="{StaticResource mainFont}" >
<TextBlock.Style >
<Style TargetType ="TextBlock" >
<Setter Property ="Text " Value ="ONE HIT CREEP "></Setter >
<Setter Property ="Foreground " Value ="Gray "></Setter >
<Style .Triggers >
<MultiDataTrigger >
<MultiDataTrigger .Conditions >
<Condition Binding ="{Binding IsOneHitCreep}" Value="False"></Condition>
<Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Grid}, Path=IsMouseOver}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="#00FFFF"></Setter>
<MultiDataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource oneHitStoryStart}"></BeginStoryboard>
</MultiDataTrigger.EnterActions>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsOneHitCreep}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="#00FFFF"></Setter>
<MultiDataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource oneHitStoryStart}"></BeginStoryboard>
</MultiDataTrigger.EnterActions>
</MultiDataTrigger>
</Style.Triggers>
</Style >
</TextBlock.Style >
</TextBlock >
</StackPanel >
</Grid >
<Grid HorizontalAlignment ="Center"
VerticalAlignment ="Center"
Height ="90"
Width ="110"
Cursor ="Hand"
Margin ="0 100 280 0"
MouseDown ="Image_MouseDown_FullLife"
MouseEnter ="Image_MouseEnter_FullLife" >
<Image >
<Image.Style >
<Style TargetType ="Image" >
<Setter Property ="Source " Value ="Images /FullLife /0%-FullLife-kteam .png "></Setter >
<Style .Triggers >
<MultiDataTrigger >
<MultiDataTrigger .Conditions >
<Condition Binding ="{Binding IsFullLife}" Value="False"></Condition>
<Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Grid}, Path=IsMouseOver}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource fullLifeImageStoryStart}"></BeginStoryboard>
</MultiDataTrigger.EnterActions>
<MultiDataTrigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource fullLifeImageStoryEnd}"></BeginStoryboard>
</MultiDataTrigger.ExitActions>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsFullLife}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource fullLifeImageStoryStart}"></BeginStoryboard>
</MultiDataTrigger.EnterActions>
<MultiDataTrigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource fullLifeImageStoryEnd}"></BeginStoryboard>
</MultiDataTrigger.ExitActions>
</MultiDataTrigger>
</Style.Triggers>
</Style >
</Image.Style >
</Image >
<StackPanel HorizontalAlignment ="Center"
Width ="70"
Cursor ="Hand"
Margin ="0 0 30 10"
VerticalAlignment ="Bottom" >
<TextBlock TextWrapping ="Wrap" TextAlignment ="Center" FontFamily ="{StaticResource mainFont}" >
<TextBlock.Style >
<Style TargetType ="TextBlock" >
<Setter Property ="Text " Value ="FULL LIFE "></Setter >
<Setter Property ="Foreground " Value ="Gray "></Setter >
<Style .Triggers >
<MultiDataTrigger >
<MultiDataTrigger .Conditions >
<Condition Binding ="{Binding IsFullLife}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="#F300C6"></Setter>
<MultiDataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource fullLifeStoryStart}"></BeginStoryboard>
</MultiDataTrigger.EnterActions>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsFullLife}" Value="False"></Condition>
<Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Grid}, Path=IsMouseOver}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="#F300C6"></Setter>
<MultiDataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource fullLifeStoryStart}"></BeginStoryboard>
</MultiDataTrigger.EnterActions>
</MultiDataTrigger>
</Style.Triggers>
</Style >
</TextBlock.Style >
</TextBlock >
</StackPanel >
</Grid >
<Grid HorizontalAlignment ="Center"
VerticalAlignment ="Center"
Height ="110"
Cursor ="Hand"
Margin ="250 0 0 110"
MouseDown ="Image_MouseDown_OneHitBoss"
MouseEnter ="Image_MouseEnter_OneHitBoss" >
<Image >
<Image.Style >
<Style TargetType ="Image" >
<Setter Property ="Source " Value ="Images /OneHitBoss /OneHitBoss-kteam .png "></Setter >
<Style .Triggers >
<MultiDataTrigger >
<MultiDataTrigger .Conditions >
<Condition Binding ="{Binding IsOneHitBoss}" Value="False"></Condition>
<Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Grid}, Path=IsMouseOver}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="Source" Value="Images/OneHitBoss/OneHitBoss-active-kteam.png"></Setter>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsOneHitBoss}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="Source" Value="Images/OneHitBoss/OneHitBoss-active-kteam.png"></Setter>
</MultiDataTrigger>
</Style.Triggers>
</Style >
</Image.Style >
</Image >
<StackPanel HorizontalAlignment ="Center"
Width ="50"
Cursor ="Hand"
Margin ="30 20 0 0"
VerticalAlignment ="Center" >
<TextBlock TextWrapping ="Wrap" TextAlignment ="Center" FontFamily ="{StaticResource mainFont}" >
<TextBlock.Style >
<Style TargetType ="TextBlock" >
<Setter Property ="Text " Value ="ONE HIT BOSS "></Setter >
<Setter Property ="Foreground " Value ="Gray "></Setter >
<Style .Triggers >
<MultiDataTrigger >
<MultiDataTrigger .Conditions >
<Condition Binding ="{Binding IsOneHitBoss}" Value="False"></Condition>
<Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Grid}, Path=IsMouseOver}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="#00FFFF"></Setter>
<MultiDataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource oneHitBossStoryStart}"></BeginStoryboard>
</MultiDataTrigger.EnterActions>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsOneHitBoss}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="#00FFFF"></Setter>
<MultiDataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource oneHitBossStoryStart}"></BeginStoryboard>
</MultiDataTrigger.EnterActions>
</MultiDataTrigger>
</Style.Triggers>
</Style >
</TextBlock.Style >
</TextBlock >
</StackPanel >
</Grid >
<Grid HorizontalAlignment ="Center"
VerticalAlignment ="Center"
Height ="55"
Cursor ="Hand"
Margin ="250 130 0 0"
MouseDown ="Image_MouseDown_Imotal"
MouseEnter ="Image_MouseEnter_Imotal" >
<Image >
<Image.Style >
<Style TargetType ="Image" >
<Setter Property ="Source " Value ="Images /Imotal /0%-imotal-kteam .png "></Setter >
<Style .Triggers >
<MultiDataTrigger >
<MultiDataTrigger .Conditions >
<Condition Binding ="{Binding IsImotal}" Value="False"></Condition>
<Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Grid}, Path=IsMouseOver}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource imotalImageStoryStart}"></BeginStoryboard>
</MultiDataTrigger.EnterActions>
<MultiDataTrigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource imotalImageStoryEnd}"></BeginStoryboard>
</MultiDataTrigger.ExitActions>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsImotal}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource imotalImageStoryStart}"></BeginStoryboard>
</MultiDataTrigger.EnterActions>
<MultiDataTrigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource imotalImageStoryEnd}"></BeginStoryboard>
</MultiDataTrigger.ExitActions>
</MultiDataTrigger>
</Style.Triggers>
</Style >
</Image.Style >
</Image >
<StackPanel HorizontalAlignment ="Right"
Width ="100"
Cursor ="Hand"
Margin ="0 0 6 6"
VerticalAlignment ="Bottom" >
<TextBlock TextWrapping ="Wrap"
FontSize ="18"
TextAlignment ="Right"
FontFamily ="{StaticResource mainFont}" >
<TextBlock.Style >
<Style TargetType ="TextBlock" >
<Setter Property ="Text " Value ="IMOTAL "></Setter >
<Setter Property ="Foreground " Value ="Gray "></Setter >
<Style .Triggers >
<MultiDataTrigger >
<MultiDataTrigger .Conditions >
<Condition Binding ="{Binding IsImotal}" Value="False"></Condition>
<Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Grid}, Path=IsMouseOver}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="#F15A24"></Setter>
<MultiDataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource imotalStoryStart}"></BeginStoryboard>
</MultiDataTrigger.EnterActions>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsImotal}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="#F15A24"></Setter>
<MultiDataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource imotalStoryStart}"></BeginStoryboard>
</MultiDataTrigger.EnterActions>
</MultiDataTrigger>
</Style.Triggers>
</Style >
</TextBlock.Style >
</TextBlock >
</StackPanel >
</Grid >
<Grid Visibility ="{Binding IsQuitBoxShow}" >
<Grid Background ="Blue" Opacity ="0.4" > </Grid >
<Grid Height ="150" Margin ="0 0 0 50"
HorizontalAlignment ="Center" VerticalAlignment ="Center" >
<Image Source ="Images/alert-box-kteam.png" Opacity ="0.7" > </Image >
<TextBlock Text ="ARE YOU SURE YOU WANT TO QUIT?"
HorizontalAlignment ="Center"
VerticalAlignment ="Center"
Width ="180"
TextAlignment ="Center"
Foreground ="#D83E1A"
TextWrapping ="Wrap"
FontSize ="15" FontFamily ="{StaticResource mainFont}" > </TextBlock >
<StackPanel Orientation ="Horizontal" Margin ="0 0 20 20" HorizontalAlignment ="Right" VerticalAlignment ="Bottom" >
<TextBlock MouseDown ="TextBlock_MouseDown" Cursor ="Hand" FontSize ="15" Text ="YES" FontFamily ="{StaticResource mainFont}" Foreground ="#D83E1A" > </TextBlock >
<TextBlock FontSize ="15" Text ="/" FontFamily ="{StaticResource mainFont}" Foreground ="WhiteSmoke" > </TextBlock >
<TextBlock MouseDown ="TextBlock_MouseDown_1" Cursor ="Hand" FontSize ="15" Text ="NO" FontFamily ="{StaticResource mainFont}" Foreground ="WhiteSmoke" > </TextBlock >
</StackPanel >
</Grid >
</Grid >
</Grid >
</Window >
MainWindow.xaml.cs
using KAutoHelper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Media;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace MegamanUI
{
public partial class MainWindow : Window,INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged ([CallerMemberName] string propertyName = null )
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null )
handler(this , new PropertyChangedEventArgs(propertyName));
}
#region properties
private Visibility _IsQuitBoxShow;
public Visibility IsQuitBoxShow
{
get => _IsQuitBoxShow;
set
{
_IsQuitBoxShow = value ;
OnPropertyChanged();
}
}
private bool _IsInjected;
public bool IsInjected
{
get => _IsInjected;
set
{
_IsInjected = value ;
OnPropertyChanged();
}
}
private bool _IsOneHitCreep;
public bool IsOneHitCreep
{
get => _IsOneHitCreep;
set
{
_IsOneHitCreep = value ;
OnPropertyChanged();
}
}
private bool _IsOneHitBoss;
public bool IsOneHitBoss
{
get => _IsOneHitBoss;
set
{
_IsOneHitBoss = value ;
OnPropertyChanged();
}
}
private bool _IsFullLife;
public bool IsFullLife
{
get => _IsFullLife;
set
{
_IsFullLife = value ;
OnPropertyChanged();
PlayerFullLife();
}
}
private bool _IsImotal;
public bool IsImotal
{
get => _IsImotal;
set
{
_IsImotal = value ;
OnPropertyChanged();
}
}
private IntPtr _Handle;
public IntPtr Handle
{
get => _Handle;
set
{
_Handle = value ;
IsInjected = Handle != IntPtr.Zero;
}
}
delegate void ThreadToStart();
Thread _PlayerMaxHPThread;
SoundPlayer sp_active;
SoundPlayer sp_hover;
SoundPlayer sp_megaman;
#endregion
public MainWindow ()
{
InitializeComponent();
this .DataContext = this ;
FirstLoad();
}
#region methods
void FirstLoad()
{
IsInjected = false ;
IsQuitBoxShow = Visibility.Hidden;
LoadSound();
}
void LoadSound()
{
sp_active = new SoundPlayer(Properties.Resources.hover_2);
sp_hover = new SoundPlayer(Properties.Resources.hover);
sp_megaman = new SoundPlayer(Properties.Resources.megaman);
}
void PlaySoundMegaman()
{
sp_megaman.Play();
}
void PlaySoundActive()
{
sp_active.Play();
}
void PlaySoundHover()
{
sp_hover.Play();
}
void PlayerFullLife()
{
StartThread(ref _PlayerMaxHPThread, IsFullLife, () => {
IntPtr entryPlayerHPPoint = IntPtr.Add(Handle, 0x144F5C );
var offset = 0x00544F5C ;
while (true )
{
MemoryHelper.WriteInt(Handle, entryPlayerHPPoint, (uint )offset, 2905376 );
Thread.Sleep(10 );
}
});
}
void StartThread(ref Thread thread, bool checkFlag, ThreadToStart func)
{
if (checkFlag)
{
if (thread != null )
{
try
{
thread.Abort();
}
catch { }
}
thread = new Thread(()=> { func(); });
thread.IsBackground = true ;
thread.Start();
}
else
{
if (thread != null )
{
try
{
thread.Abort();
thread = null ;
}
catch { }
}
}
}
void LoadHandle()
{
var nProcess = Process.GetProcesses().Where(p=>p.ProcessName.Contains("MegaManX4" )).ToList();
if (nProcess.Count > 0 )
{
Handle = MemoryHelper.OpenProcess(nProcess[0 ].Id);
}
else
{
Handle = IntPtr.Zero;
}
}
#endregion
#region events
private void DockPanel_PreviewMouseLeftButtonDown (object sender, MouseButtonEventArgs e)
{
base .OnMouseLeftButtonDown(e);
this .DragMove();
}
private void Image_PreviewMouseDown (object sender, MouseButtonEventArgs e)
{
WindowState = WindowState.Minimized;
}
private void Image_PreviewMouseDown_1 (object sender, MouseButtonEventArgs e)
{
IsQuitBoxShow = Visibility.Visible;
}
private void Image_MouseDown (object sender, MouseButtonEventArgs e)
{
LoadHandle();
PlaySoundActive();
}
private void Image_MouseEnter (object sender, MouseEventArgs e)
{
if (!IsInjected)
PlaySoundHover();
}
private void Image_MouseDown_OneHitCreep (object sender, MouseButtonEventArgs e)
{
IsOneHitCreep = !IsOneHitCreep;
PlaySoundActive();
}
private void Image_MouseEnter_OneHitCreep (object sender, MouseEventArgs e)
{
if (!IsOneHitCreep)
PlaySoundHover();
}
private void Image_MouseDown_OneHitBoss (object sender, MouseButtonEventArgs e)
{
IsOneHitBoss = !IsOneHitBoss;
PlaySoundActive();
}
private void Image_MouseEnter_OneHitBoss (object sender, MouseEventArgs e)
{
if (!IsOneHitBoss)
PlaySoundHover();
}
private void Image_MouseDown_FullLife (object sender, MouseButtonEventArgs e)
{
IsFullLife = !IsFullLife;
PlaySoundActive();
}
private void Image_MouseEnter_FullLife (object sender, MouseEventArgs e)
{
if (!IsFullLife)
PlaySoundHover();
}
private void Image_MouseDown_Imotal (object sender, MouseButtonEventArgs e)
{
IsImotal = !IsImotal;
PlaySoundActive();
}
private void Image_MouseEnter_Imotal (object sender, MouseEventArgs e)
{
if (!IsImotal)
PlaySoundHover();
}
#endregion
private void Image_MouseDown_1 (object sender, MouseButtonEventArgs e)
{
if (!IsInjected)
{
LoadHandle();
if (IsInjected)
{
IsOneHitBoss = true ;
IsOneHitCreep = true ;
IsFullLife = true ;
IsImotal = true ;
}
else
{
IsOneHitBoss = false ;
IsOneHitCreep = false ;
IsFullLife = false ;
IsImotal = false ;
}
}
else
{
IsOneHitBoss = !IsOneHitBoss;
IsOneHitCreep = !IsOneHitCreep;
IsFullLife = !IsFullLife;
IsImotal = !IsImotal;
}
PlaySoundMegaman();
}
private void Image_MouseDown_2 (object sender, MouseButtonEventArgs e)
{
Process.Start("https://www.howkteam.vn/" );
}
private void TextBlock_MouseDown (object sender, MouseButtonEventArgs e)
{
this .Close();
}
private void TextBlock_MouseDown_1 (object sender, MouseButtonEventArgs e)
{
IsQuitBoxShow = Visibility.Hidden;
}
private void Window_Loaded (object sender, RoutedEventArgs e)
{
LoadHandle();
}
}
}
Assest file
Nhằm giúp bạn có thể trải nghiệm hiệu ứng tool một cách tốt nhất, và chủ động trong việc sử dụng source. Kteam hỗ trợ full source code và các file liên quan tại phần
ASSEST bên dưới nhé
Trong file này có gì???
Lưu ý: File này khác hoàn toàn file Assest khóa Megaman UI trước đó.
KAutoHelper.dll : File thư viện hỗ trợ của Kteam phát triển. Có class MemoryHelper hỗ trợ thao tác với memory
Project.rar : File project hoàn chỉnh (Lưu ý nếu báo sai đường dẫn thư viện thì xóa References KAutoHelper.dll rồi add lại)
Project_UI.rar : File Project chưa có code xử lý cheat(Chỉ có UI. Xem series Megaman UI để nắm rõ hơn)
Megaman Cheat build.rar : File auto cheat hoàn chỉnh. Mở file exe lên mà chơi thôi
Cách dùng: mở game sẵn, vào màn chơi. Mở tool lên. Nhấn vào nhân vật để kết nối với game sau đó nhấn vào các chức năng mong muốn là được.
Hoặc đơn giản hơn là nhấn vào logo MegamanX4 góc trên trái và chơi
MegamanX4 game install.exe :File cài đặt game
Kết
Qua bài này, Kteam đã hướng dẫn các bạn cách dùng C# chỉnh bất tử máu.
Ở bài sau, chúng ta sẽ cùng tìm hiểu cách
DÙNG C# CHỈNH FULL MẠNG
Cảm ơn các bạn đã theo dõi bài viết. Hãy để lại bình luận hoặc góp ý của mình để phát triển bài viết tốt hơn. Đừng quên “Luyện tập – Thử Thách – Không ngại khó ”
Tải xuống
Tài liệu
Nhằm phục vụ mục đích học tập Offline của cộng đồng, Kteam hỗ trợ tính năng lưu trữ nội dung bài học Dùng C# chỉnh bất tử máu dưới dạng file PDF trong link bên dưới.
Ngoài ra, bạn cũng có thể tìm thấy các tài liệu được đóng góp từ cộng đồng ở mục TÀI LIỆU trên thư viện Howkteam.com
Đừng quên like và share để ủng hộ Kteam và tác giả nhé!
Project
Nếu việc thực hành theo hướng dẫn không diễn ra suôn sẻ như mong muốn. Bạn cũng có thể tải xuống PROJECT THAM KHẢO ở link bên dưới!
Thảo luận
Nếu bạn có bất kỳ khó khăn hay thắc mắc gì về khóa học, đừng ngần ngại đặt câu hỏi trong phần BÌNH LUẬN bên dưới hoặc trong mục HỎI & ĐÁP trên thư viện Howkteam.com để nhận được sự hỗ trợ từ cộng đồng.
k có offset thì làm ntn ạ