[C#] Having some trouble with Glow.
So I'm trying to make an external glow in C#, currently I'm not even sure what's working and what's not. I've been at it for a while now and haven't managed to get anything working, and at this point I can't see any errors in my own code from staring at it for so long lol. So any help would be absolutely amazing.
This is what I'm doing to write to memory
This is my WriteInt method
This is my WriteBool method
For addresses/offsets, here's what I have:
This is my ReadInt method
And not sure if this is relevant but this is my import for WriteProcessMemory
This is what I'm doing to write to memory
Code:
WriteInt(GlowObject + (GlowIndex * 0x34 + 0x4), 1); WriteInt(GlowObject + (GlowIndex * 0x34 + 0x8), 0); WriteInt(GlowObject + (GlowIndex * 0x34 + 0xC), 0); WriteInt(GlowObject + (GlowIndex * 0x34 + 0x10), 1); WriteBool(GlowObject + (GlowIndex * 0x34 + 0x24), true); WriteBool(GlowObject + (GlowIndex * 0x34 + 0x25), false);
Code:
public static void WriteInt(int address, int value)
{
byte[] arr = BitConverter.GetBytes(value);
IntPtr n = IntPtr.Zero;
WriteProcessMemory(procHandle, address, arr, (UInt32)arr.Length, out n);
}
Code:
public static void WriteBool(int address, bool val)
{
byte[] arr = BitConverter.GetBytes(val);
IntPtr n = IntPtr.Zero;
WriteProcessMemory(procHandle, address, arr, (UInt32)arr.Length, out n);
}
Code:
int client = (int)Module.BaseAddress; const int _entityList = 0x4A9F8C4; const int _glowIndex = 0x0000A310; const int _glowObject = 0x4FB576C; int GlowObject = ReadInt(client + _glowObject); int GlowIndex = ReadInt(_entityList + _glowIndex);
Code:
public static int ReadInt(int address)
{
byte[] arr = new byte[4];
ReadProcessMemory(procHandle, address, arr, 4, 0);
return BitConverter.ToInt32(arr, 0);
}
Code:
[DllImport("kernel32.dll")]
public static extern bool WriteProcessMemory(int hProcess, int lpBaseAddress, byte[] lpBuffer, uint nSize, out IntPtr lpNumberOfBytesWritten);
