static void DrawGlow()
{
Swed swed = new Swed("cs2");
IntPtr client = swed.GetModuleBase("client.dll");
int dwGlowObjectManager = 0x...; // offset to glow object manager
int m_iGlowIndex = 0x...; // offset to glow index
IntPtr glowObjectManager = swed.ReadPointer(client, dwGlowObjectManager);
for (int i = 0; i < 64; i++)
{
IntPtr entity = swed.ReadPointer(entityList, i * 0x10);
int glowIndex = swed.ReadInt(entity, m_iGlowIndex);
if (glowIndex == -1)
continue;
swed.WriteFloat(glowObjectManager + (glowIndex * 0x38) + 0x8, 1.0f); // r
swed.WriteFloat(glowObjectManager + (glowIndex * 0x38) + 0xC, 0.0f); // g
swed.WriteFloat(glowObjectManager + (glowIndex * 0x38) + 0x10, 0.0f); // b
swed.WriteFloat(glowObjectManager + (glowIndex * 0x38) + 0x14, 1.0f); // a
swed.WriteBool(glowObjectManager + (glowIndex * 0x38) + 0x28, true); // render when occluded
swed.WriteBool(glowObjectManager + (glowIndex * 0x38) + 0x29, false); // render when unoccluded
}
}
код:
static void DrawGlow()
{
Swed swed = new Swed("cs2");
IntPtr client = swed.GetModuleBase("client.dll");
int dwEntityList = 0x18C9E78;
int m_hPlayerPawn = 0x7E4;
int m_flDetectedByEnemySensorTime = 0x1440;
IntPtr entityList = swed.ReadPointer(client, dwEntityList);
IntPtr listEntry = swed.ReadPointer(entityList, 0x10);
for (int i = 0; i < 64; i++)
{
if (listEntry == IntPtr.Zero )
continue;
IntPtr currentControler = swed.ReadPointer(listEntry, i * 0x78);
if (currentControler == IntPtr.Zero )
continue;
int pawnHandle = swed.ReadInt(currentControler, m_hPlayerPawn);
if (pawnHandle == 0)
continue;
IntPtr listEntry2 = swed.ReadPointer(entityList, 0x8 * ((pawnHandle & 0x7FFF) >> 9) + 0x10);
IntPtr currentPawn = swed.ReadPointer(listEntry2, 0x78 * (pawnHandle & 0x1FF));
swed.WriteFloat(currentPawn, m_flDetectedByEnemySensorTime, 86500);
}
}