[SorpzFramework.Diagnostics] ProcessAccessor
ProcessAccessor
by sorpz
Hey community,by sorpz
today I want to bring you my finally finished and almost stable project "ProcessAccessor". The Idea behind this project is to simplefy all the complex stuff you'll have to do creating hacks, mods or whatever like importing api functions. This isn't needed anymore. Just use this easy type structures to get along with it. So let's start with the main features of it...
As usual for a accessor you could read and write memory to your target process. On the one hand you could use the known methods like 'ReadMemoryInteger(), ReadMemoryDouble(), etc' on the other I'm giving you the ability to use something called typeparameters which will be used like ' ReadMemory<T>()' or 'WriteMemory<T>()'. The parameter 'T' is limited to struct types only better known as value or non-nullable types. Therefore there aren't the possibiliy to use them with 'string' or array types. But the class is including other methods to handle those types..
In addition to the read and write features there are also functions to freeze and break the memory handled. I think you know what "freezing" memory means so let me explain the "breaking". By "breaking" memory you'll simply set breakpoints. If the memoryaddress the breakpoint is located at changes its value the "ProcessAccessor" will raise an event holding data like 'LastValue' and 'CurrentValue'. Enough explaining stuff. I'll get you some example code now...
(for more information about the features & methods, etc check the class diagramm attached...)
Samplecode # 1 (Basics)
Code:
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;
}
}
}
(code converted using BBThreadPostHighlighter type - http://www.mpgh.net/forum/160-progra...sts-sorpz.html)
Samplecode # 2 (Extensions)
Code:
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;
}
}
}
(code converted using BBThreadPostHighlighter type - http://www.mpgh.net/forum/160-progra...sts-sorpz.html)
Samplecode # 3 (Breakpoints)
Code:
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));
}
}
}
(code converted using BBThreadPostHighlighter type - http://www.mpgh.net/forum/160-progra...sts-sorpz.html)
Note: For specified information about something included in the 'ProcessAccessor' type see the documentation appearing while coding..
Virusscans
Virustotal: https://www.virustotal.com/en/file/6...is/1376616537/
Jotti: http://virusscan.jotti.org/de/scanre...d7e88801501597
Credits
Sorpz (me) - SorpzFramework...

I'm happy to see someone who's trying 