[C#] Having some trouble with Glow.

Posts 1–7 of 7 · Page 1 of 1
[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
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);
This is my WriteInt method
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);
		}
This is my WriteBool method
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);
		}
For addresses/offsets, here's what I have:
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);
This is my ReadInt method
Code:
public static int ReadInt(int address)
		{
			byte[] arr = new byte[4];
			ReadProcessMemory(procHandle, address, arr, 4, 0);
			return BitConverter.ToInt32(arr, 0);
		}
And not sure if this is relevant but this is my import for WriteProcessMemory
Code:
[DllImport("kernel32.dll")]
		public static extern bool WriteProcessMemory(int hProcess, int lpBaseAddress, byte[] lpBuffer, uint nSize, out IntPtr lpNumberOfBytesWritten);
We need complete code of your Glow ESP including every loop you have there.
The 4 ints you write are actually floats.
Quote Originally Posted by Graaff View Post
We need complete code of your Glow ESP including every loop you have there.
Yeah I noticed that just now, haha sorry.
Code:
					for (var i = 0; i < 65; i++)
					{
						int curP = ReadInt(Client + (int)_entityList + (i - 1) * 16);
						int playerGI = ReadInt(curP + GlowIndex);

						
						WriteInt(GlowObject + (playerGI * 0x34 + 0x4), 1);
						WriteInt(GlowObject + (playerGI * 0x34 + 0x8), 0);
						WriteInt(GlowObject + (playerGI * 0x34 + 0xC), 0);
						WriteInt(GlowObject + (playerGI * 0x34 + 0x10), 1);
						WriteBool(GlowObject + (playerGI * 0x34 + 0x24), true);
						WriteBool(GlowObject + (playerGI * 0x34 + 0x25), false);
					}
					Thread.Sleep(10);
That's the only loop I have, I changed a variable there on playerGI to get the glow index of each item I'm looping over, is this correct?

Quote Originally Posted by Merccy2 View Post
The 4 ints you write are actually floats.
So how do I change my method to write the floats properly instead of what it is now?
Quote Originally Posted by fullweeb View Post
Yeah I noticed that just now, haha sorry.
Code:
					for (var i = 0; i < 65; i++)
					{
						int curP = ReadInt(Client + (int)_entityList + (i - 1) * 16);
						int playerGI = ReadInt(curP + GlowIndex);

						
						WriteInt(GlowObject + (playerGI * 0x34 + 0x4), 1);
						WriteInt(GlowObject + (playerGI * 0x34 + 0x8), 0);
						WriteInt(GlowObject + (playerGI * 0x34 + 0xC), 0);
						WriteInt(GlowObject + (playerGI * 0x34 + 0x10), 1);
						WriteBool(GlowObject + (playerGI * 0x34 + 0x24), true);
						WriteBool(GlowObject + (playerGI * 0x34 + 0x25), false);
					}
					Thread.Sleep(10);
That's the only loop I have, I changed a variable there on playerGI to get the glow index of each item I'm looping over, is this correct?


So how do I change my method to write the floats properly instead of what it is now?
Change WriteInt to WriteFloat and pass a float instead of an int.
Quote Originally Posted by fullweeb View Post
~snip~
Without looking any further into your code,

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);
is wrong in 2 ways; the first one being that you're writing int's, the other one being that your math is wrong on this. With your code you're trying to locate the correct entity in the CUtlVector. The size of the GlowObjectDefinition_t structure changed from 52 bytes to 56 bytes. Change your GlowIndex * 0x34 to GlowIndex * 0x38.
1 week has passed and no further replies have been made by the OP. Assuming solved.

/Closed.
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?