.NET 4.x Не удалось найти имя типа или пространства имен "Memory" - C#
Формулировка задачи:
using System;
using System.Diagnostics;
namespace GlowESP
{
class Program
{
private static Memory mem;
private static int bClient;
private static int oLocalPlayer = 0x00A8A53C;
private static int oEntityList = 0x04AAB9C4;
private static int oTeamNum = 0xF0;
private static int oGlowIndex = 0x0000A320;
private static int oGlowObject = 0x04FC2D84;
private static int oDormant = 0x000000E9;
private static int oHealth = 0x000000FC;
private static int TR = 0;
private static int TG = 0;
private static int TB = 255;
private static int ER = 255;
private static int EG = 0;
private static int EB = 0;
private static int A = 240;
private static int adress;
private struct GlowStrict
{
public float r;
public float g;
public float b;
public float a;
public bool rwo;
public bool rwuo;
}
static void Main()
{
while(!GetDll()) { }
while(true)
{
GlowStrict myTeam = new GlowStrict()
{
r = TR / 100f,
g = TG / 100f,
b = TB / 100f,
a = A / 100f,
rwo = true,
rwuo = false
};
GlowStrict enemyTeam = new GlowStrict()
{
r = ER / 100f,
g = EG / 100f,
b = EB / 100f,
a = A / 100f,
rwo = true,
rwuo = false
};
adress = bClient + oLocalPlayer;
int LocalPlayer = mem.Read<int>((IntPtr) adress);
adress = LocalPlayer + oTeamNum;
int PlayerTeam = mem.Read<int>((IntPtr)adress);
adress = LocalPlayer + oDormant;
if (!mem.Read<bool>((IntPtr)adress))
{
for (int i = 1; i <= 64; i++)
{
adress = bClient + oEntityList + (i - 1)*0x10;
int EntityList = mem.Read<int>((IntPtr)adress);
adress = EntityList + oTeamNum;
int HisTeam = mem.Read<int>((IntPtr)adress);
adress = EntityList + oDormant;
if (!mem.Read<bool>((IntPtr)adress) && HisTeam != 0)
{
adress = EntityList + oGlowIndex;
int GlowIndex = mem.Read<int>((IntPtr)adress);
adress = EntityList + oHealth;
float HP = mem.Read<int>((IntPtr)adress) / 100f;
if(PlayerTeam != HisTeam)
DrawGlow(GlowIndex, HP);
else
DrawGlow(GlowIndex, myTeam);
}
}
}
}
}
private static bool GetDll()
{
try
{
Process csgo = Process.GetProcessesByName("csgo")[0];
mem = new Memory("csgo");
foreach(ProcessModule module in csgo.Modules)
{
if(module.ModuleName == "client.dll")
bClient = (int)module.BaseAddress;
}
return true;
}
catch
{
return false;
}
}
private static void DrawGlow(int pGlowIn, GlowStrict col)
{
adress = bClient + oGlowObject;
int GlowObject = mem.Read<int>((IntPtr)adress);
mem.Write((IntPtr)(GlowObject + (pGlowIn * 0x38) + 4), col.r);
mem.Write((IntPtr)(GlowObject + (pGlowIn * 0x38) + 8), col.g);
mem.Write((IntPtr)(GlowObject + (pGlowIn * 0x38) + 12), col.b);
mem.Write((IntPtr)(GlowObject + (pGlowIn * 0x38) + 0x10), col.a);
mem.Write((IntPtr)(GlowObject + (pGlowIn * 0x38) + 0x24), col.rwo);
mem.Write((IntPtr)(GlowObject + (pGlowIn * 0x38) + 0x25), col.rwuo);
}
private static void DrawGlow(int pGlowIn, float hp)
{
adress = bClient + oGlowObject;
int GlowObject = mem.Read<int>((Int32)adress);
mem.Write((IntPtr)(GlowObject + (pGlowIn * 0x38) + 4), 1 - hp);
mem.Write((IntPtr)(GlowObject + (pGlowIn * 0x38) + 8), hp);
mem.Write((IntPtr)(GlowObject + (pGlowIn * 0x38) + 12), 0);
mem.Write((IntPtr)(GlowObject + (pGlowIn * 0x38) + 0x10), A / 100f);
mem.Write((IntPtr)(GlowObject + (pGlowIn * 0x38) + 0x24), true);
mem.Write((IntPtr)(GlowObject + (pGlowIn * 0x38) + 0x25), true);
}
}
}Решение задачи: «.NET 4.x Не удалось найти имя типа или пространства имен "Memory"»
textual
Листинг программы
catch
{
return false;
// здесь объявите
}