我对编码比较陌生。我想为游戏 Assault Cube 创建一个训练器。我已经实现了一个“无限弹药”选项,它工作得很好,现在我想做一个上帝模式(无限健康)选项。它不起作用,我不明白为什么。我已经从游戏中获取了正确的偏移量(用作弊引擎检查),我用弹药做的所有事情也和健康一起做,并添加了应该被冻结的新健康值。程序有问题吗?这是我的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Memory;
namespace AssaultHack
{
public partial class Form1 : Form
{
Mem meme = new Mem();
public static string RifleAmmo = "ac_client.exe+0x00109B74,150";
public static string PlayerHealth = "ac_client.exe+0x0010A280,338,34,98,8";
public Form1()
{
InitializeComponent();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
int PID = meme.GetProcIdFromName("ac_client");
if(PID > 0)
{
meme.OpenProcess(PID);
Thread WA = new Thread(writeAmmo) { IsBackground = true };
Thread PH = new Thread(godMode) { IsBackground = true };
PH.Start();
WA.Start();
}
}
private void writeAmmo()
{
while(true)
{
if (checkBox1.Checked)
{
meme.WriteMemory(RifleAmmo, "int", "99999");
Thread.Sleep(2);
}
Thread.Sleep(2);
}
}
private void checkBox2_CheckedChanged(object sender, EventArgs e)
{
}
private void godMode()
{
while(true)
{
if (checkBox2.Checked)
{
meme.WriteMemory(PlayerHealth, "int", "99999");
Thread.Sleep(2);
}
Thread.Sleep(2);
}
}
}
}