Hello. I'm in the process of creating a unlimited ammo hack which currently looks like this:
Code:
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
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 System.Diagnostics;
using Magic;
namespace CSSUtilities
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
UInt32 AmmoEnabled;
private void CheckAmmo(BlackMagic process, IntPtr BaseAddress)
{
byte ammo = process.ReadByte(0x17E1);
label1.Text = "Ammo: "+ammo;
if (ammo < 100)
FillAmmo(process, BaseAddress);
}
private void FillAmmo(BlackMagic process, IntPtr BaseAddress)
{
UInt32 Ammo = (UInt32)BaseAddress + 0x17E1;
process.WriteByte(Ammo, 200);
//CheckAmmo(process, BaseAddress);
}
private void EnableUnlimitedAmmo(BlackMagic process, IntPtr BaseAddress)
{
FillAmmo(process, BaseAddress);
}
private void button1_Click(object sender, EventArgs e)
{
var cssProc = (from Process p in Process.GetProcesses() where p.MainWindowTitle.Contains("Counter-Strike Source") select p.Id).FirstOrDefault();
BlackMagic css = new BlackMagic();
css.OpenProcessAndThread(cssProc);
IntPtr BaseCSS = css.MainModule.BaseAddress;
EnableUnlimitedAmmo(css, BaseCSS);
}
}
}
The problem with my hack is when I click button one, nothing happens! I'm pretty sure it's the right address as you can see on the picture below
Can anyone please help me? :-) Would be much appreciated.