Get the pointer of your variable, open the process via OpenProcess (API) and use WriteProcessMemory to write to the variable. If the address is not static make a sginature scan of it, (byte patterns are used, "x" for static, "?" for dynamic)