Results 1 to 12 of 12
  1. #1
    xShouty's Avatar
    Join Date
    May 2016
    Gender
    male
    Location
    My Home :3
    Posts
    21
    Reputation
    10
    Thanks
    1
    My Mood
    Relaxed

    ESP doesnt draw a Box

    Hey guys, i drawed a box when WorldToScreen() function... in the top left corner of cs go... At first i want to draw a box of all Player but it doesnt work, theres no box, only the top left one...

    My Offsets are right btw

    Code:
    void ESP()
    {
    
    	DWORD dwClient = Mem.Module("client.dll");
    	DWORD dwEngine = Mem.Module("engine.dll");
    	ReadProcessMemory(pHandle, (LPVOID)(dwClient + ViewMatrix), &W2S_M.flMatrix, sizeof(WorldToScreenMatrix_t), NULL);
    
    	GetWindowRect(FindWindow(NULL, "Counter-Strike: Global Offensive"), &m_Rect);
    
    	DWORD pLocal = Mem.Read<DWORD>(dwClient + dw_PlayerBase);
    	//int LocalTeam = Mem.Read<int>(pLocal + dw_teamOffset);
    	
    	DWORD LocalTeam = ReadProcessMemory(pHandle, (LPVOID)(dw_PlayerBase + 0xF0), &LocalTeam, sizeof(LocalTeam), NULL);
    
    	int LocalHealth = Mem.Read<int>(pLocal + dw_healthOffset);
    
    	float LocalPosition[3];
    	LocalPosition[0] = Mem.Read<float>(pLocal + 0x134);
    	LocalPosition[1] = Mem.Read<float>(pLocal + 0x138);
    	LocalPosition[2] = Mem.Read<float>(pLocal + 0x13C);
    
    	for (int i = 0; i < 32; i++)
    	{
    		uintptr_t pEnemy = Mem.Read<uintptr_t>(dwClient + dw_EntityBase + (i  * dw_EntityLoopDistance));
    
    		int EnemyTeam = ReadProcessMemory(pHandle, (LPVOID)(dw_EntityBase + 0xF0), &EnemyTeam, sizeof(EnemyTeam), NULL);
    		int EnemyHealth = Mem.Read<int>(pEnemy + dw_healthOffset);
    
    		float HeadPos[3];
    		float Position[3];
    		Position[0] = Mem.Read<float>(pEnemy + 0x134);
    		Position[1] = Mem.Read<float>(pEnemy + 0x138);
    		Position[2] = Mem.Read<float>(pEnemy + 0x13C);
    
           uintptr_t BoneBase = Mem.Read<uintptr_t>(pEnemy + dw_BoneMatrix);
    
    		GetBonePos(BoneBase, 6, HeadPos);
    
    		float EnemyXYHeadPos[3];
    		float EnemyXY[3];
    		if (WorldToScreen(Position, EnemyXY) && WorldToScreen(HeadPos, EnemyXYHeadPos))
    		{
    
    			float Distance = Get3dDistance(LocalPosition, Position);
    			float Height = abs(EnemyXY[1] - EnemyXYHeadPos[1]);
    			float Width = Height / 2;
    
    			DrawBox(10, 10, 20, 20, 1, 255, 0, 0, 255);
    
    			DrawBox(EnemyXY[0] - (Width / 2), EnemyXY[1] - Height, Width, Height, 1, 255, 0, 0, 255);
        }
    }
    There could maybe be a syntax error cuz C&P

    Thx in advance !

  2. #2
    Hunter's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    Depths Of My Mind.
    Posts
    17,468
    Reputation
    3771
    Thanks
    6,159
    My Mood
    Cheerful
    /Moved to the correct section.

  3. #3
    OhStarQ's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Location
    engine.dll
    Posts
    54
    Reputation
    10
    Thanks
    368
    What is your drawbox function?

  4. #4
    xShouty's Avatar
    Join Date
    May 2016
    Gender
    male
    Location
    My Home :3
    Posts
    21
    Reputation
    10
    Thanks
    1
    My Mood
    Relaxed
    The Draw Box func ist working cuz my little Box was drawed top left of cs go

    void DrawBox(float x, float y, float width, float height, float px, int r, int g, int b, int a)
    {
    D3DXVECTOR2 points[5];
    points[0] = D3DXVECTOR2(x, y);
    points[1] = D3DXVECTOR2(x + width, y);
    points[2] = D3DXVECTOR2(x + width, y + height);
    points[3] = D3DXVECTOR2(x, y + height);
    points[4] = D3DXVECTOR2(x, y);
    DirectX.Line->SetWidth(1);
    DirectX.Line->Draw(points, 5, D3DCOLOR_RGBA(r, g, b, a));
    }

  5. #5
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    Please don't use d3d lines for drawing boxes, use vertecies.

    How does your WorldToScreen function look like?

  6. #6
    xShouty's Avatar
    Join Date
    May 2016
    Gender
    male
    Location
    My Home :3
    Posts
    21
    Reputation
    10
    Thanks
    1
    My Mood
    Relaxed
    Quote Originally Posted by WasserEsser View Post
    Please don't use d3d lines for drawing boxes, use vertecies.

    How does your WorldToScreen function look like?
    Ok i heared of vertecies i should look for it and my W2S :

    Code:
    typedef struct {
    	float flMatrix[4][4];
    }WorldToScreenMatrix_t;
    
    WorldToScreenMatrix_t W2S_M;
    
    RECT m_Rect; //WORLD TO SCREEN RECT
    
    bool WorldToScreen(float * from, float * to)
    {
    	to[0] = W2S_M.flMatrix[0][0] * from[0] + W2S_M.flMatrix[0][1] * from[1] + W2S_M.flMatrix[0][2] * from[2] + W2S_M.flMatrix[0][3];
    	to[1] = W2S_M.flMatrix[1][0] * from[0] + W2S_M.flMatrix[1][1] * from[1] + W2S_M.flMatrix[1][2] * from[2] + W2S_M.flMatrix[1][3];
    
    	float w = W2S_M.flMatrix[3][0] * from[0] + W2S_M.flMatrix[3][1] * from[1] + W2S_M.flMatrix[3][2] * from[2] + W2S_M.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;
    } 
    
    //and this in my ESP func:
    
    GetWindowRect(FindWindow(NULL, "Counter-Strike: Global Offensive"), &m_Rect);
    
    ReadProcessMemory(pHandle, (LPVOID)(dwClient + ViewMatrix), &W2S_M.flMatrix, sizeof(WorldToScreenMatrix_t), NULL);

  7. #7
    xShouty's Avatar
    Join Date
    May 2016
    Gender
    male
    Location
    My Home :3
    Posts
    21
    Reputation
    10
    Thanks
    1
    My Mood
    Relaxed
    Does nobody know a solution ? :/

  8. #8
    Buttars0070's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    A very bright place
    Posts
    97
    Reputation
    10
    Thanks
    58
    My Mood
    Angelic
    Quote Originally Posted by xShouty View Post
    Does nobody know a solution ? :/
    So you're reading your local team from your playerBase? Don't understand how that works.
    You need to read it from pLocal, ClientDLL->LocalPlayer->LocalTeam

    Code:
    DWORD pLocal = Mem.Read<DWORD>(dwClient + dw_PlayerBase);
    DWORD LocalTeam = ReadProcessMemory(pHandle, (LPVOID)(dw_PlayerBase + 0xF0), &LocalTeam, sizeof(LocalTeam), NULL);
    You're using two different methods to read memory. You should probably stick to one. (Your best bet is to stick to the 'Mem' class)

    It's allowing you to make errors like the one below, where you don't actually understand where you're reading to.
    dw_EntityBase is just an offset. (Offset is how far away from one thing is from a desired another).

    For example, if I know X is ALWAYS 12 away from Y, then if you want to find the value of X, X is always located Y+12 units (in our case bytes), as long as the location of Y if known then all you have to do is add 12 to find the value of X. EZ

    By RPM dw_EntityBase + healthOffset, you're giving an invalid value because it doesn't know where to start reading. You are only giving it links to how far away from 'CSGO' but not actually telling it where CSGO is. If you use pEnemy instead, it actually links to a player instead of just some random value.

    pEnemy = ClientDLL->EntityPlayer
    EnemyHealth = ClientDLL->EntityPlayer->EnemyHealth

    So, with that said, EnemyHealth = pEnemy->EnemyHealth

    Code:
    uintptr_t pEnemy = Mem.Read<uintptr_t>(dwClient + dw_EntityBase + (i  * dw_EntityLoopDistance));
    int EnemyTeam = ReadProcessMemory(pHandle, (LPVOID)(dw_EntityBase + 0xF0), &EnemyTeam, sizeof(EnemyTeam), NULL);
    Try fixing these things first and then try to make an ESP.

    If you need more help, I'm on discord, pm me and ill link you to it and I'll help you further.
    Last edited by Buttars0070; 06-25-2016 at 07:58 PM.



    If I helped you or enjoyed something I did, I would love it if you




     

    Overwatch Bans: 2 | VAC: 1
    50 posts ✔
    150 posts
    250 posts
    500 posts
    1000 posts
    50 thanks ✔
    200 thanks
    500 thanks
    1000 thanks
    1500 thanks
    2000 thanks
    2500 thanks
    3000 thanks
    100 downloads ✔
    500 downloads
    1000 downloads
    5000 downloads
    7500 downloads
    10000 downloads
    15000 downloads



     




  9. #9
    xShouty's Avatar
    Join Date
    May 2016
    Gender
    male
    Location
    My Home :3
    Posts
    21
    Reputation
    10
    Thanks
    1
    My Mood
    Relaxed
    Quote Originally Posted by Buttars0070 View Post
    So you're reading your local team from your playerBase? Don't understand how that works.
    You need to read it from pLocal, ClientDLL->LocalPlayer->LocalTeam

    Code:
    DWORD pLocal = Mem.Read<DWORD>(dwClient + dw_PlayerBase);
    DWORD LocalTeam = ReadProcessMemory(pHandle, (LPVOID)(dw_PlayerBase + 0xF0), &LocalTeam, sizeof(LocalTeam), NULL);
    You're using two different methods to read memory. You should probably stick to one. (Your best bet is to stick to the 'Mem' class)

    It's allowing you to make errors like the one below, where you don't actually understand where you're reading to.
    dw_EntityBase is just an offset. (Offset is how far away from one thing is from a desired another).

    For example, if I know X is ALWAYS 12 away from Y, then if you want to find the value of X, X is always located Y+12 units (in our case bytes), as long as the location of Y if known then all you have to do is add 12 to find the value of X. EZ

    By RPM dw_EntityBase + healthOffset, you're giving an invalid value because it doesn't know where to start reading. You are only giving it links to how far away from 'CSGO' but not actually telling it where CSGO is. If you use pEnemy instead, it actually links to a player instead of just some random value.

    pEnemy = ClientDLL->EntityPlayer
    EnemyHealth = ClientDLL->EntityPlayer->EnemyHealth

    So, with that said, EnemyHealth = pEnemy->EnemyHealth

    Code:
    uintptr_t pEnemy = Mem.Read<uintptr_t>(dwClient + dw_EntityBase + (i  * dw_EntityLoopDistance));
    int EnemyTeam = ReadProcessMemory(pHandle, (LPVOID)(dw_EntityBase + 0xF0), &EnemyTeam, sizeof(EnemyTeam), NULL);
    Try fixing these things first and then try to make an ESP.

    If you need more help, I'm on discord, pm me and ill link you to it and I'll help you further.
    Ok, first i fixed these things a few days ago with the different PRM methodes, i know the working of cdll->enemy->health, but my code doesnt draw anything...
    and i dont F*cking know why :/

    Code:
    void ESP()
    {
    	if (callonOnce == false)
    	{
    		dwClient = Mem.Module("client.dll");
    		dwEngine = Mem.Module("engine.dll");
    		callonOnce = true;
    	}
    
    	W2S_M = Mem.Read<WorldToScreenMatrix_t>(dwClient + ViewMatrix);
    
    	DWORD pLocal = Mem.Read<DWORD>(dwClient + dw_PlayerBase);
    	//int LocalTeam = Mem.Read<int>(pLocal + dw_teamOffset);
    	
    	DWORD LocalTeam = Mem.Read<DWORD>(pLocal + dw_teamOffset);
    
    	DWORD LocalHealth = Mem.Read<DWORD>(pLocal + dw_healthOffset);
    
    	float LocalPosition[3];
    
    	LocalPosition[0] = Mem.Read<float>(pLocal + 0x134);
    	LocalPosition[1] = Mem.Read<float>(pLocal + (0x134 + 0x4));
    	LocalPosition[2] = Mem.Read<float>(pLocal + (0x134 + 0x8));
    
    	for (int i = 0; i < 32; i++)
    	{
    		DWORD pEnemy = Mem.Read<DWORD>(dwClient + dw_EntityBase + (i * dw_EntityLoopDistance));
    
    		DWORD EnemyTeam = Mem.Read<DWORD>(pEnemy + dw_teamOffset);
    		DWORD EnemyHealth = Mem.Read<DWORD>(pEnemy + dw_healthOffset);
    
    		float HeadPos[3];
    		float Position[3];
    
    		Position[0] = Mem.Read<float>(pEnemy + 0x134);
    		Position[1] = Mem.Read<float>(pEnemy + (0x134 + 0x4));
    		Position[2] = Mem.Read<float>(pEnemy + (0x134 + 0x8));
    
    		DWORD BoneBase = Mem.Read<DWORD>(pEnemy + dw_BoneMatrix);
    
    		GetBonePos(BoneBase, 6, HeadPos);
    
    		float EnemyXYHeadPos[3];
    		float EnemyXY[3];
    
    		if (WorldToScreen(Position, EnemyXY))
    		{
    
    			float Distance = Get3dDistance(LocalPosition, Position);
    			float Height = 20000 / Distance;
    			float Width = 20000 / Distance;
    
    
    			Drawing::Rect(10, 10, 20, 20, D3DCOLOR_ARGB(255, 0, 255, 0));
    			Drawing::Rect(EnemyXY[0] - (Width / 2), EnemyXY[1] - Height, Width, Height, Color::White);
            }
        }
    }
    I dont know wheather the EnemyXZ var is right or not, my world to screen is still the same (top!) :/

  10. #10
    Buttars0070's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    A very bright place
    Posts
    97
    Reputation
    10
    Thanks
    58
    My Mood
    Angelic

    Thumbs up

    Very nice, I'm very impressed on how much your style improved. Remember, consistency is key. I recommend reading and following this Google's C++ Style Guide

    Most everything is right but the way you're trying to scale is 1. Over complicated 2.Broken

    You're not finding the Height, Width, or enough W2S info (for my method). I know @ImWhacky used this method before I broke him of that
    Here's what I have to make mine work. If you can't seem to figure it out, PM me and I'll add you on Discord or something and help ya out.

    Code:
    if (WorldToScreenM(EntityPlayer.Pos, W2SP) && WorldToScreenM(EntityPlayer.HeadPos, W2S_Head)) {
     int height = abs(W2SP[1] - W2S_Head[1]);
     int width = height / 2; //Or whatever you want.
     CornerBox(W2SP[0] - (width / 2), W2SP[1] - height, width, height, Color.Enemy.R, Color.Enemy.G, Color.Enemy.B, 255);
    Try and figure that out and post back your draw functions.



    If I helped you or enjoyed something I did, I would love it if you




     

    Overwatch Bans: 2 | VAC: 1
    50 posts ✔
    150 posts
    250 posts
    500 posts
    1000 posts
    50 thanks ✔
    200 thanks
    500 thanks
    1000 thanks
    1500 thanks
    2000 thanks
    2500 thanks
    3000 thanks
    100 downloads ✔
    500 downloads
    1000 downloads
    5000 downloads
    7500 downloads
    10000 downloads
    15000 downloads



     




  11. #11
    xShouty's Avatar
    Join Date
    May 2016
    Gender
    male
    Location
    My Home :3
    Posts
    21
    Reputation
    10
    Thanks
    1
    My Mood
    Relaxed
    Quote Originally Posted by Buttars0070 View Post
    Try and figure that out and post back your draw functions.

    This is my Draw fucntion:

    Code:
    void DrawBox(float x, float y, float width, float height, float px, int r, int g, int b, int a)
    {
    	D3DXVECTOR2 points[5];
    	points[0] = D3DXVECTOR2(x, y);
    	points[1] = D3DXVECTOR2(x + width, y);
    	points[2] = D3DXVECTOR2(x + width, y + height);
    	points[3] = D3DXVECTOR2(x, y + height);
    	points[4] = D3DXVECTOR2(x, y);
    	DirectX.Line->SetWidth(1);
    	DirectX.Line->Draw(points, 5, D3DCOLOR_RGBA(r, g, b, a));
    }
    - - - Updated - - -

    Quote Originally Posted by Buttars0070 View Post
    Very nice, I'm very impressed on how much your style improved. Remember, consistency is key. I recommend reading and following this Google's C++ Style Guide

    Most everything is right but the way you're trying to scale is 1. Over complicated 2.Broken

    You're not finding the Height, Width, or enough W2S info (for my method). I know @ImWhacky used this method before I broke him of that

    Here's what I have to make mine work. If you can't seem to figure it out, PM me and I'll add you on Discord or something and help ya out.

    Code:
    if (WorldToScreenM(EntityPlayer.Pos, W2SP) && WorldToScreenM(EntityPlayer.HeadPos, W2S_Head)) {
     int height = abs(W2SP[1] - W2S_Head[1]);
     int width = height / 2; //Or whatever you want.
     CornerBox(W2SP[0] - (width / 2), W2SP[1] - height, width, height, Color.Enemy.R, Color.Enemy.G, Color.Enemy.B, 255);
    Try and figure that out and post back your draw functions.
    Ok i figured out where the prob is, my world to screen is always returning true because i see did a green rectangle in the top left corner of cs go and this is always there if im in the menu of cs go or ingame in a round...

    Code:
    RECT W2S_Rect;
    
    typedef struct {
    	float flMatrix[4][4];
    }WorldToScreenMatrix_t;
    
    WorldToScreenMatrix_t W2S_M;
    
    bool WorldToScreen(float * from, float * to)
    {
    	W2S_M = Mem.Read<WorldToScreenMatrix_t>(dwClient + ViewMatrix);
    
    	to[0] = W2S_M.flMatrix[0][0] * from[0] + W2S_M.flMatrix[0][1] * from[1] + W2S_M.flMatrix[0][2] * from[2] + W2S_M.flMatrix[0][3];
    	to[1] = W2S_M.flMatrix[1][0] * from[0] + W2S_M.flMatrix[1][1] * from[1] + W2S_M.flMatrix[1][2] * from[2] + W2S_M.flMatrix[1][3];
    
    	float w = W2S_M.flMatrix[3][0] * from[0] + W2S_M.flMatrix[3][1] * from[1] + W2S_M.flMatrix[3][2] * from[2] + W2S_M.flMatrix[3][3];
    
    	if (w < 0.01f)
    		return false;
    
    	float invw = 1.0f / w;
    	to[0] *= invw;
    	to[1] *= invw;
    
    	int width = (int)(W2S_Rect.right - W2S_Rect.left);
    	int height = (int)(W2S_Rect.bottom - W2S_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 + W2S_Rect.left;
    	to[1] = y + W2S_Rect.top;
    
    	return true;
    }
    
    GetWindowRect(FindWindow(NULL, "Counter-Strike: Global Offensive"), &W2S_Rect);
    and Offsets and Funcs:

    Code:
    DWORD ViewMatrix = 0x4A3E664; //VIEWMATRIX
    DWORD dw_PlayerBase = 0x00A31504;
    DWORD dw_teamOffset = 0xFC;
    DWORD dw_healthOffset = 0xF0;
    DWORD dw_EntityBase = 0x04A4CAC4;
    DWORD dw_EntityLoopDistance = 0x10;
    DWORD dw_BoneMatrix = 0x2698;
    
    //Position Enemy:
    		float Position[3];
    
    		Position[0] = Mem.Read<float>(pEnemy + 0x134);
    		Position[1] = Mem.Read<float>(pEnemy + 0x138);
    		Position[2] = Mem.Read<float>(pEnemy + 0x13C);
    EDIT: If im using the Mem Functions for reading the viewmatrix, mw W2S ist always returning true, and if im using the RPM Method then it only return true if i looking in a const direction like north ... yk
    Last edited by xShouty; 06-28-2016 at 03:37 PM.

  12. #12
    Hunter's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    Depths Of My Mind.
    Posts
    17,468
    Reputation
    3771
    Thanks
    6,159
    My Mood
    Cheerful
    Believe this has been solved.

    /Closed.

Similar Threads

  1. [CS:GO] ESP Code [NEED HELP] Cheat not drawing ESP Boxes!
    By viking911 in forum Counter-Strike 2 Coding & Resources
    Replies: 17
    Last Post: 02-28-2019, 01:55 PM
  2. [Help] ESP Only drawing when looking certain directions
    By blackstab1337 in forum Garry's Mod Coding & Resources
    Replies: 15
    Last Post: 03-09-2015, 09:51 PM
  3. [Help Request] ESP Line Drawing Methods
    By FoxFort in forum C# Programming
    Replies: 3
    Last Post: 08-11-2014, 05:10 PM
  4. [Snippet]Draw Battery Box
    By kotentopf in forum C++/C Programming
    Replies: 5
    Last Post: 04-21-2011, 05:26 AM
  5. [Snippet]Draw RAM Box
    By kotentopf in forum C++/C Programming
    Replies: 18
    Last Post: 04-08-2011, 06:32 AM