Skip to content
Jacob Fliss edited this page May 12, 2022 · 5 revisions
bool writeMemory(string code, string type, string write, string file = "")

code = The memory address or INI file label.

type = byte, 2bytes, bytes, float, int, string, double or long

write = must be in string format, but you can write whatever as long as the type is set.

file = Path with INI file name. (OPTIONAL)

Write byte

MemLib.writeMemory("0x006163DB","byte", "0xEB");

Write bytes

MemLib.writeMemory("0x006163DB","bytes", "0xEB 0xF9");

Write float

MemLib.writeMemory("0x006163DB", "float", "50.55");

Write integer

MemLib.writeMemory("0x006163DB", "int", "100");

Write string

MemLib.writeMemory("0x006163DB", "string", "This is a test");

Write long

MemLib.writeMemory("0x006163DB", "long", "0x012345678910");

Freeze Value / UnFreeze Value

more info: 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)

Change Protection

More Info: Cheat Engine memory browse will show you if the section of memory is write protected. If it is, we can use this function to remove the write protection. MemLib.ChangeProtection(string code, MemoryProtection newProtection, out MemoryProtection oldProtection, string file = "")


EXAMPLE INI FILE

more info: writing an ini file

codes.ini

health=game.exe+0x006163DB,0x455,0x54,0xC455

C# code

MemLib.writeMemory("health", "int", "100", Environment.CurrentDirectory + @"\codes.ini");

EXAMPLE MODULE+POINTER+OFFSET+OFFSET+OFFSET

MemLib.writeMemory("game.exe+0x006163DB,0x455,0x54,0xC455", "int", "100");

EXAMPLE SUCCESS CHECK

if (MemLib.writeMemory("game.exe+0x006163DB,0x455,0x54,0xC455", "int", "100")){
    MessageBox.Show("Memory Write Was Successful!");
} else {
    MessageBox.Show("Memory Write Was NOT Successful.");
}