using Swed64;
//init swed lib
Swed swed = new Swed("cs2");
// get client.dll
IntPtr client = swed.GetModuleBase("client.dll");
// offset we need
// offset.cs
int dwEntityList = 0x1A1F670;
// client.dll.cs
int m_hPlayerPawn = 0x814;
int m_iszPlayerName = 0x660;
int m_entitySpottedState = 0x23D0;
int m_bSpotted = 0x8;
// radar loop
while(true)
{
// get entity list
IntPtr entityList = swed.ReadPointer(client, dwEntityList);
// first entry
IntPtr listEntry = swed.ReadPointer(entityList, 0x10);
// loop through controllers
for(int i =0;i<64;i++)
{
if (listEntry == IntPtr.Zero) // ski[ if entry invalid
continue;
// get current controller
IntPtr currentController = swed.ReadPointer(listEntry, i * 0x78);
if (currentController == IntPtr.Zero)
continue; // same her , if invalid we skip
// get pawn
int pawnHandle = swed.ReadInt(currentController, m_hPlayerPawn);
if (pawnHandle == 0)
continue;
//second entry with specified id and applied mask+shift
IntPtr listEntry2 = swed.ReadPointer(entityList, 0x8 * ((pawnHandle & 0x7FFF) >> 9) + 0x10);
IntPtr currentPawn = swed.ReadPointer(listEntry2, 0x78 * (pawnHandle & 0x1ff));
//get pawn attributes , including spotted
string name = swed.ReadString(currentController, m_iszPlayerName, 16);
// spotted is eiter true or false.
bool spotted = swed.ReadBool(currentPawn, m_entitySpottedState + m_bSpotted);
//write over spotted status
swed.WriteBool(currentPawn, m_entitySpottedState + m_bSpotted, true);//make them spotted.
string spottedStatus = spotted == true ? "spotted" : " "; //string depending on if entity is spotted
Console.WriteLine($"{name}: {spottedStatus}");
}
//sleep a bit and then loop again
Thread.Sleep(50);
Console.Clear();
}