Created
July 21, 2016 19:32
-
-
Save lolp1/2ee6d5a0a202947ce5219ae698ac1142 to your computer and use it in GitHub Desktop.
Memory example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Memory | |
{ | |
private static IProcess _process; | |
public static IMemory Instance { get; private set; } | |
public static IProcess Process | |
{ | |
get { return _process; } | |
private set | |
{ | |
_process = value; | |
Instance = _process.Memory; | |
} | |
} | |
public static void Attach(string processName) | |
{ | |
var processesByName = System.Diagnostics.Process.GetProcessesByName(processName); | |
var process = processesByName.FirstOrDefault(); | |
if (process != null) | |
{ | |
// Remote = you are not injected to the games memory space | |
// Local = you are injected into the games memory space | |
Process = new ProcessSharp(process, MemoryType.Remote); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment