-
-
Notifications
You must be signed in to change notification settings - Fork 208
Functions List
-
Find a program's process ID via a name. Use task manager to find this.
getProcIDFromName("iw4sp"); //dont need to include .exe
- This function uses overloading so you can use either an integer (proc ID) or a string (process name). This opens a program's process by the process ID OR name. Returns true on success, returns false on failure. This function will check if the process is already open, and will check if it's running. You can use this in an infinite loop in a new thread.
- Ex1: OpenProcess(12345);
- Ex2: OpenProcess("MyGame.exe");
- Get code from ini file, or use the name string as your address and leave path empty.
- Ex1: getCode("myCheatCode", "file.ini");
- Ex2: getCode("module.dll+0x12345678,0x12,0x34,0x56");
- Triggers the CloseHandle function. This is not required when making a trainer.
bool ChangeProtection(string code, MemoryProtection newProtection, out MemoryProtection oldProtection, string file = "")
- Change protection on address.
- Removes anything from a string that is NOT between ASCII 32 and 126. See http://www.dotnetperls.com/ascii-table for ASCII numbers.
- Does exactly what sanitizeString does but breaks off after it hits something not between ASCII 32 and 126. Good for strings that carry on for too long.
-
Get address and move distance from starting address. Ex: Write integer 1, to 8 different addresses, 250 bytes apart.
for (i = 0; i < (8*250); i+=250){ IntPtr writeHere = MemLib.moveAddress("test", codeFile, i); MemLib.writeMemory(writeHere.ToString("X"), "int", "1"); }
- Write to pointer/offset. Returns false on failure, returns true on success. Setup.
TYPES: float, int, byte, 2bytes, bytes, long, string, double.
MemLib.writeMemory("godMode", "int", "1", codeFile); //with ini file
MemLib.writeMemory("module.dll+0x12345678,0x12,0x34,0x56", "int", "1"); //without ini file
-
Write to pointer/offset. Returns false on failure, returns true on success. Good for an array, like for a character's equipment inventory or something like that.
for (int i = 0; i < 40; i++) { int sNum = i * 6; MemLib.writeMove("item_slot1_qty", "byte", "99", sNum, codeFile); }
-
The FreezeValue function creates a thread with a loop that constantly writes the value to the address. This function uses the same arguments as the writeMemory function. UnFreezeValue will remove the address from the loop.
MemLib.FreezeValue(string address, string type, string value, string file = "") MemLib.UnFreezeValue(string address)
- There are lots of different functions to use to read memory. Use this wiki page https://github.com/erfg12/memory.dll/wiki/Read-Memory-Functions
-
Inject a dll file in to the process. Only used to trigger internal functions. Not for beginners.
MemLib.InjectDLL("myFile.dll");
-
An experimental function that creates a pipe between your program and the opened process to communicate through. This is used to trigger injected functions. Not for beginners.
Thread ClientThread = new Thread(() => MemLib.ThreadStartClient("warp", "myThread")); ClientThread.Start();
- Read the value in the .ini code file.
Ex: if your code file has SomeLabel=SomeCode
MemLib.LoadCode("SomeLabel", Application.StartupPath + @"\codes.ini");
Would return:
SomeCode
- Check if program is running with Administrative Privileges.
- Check if game is 64bit.