Results 1 to 11 of 11
  1. #1
    KubuzKid420's Avatar
    Join Date
    Nov 2021
    Gender
    male
    Posts
    15
    Reputation
    10
    Thanks
    0

    ESP doesn't want to work

    Hello everyone, can someone please help with the esp? It doesn't want to work at all, I have suspicion that the getnodetransformation is broken which is causing the esp to fail.

    Code:
    void DX::DrawESP2D() {
        Game& g_CF = Game::get();
    
        if (!g_CF.CLT_SHELL || !g_CF.InGame() || !espOn) return;
    
        BYTE* curAddr = (BYTE*)(g_CF.CLT_SHELL + offs::ENT_BEGIN);
    
        for (int i = 0; i < 16; i++) {
            Player curP = *(Player*)curAddr;
    
            if (curP.info.health) {
                D3DXVECTOR3 ptH = D3DXVECTOR3(curP.model->posH.x, curP.model->posH.y, curP.model->posH.z);
                D3DXVECTOR3 ptF = D3DXVECTOR3(curP.model->posF.x, curP.model->posF.y, curP.model->posF.z);
                if (w2s(&ptH) && w2s(&ptF)) {
    
                    vec2 top, bot;
                    top.x = ptH.x;
                    top.y = ptH.y;
                    bot.x = ptF.x;
                    bot.y = ptF.y;
    
                    if (curP.info.team == 1)
                        DrawBox2D(top, bot, 2, D3DCOLOR_ARGB(255, 0, 0, 255));
                    else
                        DrawBox2D(top, bot, 2, D3DCOLOR_ARGB(255, 220, 170, 40));
    
                    HXDrawText(curP.info.name, bot.x, bot.y - 12, D3DCOLOR_ARGB(255, 255, 255, 255));
                    HXDrawText(std::to_string(curP.info.health).c_str(), top.x, top.y + 4, D3DCOLOR_ARGB(255, 255, 255, 255));
    
                }
            }
    
            curAddr += offs::ENT_SIZE;
        }
    
    }

    Code:
    void Game::GetBonePosition(PlayerModel* obj, uint32_t idx, LTransform* tfm) {
      pLTModel->GetNodeTransform(obj, idx, tfm, true);
    }
    
    Player* Game::GetPlayerByIndex(int i) {
      return (Player*)(CLT_SHELL + offs::ENT_BEGIN + (i * offs::ENT_SIZE));
    }
    
    class CLTModel
    {
    public:
      uint32_t GetNodeTransform(PlayerModel* hObj, uint32_t hNode, LTransform* transform, bool bWorldSpace)
      {
        typedef uint32_t(__thiscall* oGetNodeTransform)(void*, PlayerModel*, uint32_t, LTransform*, bool);
        return GetVFn<oGetNodeTransform>(this, 15)(this, hObj, hNode, transform, bWorldSpace);
      }
    };
    
    template< class type > type GetVFn(PVOID base, SIZE_T index)
    {
      DWORD64* vtablefunc = *(DWORD64**)base;
      return (type)(vtablefunc[index]);
    }
    
    void DX::DrawLine(vec2 start, vec2 end, int thickness, D3DCOLOR color) {
        if (!DXLINE)
            D3DXCreateLine(m_pDevice, &DXLINE);
    
        D3DXVECTOR2 Line[2];
        Line[0] = D3DXVECTOR2(start.x, start.y);
        Line[1] = D3DXVECTOR2(end.x, end.y);
        DXLINE->SetWidth(thickness);
        DXLINE->Draw(Line, 2, color);
    
    }
    void DX::DrawBox2D(vec2 top, vec2 bot, int thickness, D3DCOLOR color) {
        int height = abs(top.y - bot.y);
        vec2 tl, tr;
        tl.x = top.x - height / 4;
        tr.x = top.x + height / 4;
        tl.y = tr.y = top.y;
    
        vec2 bl, br;
        bl.x = bot.x - height / 4;
        br.x = bot.x + height / 4;
        bl.y = br.y = bot.y;
    
        DrawLine(tl, tr, thickness, color);
        DrawLine(bl, br, thickness, color);
        DrawLine(tl, bl, thickness, color);
        DrawLine(tr, br, thickness, color);
    }
    
    struct PlayerModel {
      char unk0[8]; 
      Vector3 posF;
      Vector3 posH;
    };
    struct PlayerInfo {
      __int8 clientID;
      __int8 team;
      char name[12];
      char unk0[46];
      __int32 health;
    };
    struct Player {
      PlayerModel* model;
      PlayerInfo info;
    };
    struct LTransform {
      Vector3 m_Vec;
      char unk[2048];
    };
    The offsets I used:
    const DWORD64 LT_SHELL = 0x1E39DD8;
    const DWORD64 LT_MODELCLIENT_PTR = 0x1E39708;
    const DWORD64 LOCAL_ENT = 0x298;
    const DWORD64 ENT_SIZE = 0xD98;
    const DWORD64 ENT_BEGIN = 0x289;


    Much appreciated for the help.
    Last edited by KubuzKid420; 11-26-2021 at 07:59 AM.

  2. #2
    Anger5K's Avatar
    Join Date
    May 2020
    Gender
    male
    Posts
    151
    Reputation
    10
    Thanks
    70
    My Mood
    Lurking
    Quote Originally Posted by KubuzKid420 View Post
    Hello everyone, can someone please help with the esp? It doesn't want to work at all, I have suspicion that the getnodetransformation is broken which is causing the esp to fail.

    Code:
    void DX::DrawESP2D() {
        Game& g_CF = Game::get();
    
        if (!g_CF.CLT_SHELL || !g_CF.InGame() || !espOn) return;
    
        BYTE* curAddr = (BYTE*)(g_CF.CLT_SHELL + offs::ENT_BEGIN);
    
        for (int i = 0; i < 16; i++) {
            Player curP = *(Player*)curAddr;
    
            if (curP.info.health) {
                D3DXVECTOR3 ptH = D3DXVECTOR3(curP.model->posH.x, curP.model->posH.y, curP.model->posH.z);
                D3DXVECTOR3 ptF = D3DXVECTOR3(curP.model->posF.x, curP.model->posF.y, curP.model->posF.z);
                if (w2s(&ptH) && w2s(&ptF)) {
    
                    vec2 top, bot;
                    top.x = ptH.x;
                    top.y = ptH.y;
                    bot.x = ptF.x;
                    bot.y = ptF.y;
    
                    if (curP.info.team == 1)
                        DrawBox2D(top, bot, 2, D3DCOLOR_ARGB(255, 0, 0, 255));
                    else
                        DrawBox2D(top, bot, 2, D3DCOLOR_ARGB(255, 220, 170, 40));
    
                    HXDrawText(curP.info.name, bot.x, bot.y - 12, D3DCOLOR_ARGB(255, 255, 255, 255));
                    HXDrawText(std::to_string(curP.info.health).c_str(), top.x, top.y + 4, D3DCOLOR_ARGB(255, 255, 255, 255));
    
                }
            }
    
            curAddr += offs::ENT_SIZE;
        }
    
    }

    Code:
    void Game::GetBonePosition(PlayerModel* obj, uint32_t idx, LTransform* tfm) {
      pLTModel->GetNodeTransform(obj, idx, tfm, true);
    }
    
    Player* Game::GetPlayerByIndex(int i) {
      return (Player*)(CLT_SHELL + offs::ENT_BEGIN + (i * offs::ENT_SIZE));
    }
    
    class CLTModel
    {
    public:
      uint32_t GetNodeTransform(PlayerModel* hObj, uint32_t hNode, LTransform* transform, bool bWorldSpace)
      {
        typedef uint32_t(__thiscall* oGetNodeTransform)(void*, PlayerModel*, uint32_t, LTransform*, bool);
        return GetVFn<oGetNodeTransform>(this, 15)(this, hObj, hNode, transform, bWorldSpace);
      }
    };
    
    template< class type > type GetVFn(PVOID base, SIZE_T index)
    {
      DWORD64* vtablefunc = *(DWORD64**)base;
      return (type)(vtablefunc[index]);
    }
    
    void DX::DrawLine(vec2 start, vec2 end, int thickness, D3DCOLOR color) {
        if (!DXLINE)
            D3DXCreateLine(m_pDevice, &DXLINE);
    
        D3DXVECTOR2 Line[2];
        Line[0] = D3DXVECTOR2(start.x, start.y);
        Line[1] = D3DXVECTOR2(end.x, end.y);
        DXLINE->SetWidth(thickness);
        DXLINE->Draw(Line, 2, color);
    
    }
    void DX::DrawBox2D(vec2 top, vec2 bot, int thickness, D3DCOLOR color) {
        int height = abs(top.y - bot.y);
        vec2 tl, tr;
        tl.x = top.x - height / 4;
        tr.x = top.x + height / 4;
        tl.y = tr.y = top.y;
    
        vec2 bl, br;
        bl.x = bot.x - height / 4;
        br.x = bot.x + height / 4;
        bl.y = br.y = bot.y;
    
        DrawLine(tl, tr, thickness, color);
        DrawLine(bl, br, thickness, color);
        DrawLine(tl, bl, thickness, color);
        DrawLine(tr, br, thickness, color);
    }
    
    struct PlayerModel {
      char unk0[8]; 
      Vector3 posF;
      Vector3 posH;
    };
    struct PlayerInfo {
      __int8 clientID;
      __int8 team;
      char name[12];
      char unk0[46];
      __int32 health;
    };
    struct Player {
      PlayerModel* model;
      PlayerInfo info;
    };
    struct LTransform {
      Vector3 m_Vec;
      char unk[2048];
    };
    The offsets I used:
    const DWORD64 LT_SHELL = 0x1E39DD8;
    const DWORD64 LT_MODELCLIENT_PTR = 0x1E39708;
    const DWORD64 LOCAL_ENT = 0x298;
    const DWORD64 ENT_SIZE = 0xD98;
    const DWORD64 ENT_BEGIN = 0x289;


    Much appreciated for the help.
    if this west LT_SHELL = 0x1E39DD8 wrong
    Right:
    Code:
    0x1E4B088: // F2 0F 11 8F ? ? ? ? 48 8B 05 ? ? ? ? 48 8B 88 ? ? ? ?
    then check your class cplayer

    Code:
    class CPlayer 
    {
    public:
    	char pad_0000[8]; //0x0000
    	cObject* Object;
    	uint8_t ClientID; //0x0010
    	uint8_t TeamID; //0x0011
    	char Name[12]; //0x0012
    	char pad_001E[2]; //0x001E
    	CharactherFx* pCharactherFx; //0x0020 //
    	__int32 Index; //0x0028
    	char pad_002C[4]; //0x002C
    	__int32 HasC4; //0x0030
    	__int32 State; //0x0034
    	__int32 Rank; //0x0038
    	char pad_003C[16]; //0x003C
    	__int32 health; //0x004C
    	__int32 Kills; //0x0050
    	__int32 Deathes; //0x0054
    	__int32 Headshots; //0x0058
    	__int32 Team; //0x005C
    	__int32 Ping; //0x0060
    	char pad_0064[4520]; //0x0064
    }; //Size: 0x120C
    Last edited by Anger5K; 11-26-2021 at 11:50 AM.

  3. #3
    KubuzKid420's Avatar
    Join Date
    Nov 2021
    Gender
    male
    Posts
    15
    Reputation
    10
    Thanks
    0

    ESP still not working

    Quote Originally Posted by Anger5K View Post
    if this west LT_SHELL = 0x1E39DD8 wrong
    Right:
    Code:
    0x1E4B088: // F2 0F 11 8F ? ? ? ? 48 8B 05 ? ? ? ? 48 8B 88 ? ? ? ?
    then check your class cplayer

    Code:
    class CPlayer 
    {
    public:
    	char pad_0000[8]; //0x0000
    	cObject* Object;
    	uint8_t ClientID; //0x0010
    	uint8_t TeamID; //0x0011
    	char Name[12]; //0x0012
    	char pad_001E[2]; //0x001E
    	CharactherFx* pCharactherFx; //0x0020 //
    	__int32 Index; //0x0028
    	char pad_002C[4]; //0x002C
    	__int32 HasC4; //0x0030
    	__int32 State; //0x0034
    	__int32 Rank; //0x0038
    	char pad_003C[16]; //0x003C
    	__int32 health; //0x004C
    	__int32 Kills; //0x0050
    	__int32 Deathes; //0x0054
    	__int32 Headshots; //0x0058
    	__int32 Team; //0x005C
    	__int32 Ping; //0x0060
    	char pad_0064[4520]; //0x0064
    }; //Size: 0x120C

    Hey, thanks for the help.

    But the esp still doesn't want to work. Here is what I have changed:

    Code:
    void DX::DrawESP2D() {
      Game& g_CF = Game::get();
    
      if (!g_CF.CLT_SHELL || !g_CF.InGame() || !espOn) return;
    
      BYTE* curAddr = (BYTE*)(g_CF.CLT_SHELL + offs::ENT_BEGIN);
    
      for (int i = 0; i < 16; i++) {
        Player curP = *(Player*)curAddr;
    
        if (curP.health) {
          D3DXVECTOR3 ptH = D3DXVECTOR3(curP.Object->Head.x, curP.Object->Head.y, curP.Object->Head.z);
          D3DXVECTOR3 ptF = D3DXVECTOR3(curP.Object->Foot.x, curP.Object->Foot.y, curP.Object->Foot.z);
          
          if (w2s(&ptH) && w2s(&ptF)) {
    
            vec2 top, bot;
            top.x = ptH.x;
            top.y = ptH.y;
            bot.x = ptF.x;
            bot.y = ptF.y;
    
            if (curP.Team == 1)
              DrawBox2D(top, bot, 2, D3DCOLOR_ARGB(255, 0, 0, 255));
            else
              DrawBox2D(top, bot, 2, D3DCOLOR_ARGB(255, 220, 170, 40));
    
            HXDrawText(curP.Name, bot.x, bot.y - 12, D3DCOLOR_ARGB(255, 255, 255, 255));
            HXDrawText(std::to_string(curP.health).c_str(), top.x, top.y + 4, D3DCOLOR_ARGB(255, 255, 255, 255));
    
          }
        }
    
        curAddr += offs::ENT_SIZE;
      }
    
    }
    The structs which you provided:

    Code:
    struct PlayerModel {
      char unk0[8]; //vTable
      // X: left-/right+ 
      // Y: vertical down-/up+
      // Z: back-/forward+
      Vector3 posF;
      Vector3 posH;
    };
    struct PlayerInfo {
      __int8 clientID;
      __int8 team;
      char name[12];
      char unk0[46];
      __int32 health;
    };
    
    class CharactherFx
    {
    public:
    	BYTE& IsDead() const
    	{
    		static int _Offset = 0x200;
    		return *(BYTE*)((uintptr_t)this + _Offset);
    	}
    	BYTE& SpawnShield() const
    	{
    
    		static int _Offset = 0x214;
    		return *(BYTE*)((uintptr_t)this + _Offset);
    	}
    	WORD& WeaponESP() const
    	{
    
    		int _Offset = 0xEF14;
    		return *(WORD*)((uintptr_t)this + _Offset);
    	}
    };
    
    struct cObject
    {
    public:
    	char _UnkSpace[4];
    	D3DXVECTOR3 Body;
    	D3DXVECTOR3 Foot;
    	D3DXVECTOR3 Head;
    
    	D3DXVECTOR3& GetPosition() const
    	{
    		return *(D3DXVECTOR3*)((uintptr_t)this + 0x00E8);
    	}
    };
    
    struct Player {
    	char pad_0000[8]; //0x0000
    	cObject* Object;
    	uint8_t ClientID; //0x0010
    	uint8_t TeamID; //0x0011
    	char Name[12]; //0x0012
    	char pad_001E[2]; //0x001E
    	CharactherFx* pCharactherFx; //0x0020 //
    	__int32 Index; //0x0028
    	char pad_002C[4]; //0x002C
    	__int32 HasC4; //0x0030
    	__int32 State; //0x0034
    	__int32 Rank; //0x0038
    	char pad_003C[16]; //0x003C
    	__int32 health; //0x004C
    	__int32 Kills; //0x0050
    	__int32 Deathes; //0x0054
    	__int32 Headshots; //0x0058
    	__int32 Team; //0x005C
    	__int32 Ping; //0x0060
    	char pad_0064[4520]; //0x0064
    };
    struct LTransform {
      Vector3 m_Vec;
      char unk[2048];
    };
    The angles:

    Code:
    void Game::GetAnglesToPlayer(Player* me, Player* target, Vec2& out) {
      LTransform tfmMe, tfmEn;
      PlayerModel lol;
      PlayerModel stupidTarget;
      lol.posH.x = me->Object->Head.x;
      lol.posH.y = me->Object->Head.y;
      lol.posH.z = me->Object->Head.z;
      lol.posF.x = me->Object->Foot.x;
      lol.posF.y = me->Object->Foot.y;
      lol.posF.z = me->Object->Foot.z;
    
      stupidTarget.posH.x = target->Object->Head.x;
      stupidTarget.posH.y = target->Object->Head.y;
      stupidTarget.posH.z = target->Object->Head.z;
      stupidTarget.posF.x = target->Object->Foot.x;
      stupidTarget.posF.y = target->Object->Foot.y;
      stupidTarget.posF.z = target->Object->Foot.z;
    
      GetBonePosition(&lol, 6, &tfmMe);
      GetBonePosition(&stupidTarget, 6, &tfmEn);
      Vector3 dV = tfmEn.m_Vec - tfmMe.m_Vec;
      float dist = dV.Length();
      out.x = atan2(dV.x, dV.z);
      out.y = -asin(dV.y / dist);
    }
    I have also updated the offsets which are 100% correct

    Thank you for taking the time to help me.

  4. #4
    Anger5K's Avatar
    Join Date
    May 2020
    Gender
    male
    Posts
    151
    Reputation
    10
    Thanks
    70
    My Mood
    Lurking
    check Position offset...

    Code:
    D3DXVECTOR3& MyPosition() const
    {
         return *(D3DXVECTOR3*)((uintptr_t)this + 0x18C);
    }
    and wait all access wrong bro
    Last edited by Anger5K; 11-27-2021 at 12:48 PM.

  5. #5
    KubuzKid420's Avatar
    Join Date
    Nov 2021
    Gender
    male
    Posts
    15
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by Anger5K View Post
    check Position offset...

    Code:
    D3DXVECTOR3& MyPosition() const
    {
         return *(D3DXVECTOR3*)((uintptr_t)this + 0x18C);
    }
    and wait all access wrong bro
    Could you please give me the correct ones?

  6. #6
    KubuzKid420's Avatar
    Join Date
    Nov 2021
    Gender
    male
    Posts
    15
    Reputation
    10
    Thanks
    0

    Anger

    Quote Originally Posted by KubuzKid420 View Post
    Could you please give me the correct ones?
    @Anger5K please reply.

  7. #7
    KubuzKid420's Avatar
    Join Date
    Nov 2021
    Gender
    male
    Posts
    15
    Reputation
    10
    Thanks
    0
    Very nice to know that the cf cheat community helps each other.

  8. #8
    Joaoemariana's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    Brasil
    Posts
    59
    Reputation
    10
    Thanks
    14
    do you think someone will do the work for you? learn c++ first. the guy already gave you everything and you still couldn't copy and paste

  9. #9
    KubuzKid420's Avatar
    Join Date
    Nov 2021
    Gender
    male
    Posts
    15
    Reputation
    10
    Thanks
    0

    Bruh...

    Quote Originally Posted by Joaoemariana View Post
    do you think someone will do the work for you? learn c++ first. the guy already gave you everything and you still couldn't copy and paste
    Dude.. I am not asking anyone to give me the ready code, am just asking to pin point the mistake in the code. Anger said the "access" is wrong and I don't understand what he means by it. I just wanted clarification

  10. #10
    Joaoemariana's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    Brasil
    Posts
    59
    Reputation
    10
    Thanks
    14
    besides your cObject structure is incorrect, Anger simply pointed out that you are accessing an offset wrong. what did you fail to understand?

    first that the cObject class doesn't have the head or foot value, you need to call GetNodeTransform to convert to the body bones you want, or find a pointer in this same class that points to the bones -> https://www.mpgh.net/forum/showthread.php?t=1542795

  11. #11
    KubuzKid420's Avatar
    Join Date
    Nov 2021
    Gender
    male
    Posts
    15
    Reputation
    10
    Thanks
    0

    Appreciate it

    Quote Originally Posted by Joaoemariana View Post
    besides your cObject structure is incorrect, Anger simply pointed out that you are accessing an offset wrong. what did you fail to understand?

    first that the cObject class doesn't have the head or foot value, you need to call GetNodeTransform to convert to the body bones you want, or find a pointer in this same class that points to the bones -> https://www.mpgh.net/forum/showthread.php?t=1542795
    Gotchu. Thank you.

Similar Threads

  1. why doesn't my chams work when i use my chams?
    By El Narco in forum Combat Arms Discussions
    Replies: 4
    Last Post: 09-01-2009, 06:00 PM
  2. Replies: 25
    Last Post: 08-25-2009, 05:38 PM
  3. Hacks doesn't want to work now
    By Big87 in forum Combat Arms Hacks & Cheats
    Replies: 3
    Last Post: 08-08-2009, 05:34 PM
  4. typlo doesn't want people to know
    By ace76543 in forum General
    Replies: 32
    Last Post: 06-29-2008, 09:22 PM
  5. i dont want to work
    By Gourav2122 in forum Flaming & Rage
    Replies: 13
    Last Post: 05-10-2008, 12:51 AM