using System;
// required for 'ProcessAccressor'
// also includes extensions...
using SorpzFramework.Diagnostics;
namespace Custom {
class Program {
static void Main(string[] args) {
// getting the target process (worst way to do it, but simplest for samplecode)
Process target = Process.GetProcessesByName("hl2")[0];
// creating 'ProcessAccessor' to modify target process
using (var accessor = new ProcessAccessor(target)) {
IntPtr clientModule;
// getting base of 'client.dll' module
if (accessor.IsModuleReady("client.dll"))
clientModule = accessor.GetModuleBaseAddress("client.dll");
// activating 'r_drawothermodels'...
accessor.WriteMemory<int>(clientModule + 0x53C270, 2);
}
return;
}
}
}
using System;
// required for 'ProcessAccressor'
// also includes extensions...
using SorpzFramework.Diagnostics;
namespace Custom {
class Program {
static void Main(string[] args) {
// getting the target process (worst way to do it, but simplest for samplecode)
Process target = Process.GetProcessesByName("hl2")[0];
IntPtr clientModule;
if (target.IsModuleReady("client.dll"))
clientModule = target.BaseOf("client.dll");
// sets the value of 'r_drawothermodels' to 2 for simple wire wallhack
target.WriteMem<int>(clientModule + 0x53C270, 2);
return;
}
}
}
using System;
// required for 'ProcessAccressor'
// also includes extensions...
using SorpzFramework.Diagnostics;
namespace Custom {
class Program {
static ProcessAccessor someAccessor;
static void Main(string[] args) {
// getting the target process (worst way to do it, but simplest for samplecode)
Process target = Process.GetProcessesByName("hl2")[0];
IntPtr clientModule;
if (target.IsModuleReady("client.dll"))
clientModule = target.BaseOf("client.dll");
// setting up accessor
someAccessor = new ProcessAccessor(target);
// binding event
someAccessor.BreakpointAccessed += new EventHandler<ProcessBreakEventArgs>(BreakpointAccessed);
// setting breakpoint
someAccessor.SetBreakpoint(target.ReadMem<int>(clientModule + 0x53FB04) + 0x90, sizeof(int));
return;
}
static void BreakpointAccessed(object sender, ProcessBreakEventArgs e) {
// shows the health as soon as it changes
Console.WriteLine(string.Format("Health changed from {0} to {1}..", e.LastValue, e.CurrentValue));
}
}
}
I'm happy to see someone who's trying

// not initialized.. IntPtr clientModule;
// this will be the right one.. IntPtr clientModule = IntPtr.Zero;

, but i asked about using SorpzFramework.Diagnostics;