Solved Fleep's CSGO ESP Won't Show

  • 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
Status
Not open for further replies.

koro35

Jr.Coder
Full Member
Nobleman
Oct 30, 2013
59
379
2
C++:
#include <Windows.h>
#include <iostream>
#include <tchar.h>
#include <TlHelp32.h>
#include <sstream>
#include <vector>
#include <algorithm>  
 
using namespace std;
 
 
DWORD ClientBase;
DWORD EngineBase;
DWORD PlayerBase = 0x9DF064;
DWORD EntityBase = 0xA4E224;
DWORD teamOffset = 0xF0;
DWORD entityLoop = 0x10;
DWORD ViewMatrix = 0xA43764;
DWORD CLocalPlayer;
DWORD vecOrigin = 0x134;
DWORD Health = 0xFC;
DWORD CBaseEntity;
DWORD ProcessID;
HWND hwnd;
HANDLE phandle;
int PlayerCrosshair;
int NumOfPlayers = 10;
HWND TargetWnd;
HWND Handle;
DWORD DwProcId;
 
RECT m_Rect;
HDC HDC_Desktop;
HBRUSH EnemyBrush;
HFONT Font;
COLORREF TextColor;
 
 
 
typedef struct{
        float flMatrix[4][4];
}WorldToScreenMatrix_t;
 
float Get3dDistance(float * myCoords, float * enemyCoords){
        return sqrt(pow(double(enemyCoords[0] - myCoords[0]), 2.0) +
                pow(double(enemyCoords[1] - myCoords[1]), 2.0)+
                pow(double(enemyCoords[2] - myCoords[2]), 2.0));
}
 
void SetupDrawing(HDC hDesktop, HWND handle){
        HDC_Desktop = hDesktop;
        Handle = handle;
        EnemyBrush = CreateSolidBrush(RGB(255, 0, 70));
        TextColor = (RGB(0, 150, 255));
}
 
 
DWORD FindDmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD Offsets[], DWORD BaseAddress)
{
    DWORD pointer = BaseAddress;
    DWORD pTemp;
 
    DWORD pointerAddr;
    for (int i = 0; i < PointerLevel; i++)
    {
        if (i == 0)
        {
            ReadProcessMemory(hProcHandle, (LPCVOID)pointer, &pTemp, 4, NULL);
        }
        pointerAddr = pTemp + Offsets[i];
        ReadProcessMemory(hProcHandle, (LPCVOID)pointerAddr, &pTemp, 4, NULL);
    }
    return pointerAddr;
}
 
DWORD dwGetModuleBaseAddress(DWORD dwProcessIdentifier, TCHAR *lpszModuleName)
{
    HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessIdentifier);
    DWORD dwModuleBaseAddress = 0;
    if (hSnapshot != INVALID_HANDLE_VALUE)
    {
        MODULEENTRY32 ModuleEntry32 = { 0 };
        ModuleEntry32.dwSize = sizeof(MODULEENTRY32);
        if (Module32First(hSnapshot, &ModuleEntry32))
        {
            do
            {
                if (_tcsicmp(ModuleEntry32.szModule, lpszModuleName) == 0)
                {
                    dwModuleBaseAddress = (DWORD)ModuleEntry32.modBaseAddr;
                    break;
                }
            } while (Module32Next(hSnapshot, &ModuleEntry32));
        }
        CloseHandle(hSnapshot);
    }
    return dwModuleBaseAddress;
}
 
struct MyPlayer_t{
                         
        int Team;
        float Origin[3];
        int Health;
        WorldToScreenMatrix_t WorldToScreenMatrix;
 
 
        void ReadInformation(){
                 
 
                ClientBase = dwGetModuleBaseAddress(ProcessID, _T("client.dll"));
                EngineBase = dwGetModuleBaseAddress(ProcessID, _T("engine.dll"));
 
                ReadProcessMemory(phandle, (LPCVOID*)(ClientBase + PlayerBase), &CLocalPlayer, sizeof(DWORD), 0);
 
                ReadProcessMemory(phandle, (LPCVOID*)(CLocalPlayer + teamOffset), &Team, sizeof(DWORD), 0);
 
                ReadProcessMemory(phandle, (LPCVOID*)(CLocalPlayer + Health), &Health, sizeof(int), 0);
 
                ReadProcessMemory(phandle, (LPCVOID*)(CLocalPlayer + vecOrigin), &Origin, sizeof(DWORD), 0);
 
                ReadProcessMemory(phandle, (LPCVOID*)(EngineBase + ViewMatrix), &WorldToScreenMatrix, sizeof(WorldToScreenMatrix), 0);
 
        }
 
}MyPlayer;
 
struct PlayerList_t{
 
        int Team;
        float Origin[3];
        int Health;
 
        void ReadInformation(int Player){
                ClientBase = dwGetModuleBaseAddress(ProcessID, _T("client.dll"));
                ReadProcessMemory(phandle, (LPCVOID*)(ClientBase + EntityBase + (Player* entityLoop)), &CBaseEntity, sizeof(DWORD), 0);
                ReadProcessMemory(phandle, (LPCVOID*)(CBaseEntity + teamOffset), &Team, sizeof(int), 0);
                ReadProcessMemory(phandle, (LPCVOID*)(CBaseEntity + vecOrigin), &Origin, sizeof(DWORD), 0);
                ReadProcessMemory(phandle, (LPCVOID*)(CBaseEntity + Health), &Health, sizeof(int), 0);
        }
 
}PlayerList[32];
 
 
bool WorldToScreen(float * from, float * to){
 
        to[0] = MyPlayer.WorldToScreenMatrix.flMatrix[0][0] * from[0] + MyPlayer.WorldToScreenMatrix.flMatrix[0][1] * from[1] + MyPlayer.WorldToScreenMatrix.flMatrix[0][2] * from[2] + MyPlayer.WorldToScreenMatrix.flMatrix[0][3];
        to[1] = MyPlayer.WorldToScreenMatrix.flMatrix[1][0] * from[0] + MyPlayer.WorldToScreenMatrix.flMatrix[1][1] * from[1] + MyPlayer.WorldToScreenMatrix.flMatrix[1][2] * from[2] + MyPlayer.WorldToScreenMatrix.flMatrix[1][3];
 
        float w = MyPlayer.WorldToScreenMatrix.flMatrix[3][0] * from[0] + MyPlayer.WorldToScreenMatrix.flMatrix[3][1] * from[1] + MyPlayer.WorldToScreenMatrix.flMatrix[3][2] * from[2] + MyPlayer.WorldToScreenMatrix.flMatrix[3][3];
 
        if(w < 0.01f)
                return false;
 
        float invw = 1.0f / w;
        to[0] *= invw;
        to[1] *= invw;
 
        int width = (int)(m_Rect.right - m_Rect.left);
        int height = (int)(m_Rect.bottom - m_Rect.top);
 
        float x = width/2;
        float y = height/2;
 
        x += 0.5 * to[0] * width + 0.5;
        y -= 0.5 * to[1] * height + 0.5;
 
        to[0] = x + m_Rect.left;
        to[1] = y + m_Rect.top;
 
        return true;
 
}
 
 
//GDI DRAWING SHIT
void DrawFilledRect(int x, int y, int w, int h)
{
        //We create our rectangle to draw on screen
        RECT rect = { x, y, x + w, y + h };
        //We clear that portion of the screen and display our rectangle
        FillRect(HDC_Desktop, &rect, EnemyBrush);
}
void DrawBorderBox(int x, int y, int w, int h, int thickness)
{
        //Top horiz line
        DrawFilledRect(x, y, w, thickness);
        //Left vertical line
        DrawFilledRect( x, y, thickness, h);
        //right vertical line
        DrawFilledRect((x + w), y, thickness, h);
        //bottom horiz line
        DrawFilledRect(x, y + h, w+thickness, thickness);
}
void DrawLine(float StartX, float StartY, float EndX, float EndY, COLORREF Pen)
{
        int a,b=0;
        HPEN hOPen;
        // penstyle, width, color
        HPEN hNPen = CreatePen(PS_SOLID, 2, Pen);
        hOPen = (HPEN)SelectObject(HDC_Desktop, hNPen);
        // starting point of line
        MoveToEx(HDC_Desktop, StartX, StartY, NULL);
        // ending point of line
        a = LineTo(HDC_Desktop, EndX, EndY);
        DeleteObject(SelectObject(HDC_Desktop, hOPen));
}
void DrawString(int x, int y, COLORREF color, const char* text)
{      
        SetTextAlign(HDC_Desktop,TA_CENTER|TA_NOUPDATECP);
 
        SetBkColor(HDC_Desktop,RGB(0,0,0));
        SetBkMode(HDC_Desktop,TRANSPARENT);
 
        SetTextColor(HDC_Desktop,color);
 
        SelectObject(HDC_Desktop,Font);
 
        TextOutA(HDC_Desktop,x,y,text,strlen(text));
 
        DeleteObject(Font);
}
//
 
void DrawEsp(int x, int y, float distance){
 
        int width = 18100/distance;
        int height = 36000/distance;
 
        DrawBorderBox(x-(width/2), y-height, width, height, 1);
 
        stringstream ss;
        ss << (int)distance;
 
        char * distanceInfo = new  char[ss.str().size()+1];
        strcpy(distanceInfo, ss.str().c_str());
 
        DrawString(x, y, TextColor, distanceInfo);
        DrawString(x, y - 150, TextColor, "nibba aint on ur team!1");
 
        delete [] distanceInfo;
}
 
void x69esp(){
        GetWindowRect(FindWindow(NULL, "Counter-Strike: Global Offensive"), &m_Rect);
 
        for(int i = 0; i < NumOfPlayers; i++){
                PlayerList[i].ReadInformation(i);
               
                if(PlayerList[i].Health < 2)
                        continue;
 
                if(PlayerList[i].Team == MyPlayer.Team)
                        continue;
                       
                float EnemyXY[3];
 
                if(WorldToScreen(PlayerList[i].Origin, EnemyXY)){
                        DrawEsp(EnemyXY[0] - m_Rect.left, EnemyXY[1] - m_Rect.top, Get3dDistance(MyPlayer.Origin, PlayerList[i].Origin));
                }
 
 
        }
}
 
int main()
{
 
 
    hwnd = FindWindow(NULL , "Counter-Strike: Global Offensive");
 
    if (!hwnd)
    {
 
        cout << "Window Not Found" << endl;
        Sleep(1000);
        exit(1);
 
    }
 
 
 
    while (true)
    {
        MyPlayer.ReadInformation();
 
                for(int i = 0; i < NumOfPlayers; i++){
                        PlayerList[i].ReadInformation(i);
                }
 
                ShowWindow(FindWindowA("ConsoleWindowClass", NULL), false);
                TargetWnd = FindWindow(0, "Counter-Strike: Global Offensive");
                HDC HDC_Desktop = GetDC(TargetWnd);
                SetupDrawing(HDC_Desktop, TargetWnd);
                x69esp();
    }
 
}
Thats my code and basicly the boxes dont render around the players, however i do see the distance string / text printing in my top left. and i tested that the boxes can actually be drawn.
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,205
78,998
2,400

Liduen

Hacker
Dank Tier VIP
May 19, 2013
702
8,478
33
Well if the drawing method works, there's most likely something wrong with the w2s function/or the values you read from memory. :)
I would print some values to the console to see where the values get wrong.
 

koro35

Jr.Coder
Full Member
Nobleman
Oct 30, 2013
59
379
2
if(WorldToScreen(PlayerList.Origin, EnemyXY)){
cout<<"WorldToScreen works!";
DrawEsp(EnemyXY[0] - m_Rect.left, EnemyXY[1] - m_Rect.top, Get3dDistance(MyPlayer.Origin, PlayerList.Origin));
}


I tried that and it didnt print anything to the console, (also tried putting cout above that if statement and it works)

so the problem is that if statement, it doesnt run runDrawEsp(EnemyXY[0] - m_Rect.left, EnemyXY[1] - m_Rect.top, Get3dDistance(MyPlayer.Origin, PlayerList.Origin));
 

Luciz

Coder
Dank Tier Donator
Nobleman
Jul 10, 2014
101
458
3
C++:
ReadProcessMemory(phandle, (LPCVOID*)(EngineBase + ViewMatrix), &WorldToScreenMatrix, sizeof(WorldToScreenMatrix), 0);
should be
C++:
ReadProcessMemory(phandle, (LPCVOID*)(ClientBase+ ViewMatrix), &WorldToScreenMatrix, sizeof(WorldToScreenMatrix), 0);
 

koro35

Jr.Coder
Full Member
Nobleman
Oct 30, 2013
59
379
2
EDIT: The box - text are just in the sky somewhere random.
 

squeenie

Hacker
Meme Tier VIP
Dank Tier Donator
Mar 6, 2013
677
5,478
37
I don't have GO installed but thats what happened to me when I had the wrong offset. Try some others to be certain.
 

koro35

Jr.Coder
Full Member
Nobleman
Oct 30, 2013
59
379
2
I tried another couple of addresses, none seemed to work tho. Can anyone else check their viewmatrix address and compare?
 
Last edited:

BeesKnees

Coder
Full Member
Nobleman
Jul 24, 2013
124
1,973
3
0xA436A4

10 char

Edit: ahh was not aware of the update
 
Last edited:

Liduen

Hacker
Dank Tier VIP
May 19, 2013
702
8,478
33
Are the ESP boxes somehow related to your view angles? (because they should be ofc)
If they're not, then there's something's wrong with your view angles.

In general there are only two possibilities:
- w2s is incorrect
- w2s input values are incorrect (player positions / viewMatrix)

Print these values to the console and check them if they're correct.
If there's nothing wrong with them, go through the w2s function step by step and find out where the values become useless.
Should be pretty easy if you wrote the w2s function yourself.
 
Last edited:

koro35

Jr.Coder
Full Member
Nobleman
Oct 30, 2013
59
379
2
I didnt write the W2S function myself, as I said I used fleeps tutorial.
 

Liduen

Hacker
Dank Tier VIP
May 19, 2013
702
8,478
33
Does the rectangle move around your screen when you change your view angles?
(btw there's an edit button below each of your posts to edit them if you were missing something ;) )
 
Status
Not open for further replies.
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.

Similar threads

Community Mods