THIS IS AS FAR AS I REACH:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Globalization;
using System.Threading;
namespace VirtuaCop_2_Trainer
{
public partial class Form1 : Form
{
#region Global Variables
Memory mymemory = new Memory();
Process[] myprocess;
bool IsGameavailable = false;
bool UnlimitedAmmo = false;
string AmmoPointer = "004CF1AC";
int[] AmmoOffset = {0*28};
int AmmoToFill = 6;
#endregion
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
}
private void UnlimitedAmmoBTN_Click(object sender, EventArgs e)
{
if (IsGameavailable)
{
if (UnlimitedAmmo)
{
UnlimitedAmmo = false;
UnlimitedAmmoBTN.Text = "1.OFF";
}
else
{
UnlimitedAmmo = true;
UnlimitedAmmoBTN.Text = "1.ON";
}
}
}
private void GameAvailabilityTimer_Tick(object sender, EventArgs e)
{
myprocess = Process.GetProcessesByName("VCop2");
if (myprocess.Length > 0)
{
IsGameavailable = true;
Statuslabel.Text = "Status VCop2 is availalbe";
}
else
{
IsGameavailable = false;
Statuslabel.Text = "Status VCop2 is not availalbe";
}
}
private void UpdateCheatTimer_Tick(object sender, EventArgs e)
{
if (IsGameavailable)
{
#region unlimited Ammo
if(UnlimitedAmmo)
{
mymemory.ReadProcess = myprocess[0];
mymemory.Open();
int pointerAddress = HexToDec(AmmoPointer);
int [] pointerOffset = AmmoOffset;
int byteswritten;
byte[] valueToWrite = ByteConverter.GetByte(AmmoToFill);
string writtenaddress = mymemory.PointerWrite((IntPtr)pointerAddress, valueToWrite, pointerOffset,out byteswritten);
mymemory.CloseHandle();
}
#endregion
}
}
public static string HexToDec(int Dec)
{
return Dec.ToString("x");
}
public static int HexToDec(string Hex)
{
return int.Parse (Hex, NumberStyles.HexNumber);
}
}
}