C# Unlimited Ammo Hack (CSS)
Hello, I'm currently writing my own unlimited ammo hack for CSS and I've located the right memory address using cheat engine (it even works when I edit it in there) but my program keeps closing out on my and it's not really giving me ammo, so I hope any of you can help me on my quest to make my first hack work. Here's the code:
Code:
namespace CSSUnlimitedAmmo
{
class Program
{
static void Main(string[] args)
{
CheckAmmo();
}
static void FillAmmo()
{
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;
css.WriteInt((uint)BaseCSS + 0xCA1654, 10);
Console.WriteLine("Maxed out ammo!");
}
static void CheckAmmo()
{
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;
uint Ammo = css.ReadUInt((uint)BaseCSS + 0xCA1654);
if (Ammo <= 10)
{
FillAmmo();
}
else
{
Console.WriteLine("We need no ammo, checking again!");
CheckAmmo();
}
}
}
}

but with no luck... anyone have any idea why?