Solved CSGO Internal ESP causing crashes

  • CSGO recently moved logic from 'client_panorama.dll' to 'client.dll', you must update all code that uses 'client_panorama.dll' and replace it with 'client.dll' or the code will not work.
Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

koro35

Jr.Coder
Full Member
Nobleman
Oct 30, 2013
59
379
2
So this code works perfectly fine in css, but not in csgo. ;-;
C++:
if (pEngine->IsInGame() && pEngine->IsConnected()) {
			font_Arial->PrintText("ESP ON.", 2, 2, color->White);
			C_BasePlayer* Plr = *(C_BasePlayer**)Mng->PlayerBase;
			for (int i = 0; i < MAX_PLAYERS; i++) {
				C_BaseEntity* ent = *(C_BaseEntity**)Mng->GetEntityByIndex(i);

				if (!ent)
					continue;
				font_Arial->PrintText("ENT IS INFACT ENT.", 2, 15, color->White);

				if (ent == Plr)
					continue;
				font_Arial->PrintText("ENT ISNT PLAYER.", 2, 30, color->White);

				Vector Head, Leg, ScreenHead, ScreenLeg;

				//GetBonePosition(ent, Head, 10);

				Head = ent->EyePosition();
				Leg = ent->GetAbsOrigin();

				if (WorldToScreen(Head, ScreenHead) && WorldToScreen(Leg, ScreenLeg)) { // IF I REMOVE THIS PART IT DOESNT CRASH
					float Height = abs(ScreenLeg.y - ScreenHead.y);
					float Width = Height / 2.0f;

					pDraw->DrawBorder(ScreenHead.x - Width / 2, ScreenHead.y, Width, Height, 2, color->Blue, pDevice);
				} // // IF I REMOVE THIS PART IT DOESNT CRASH

			}

		}
WorldToScreen function
C++:
bool WorldToScreen(Vector &vOrigin, Vector &vScreen)
{

	const VMatrix& worldToScreen = pEngine->WorldToScreenMatrix();

	float w = worldToScreen[3][0] * vOrigin[0] + worldToScreen[3][1] * vOrigin[1] + worldToScreen[3][2] * vOrigin[2] + worldToScreen[3][3];
	vScreen.z = 0;
	if (w > 0.01)
	{
		float fl1DBw = 1 / w;
		vScreen.x = (iScreenWidth / 2) + (0.5 * ((worldToScreen[0][0] * vOrigin[0] + worldToScreen[0][1] * vOrigin[1] + worldToScreen[0][2] * vOrigin[2] + worldToScreen[0][3]) * fl1DBw) * iScreenWidth + 0.5);
		vScreen.y = (iScreenHeight / 2) - (0.5 * ((worldToScreen[1][0] * vOrigin[0] + worldToScreen[1][1] * vOrigin[1] + worldToScreen[1][2] * vOrigin[2] + worldToScreen[1][3]) * fl1DBw) * iScreenHeight + 0.5);
		return true;
	}
	return false;
}
 

koro35

Jr.Coder
Full Member
Nobleman
Oct 30, 2013
59
379
2
You sure they are wrong, I got them the same day. Also pEngine->IsInGame / IsConnected all works.
 

koro35

Jr.Coder
Full Member
Nobleman
Oct 30, 2013
59
379
2
m_iHealth
m_iTeamNum displayes 1 billion and some shit, wierd.
 

koro35

Jr.Coder
Full Member
Nobleman
Oct 30, 2013
59
379
2
EDIT:
if (!ent || ent == nullptr)
continue;


if (!Plr || Plr == nullptr)
return;

They wouldnt be null.
 
Last edited:

koro35

Jr.Coder
Full Member
Nobleman
Oct 30, 2013
59
379
2
So I got my ESP to work, but this wierd shit happends:


However when I have the players on the right side of my screen, it doesn't happen:


ESP:
C++:
			if (!WorldToScreen(Head, ScreenHead))
				continue;

			if (!WorldToScreen(Leg, ScreenLeg))
				continue;

			float Height = abs(ScreenLeg.y - ScreenHead.y);
			float Width = Height / 2.0f;

			backgr->draw->DrawBorder(ScreenHead.x - Width / 2, ScreenHead.y, Width, Height, 2, DrawColor, pDevice);

			backgr->draw->DrawBorder(ScreenHead.x - Width / 2 - 1, ScreenHead.y, Width + 1, Height - 1, 1, col->Black, pDevice);
			backgr->draw->DrawBorder(ScreenHead.x - Width / 2 + 1, ScreenHead.y, Width - 1, Height + 1, 1, col->Black, pDevice);
W2S:
C++:
bool HackManager::WorldToScreen(Vector &Origin, Vector &Screen)
{
	bool Result = false;
	const VMatrix& WorldToScreen = pEngine->WorldToScreenMatrix();

	float w = WorldToScreen[3][0] * Origin[0] + WorldToScreen[3][1] * Origin[1] + WorldToScreen[3][2] * Origin[2] + WorldToScreen[3][3];
	Screen[2] = 0.0f;

	if (w > 0.001f)
	{
		float invw = 1.0f / w;

		int ScreenSize[2];
		pEngine->GetScreenSize(ScreenSize[0], ScreenSize[1]);

		Screen[0] = (ScreenSize[0] / 2.0f) + ((((WorldToScreen[0][0] * Origin[0] + WorldToScreen[0][1] * Origin[1] + WorldToScreen[0][2] * Origin[2] + WorldToScreen[0][3]) * invw) / 2.0f) * ScreenSize[0] + 0.5f);
		Screen[1] = (ScreenSize[1] / 2.0f) - ((((WorldToScreen[1][0] * Origin[0] + WorldToScreen[1][1] * Origin[1] + WorldToScreen[1][2] * Origin[2] + WorldToScreen[1][3]) * invw) / 2.0f) * ScreenSize[1] + 0.5f);
		Result = true;
	}

	return Result;
}
Drawing funcs:
C++:
DrawBorder:
[code=cpp]
void DrawManager::DrawBorder(int x, int y, int w, int h, int px, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice)
{
	FillRGB(x, (y + h - px), w, px, BorderColor, pDevice);
	FillRGB(x, y, px, h, BorderColor, pDevice);
	FillRGB(x, y, w, px, BorderColor, pDevice);
	FillRGB((x + w - px), y, px, h, BorderColor, pDevice);
}
FillRGB:
C++:
void DrawManager::FillRGB(int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice)
{
	if (w < 0)w = 1;
	if (h < 0)h = 1;
	if (x < 0)x = 1;
	if (y < 0)y = 1;

	D3DRECT rec = { x, y, x + w, y + h };
	pDevice->Clear(1, &rec, D3DCLEAR_TARGET, color, 0, 0);
}
[/code]


EDIT: Dont mind the crosshair.
 
Last edited:

koro35

Jr.Coder
Full Member
Nobleman
Oct 30, 2013
59
379
2
Look at the pictures maybe
EDIT: The esp boxes fuck up if the players are at the left of my screen, but not the right.
 
Last edited:
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods